VB Help
I have used VB in school I was pretty proficient but that was ages ago.
I read some of the community code to set up something that works.
The Database has 3 fields id, used flag, and datetime stamp.
I pull the top id and set it to used, and print
Dim SQL
Dim ordno
Set objConn = CreateObject("ADODB.Connection")
set rs = createobject("ADODB.Recordset")
connstr="Driver={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost;DATABASE=idson;USER=*****;PASSWORD=**********;OPTION=3;"
objConn.Open connstr
Set rs = CreateObject("ADODB.Recordset")
Set rs = objConn.Execute("SELECT idnew_table FROM idson.qrgen where used = 0 Limit 1")
ordno=rs.fields("idnew_table")
SQL ="UPDATE idson.qrgen set used='1', DT = NOW() where idnew_table='" & ordno & "'"
objConn.execute SQL
Value = ordno
objConn.close
This is OnNewRecord in data source.
The problem is this code only lets me print one code at a time.
Please sign in to leave a comment.
Comments
0 comments