|
Yes, it's possible. It's not even particularly difficult.
But ... Please don't repost if your question does not appear immediately: all of these went to moderation and required a human being to review them for publication. In order to prevent you being kicked off as a spammer, both had to be accepted, and then I have to clean up the spares. Have a little patience, please!
I've deleted the spare ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
As long as it use logical rules and mathematics, it is possible and with about any programming language.
But for this, you need to learn programming, but we can't teach you in the scope of this forum.
Advice: solve the problem by hand, the procedure you followed is basically your algorithm.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
how to search record in gridview in vb 6.0
|
|
|
|
|
|
You normally would never search the gridview itself. You search the data source the grid is bound to.
|
|
|
|
|
When exporting data from SQL Server to Excel, when a field size is large e.g. varchar() might cause the error below:
String or binary data would be truncated.
The statement has been terminated.
|
|
|
|
|
Is that supposed to be a question or a statement?
|
|
|
|
|
Please google: "excel maximum cell text length"
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi there.
im creating a label sequencer for 3 produts and i'm trying this but with no success
sql_query.CommandText = "insert into tablelabel02 with (tablockx) (nome_posto, ordemfabrico, serialnumber, referencia,dataetiqueta,qrgerado,data,operador,posx,posy,impressora,controlo)output inserted.qrgerado
values (@posto, @ordemfabrico, next value for '" & sequenceID & "' , @refcode, replace(cast(convert(varchar,getdate(),5) as varchar(10)),'-','/'),
@refcode+replace(cast(convert(varchar,getdate(),5)as varchar(10)),'-','')+right('000'+cast((next value for '" & sequenceID & "' )as varchar (4)),4), getdate(), @operador,@labelx,@labely, @impressora, 'xx' );"
for each product i have created a sequence in ms sql, so when i inserted the production order number, i can sort what sequencer to use but i cant use it as sequenceID variable.
i tried
next value for seq_a and it works.
with
next value for '" & sequenceID & "' not working
in resume:
i want to use next value for @variable if possible
|
|
|
|
|
Can you define not working? It will be helpful if you can share the error message.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
I wanted to use next value for X where x is a variable and not have to put the name of the sequence table
|
|
|
|
|
Currently I have this:
Private Sub btnCount_Click(sender As Object, e As EventArgs) Handles btnCount.Click
Dim arrsize = rtbDHCP_lease.Lines.Length - 1
Dim MyNum(arrsize)
For I = 1 To arrsize
MyNum(I) = rtbDHCP_lease.Lines(I).Substring(41, (rtbDHCP_lease.Lines(I).IndexOf(".", 41) - 41))
ProgressBar1.Value = (I / arrsize) * 100
Next
Dim query = From item In MyNum
Order By item
Group By vlans = item
Into vlans_count = Group, Count()
For Each result In query
dgvDHCPcount.Rows.Add(New Integer() {result.vlans, result.Count})
Next
End Sub
It takes a long time to go through the richtextbox especially if it has a large amount of lines. Is there a process the can speed it up?
Thanks in advance.
|
|
|
|
|
First question.
Why are you using a RTB as a data storage structure? That text should be parsed to grab the data out of the text file itself and not from the RTB.
The mistake most people new to writing code in a GUI environment is treating visual controls as workable containers for data structures and data storage. That's not what they are for and will only make parsing and working with the data much, much slower.
So where did the data you put in the RTB come from?
|
|
|
|
|
I am a vb6 developper and when I install my apps they look different, sometimes with larger windows some other times smaller windows. So, how can I work with form properties so that they look the same?
Kind regards,
Alexis
|
|
|
|
|
You have to resize controls and forms relative to the screen size. It's a pain.
Alternatively, see my comment below about using VB.Net instead - then a lot of the pain is taken away with standard properties.
|
|
|
|
|
Quote: I am a vb6 developper
I hate to tell you this, but your skill set is just about completely worthless. VB6 has been dead for quite a long time.
If you're asking this question, it suggests you haven't been writing VB6 code for that long. I would suggest dropping it in favor of at least VB.NET. The Community edition of VIsual Studio is free from here[^].
If you continue down the VB6 road, you'll end up with a skill set that's not being used at all and VB6 will teach you very bad habits you're going to have to unlearn to do things correctly in the modern world.
|
|
|
|
|
UWP apps (windows 10) looks good on all screens; with no tweaking.
Using the control panel's "Ease of Access", you can change the text size, if necessary. That's about all that's ever needed.
The "simulator" lets you run at various screen resolutions to see.
Apps can be "side-loaded" without using the MS Store for distribution.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hey guys,
I ve been having a problem with components while installing any app that I ve developped in vb6. Now, I want to include my downloded .ocx and .dll in the folder with other when I make my setup but I still have a problem of components registration. I am still forced to register the components manually. Is there any way the setup can register automatically the components like other apps?
Thanks
|
|
|
|
|
You do know that VB6 has been out of support for decades now?
And that it needs to be registered using the 32-bit version of regsvr32.exe?
You will need to explicitly give the full path to SysWOW64\regsvr32.exe.
You will need to make sure all of the associated dll's etc for VB6 Runtime are also installed - if your version of Windows still supports them.
Better option - get a more recent copy of Visual Studio and rewrite your application in VB.net - it's free, unlike VB6
|
|
|
|
|
Just seen the original post and the only, completely useless reply. In my opinion and experience, the best free installer can be found here: Inno Setup[^]
I have used the software with great success in any number of situations and for many different products. It just requires a bit of reading of the very extensive documentation. Help is readily available.
Hope you find this answers your question and needs.
|
|
|
|
|
hi every one i have this code to generate a sequential serial number.
and have another private sub to retrive the last inserted serial number
is it possible to do that in this one?
<pre> Private Sub Gera2d()
Try
data = DateAndTime.Now
Dim con As New SqlConnection
Dim sql_query As New SqlCommand
Dim sql_result As SqlDataReader
con.ConnectionString = "server='" & SqlServer & "';Database=etiquetasKLC;Uid='" & SqlUser & "';PWD='" & Sqlpassword & "';"
sql_query.Connection = con
con.Open()
sql_query.Parameters.Add("@posto", SqlDbType.NVarChar).Value = posto
sql_query.Parameters.Add("@data", SqlDbType.NVarChar).Value = data
sql_query.Parameters.Add("@lote", SqlDbType.NVarChar).Value = ordemFabrico
sql_query.Parameters.Add("@versao", SqlDbType.NVarChar).Value = status
sql_query.Parameters.Add("@indexnumber", SqlDbType.NVarChar).Value = cavidade + indexnumber
sql_query.Parameters.Add("@semana", SqlDbType.NVarChar).Value = weekyear
sql_query.Parameters.Add("@qrgerado", SqlDbType.NVarChar).Value = codigoQr
sql_query.Parameters.Add("@operador", SqlDbType.NVarChar).Value = op
sql_query.Parameters.Add("@partnumber", SqlDbType.NVarChar).Value = partnumber
sql_query.Parameters.Add("posx", SqlDbType.NVarChar).Value = labelx
sql_query.Parameters.Add("posy", SqlDbType.NVarChar).Value = labely
sql_query.Parameters.Add("ip_impressora", SqlDbType.NVarChar).Value = enderecoimpressora
sql_query.CommandText = "INSERT INTO etiquetas with (tablockx)(nome_posto, data, lote, serialnumber,partnumber,versao,indexnumber,semana, qrgerado,operador,snpn,posx,posy,impressora) select top (1) @posto,
@data,@lote,T.x,@partnumber,@versao, @indexnumber,@semana, T.x+@partnumber+@versao+@indexnumber+@semana, @operador, T.x+@partnumber, @posx,@posy,@ip_impressora
FROM [etiquetas] x CROSS APPLY (VALUES(format(convert(int,x.serialnumber)+1,'0000000')))T(x) where partnumber like @partnumber order by id desc ;"
sql_query.Parameters.AddWithValue("@sn", serialnumber)
serialnumber = sql_query.ExecuteScalar()
Try
If sql_query.ExecuteScalar() <> 0 Then
serialnumber = serialnumber
End If
Catch ex As Exception
IO.File.AppendAllText("C:\ti\Log.txt", String.Format("{0}{1}", Environment.NewLine, Now() + " - " + ex.ToString()))
End Try
con.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
modified 17-Dec-19 11:12am.
|
|
|
|
|
SQL does auto increment on identity columns so perhaps make use of that. As for your question, the answer is yes. Just call that method here.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
Member 14668666 wrote:
serialnumber = sql_query.ExecuteScalar()
Try
If sql_query.ExecuteScalar() <> 0 Then NB: You're executing the INSERT query twice every time you call this method.
Also, ExecuteScalar won't have anything to return, since your query doesn't return any records.
Add an OUTPUT clause[^] to your query:
sql_query.CommandText = "INSERT INTO etiquetas WITH (tablockx) (nome_posto, data, lote, serialnumber, partnumber, versao, indexnumber, semana, qrgerado, operador, snpn, posx, posy, impressora) OUTPUT inserted.serialnumber SELECT TOP (1) @posto, @data, @lote, T.x, @partnumber, @versao, @indexnumber, @semana, T.x + @partnumber + @versao + @indexnumber + @semana, @operador, T.x + @partnumber, @posx, @posy, @ip_impressora FROM [etiquetas] x CROSS APPLY (VALUES(format(convert(int, x.serialnumber) + 1, '0000000'))) T(x) WHERE partnumber LIKE @partnumber ORDER BY id DESC;" Remove the @sn parameter, since it's not used in the query.
Change your code so that it only executes the query once.
Try
serialnumber = sql_query.ExecuteScalar()
Catch ex As Exception
IO.File.AppendAllText("C:\ti\Log.txt", String.Format("{0}{1}", Environment.NewLine, Now() + " - " + ex.ToString()))
End Try
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thanks a lot.
it work like charm
|
|
|
|
|