Hello All
I have this code in an excel sheet
that has 1 SQl statement in it. I need to put another SQL statement in but dont know how or if it can be done.
Required SQL:
'update wip set wstate = 'RUN' where wona = ('" & a & "')
and wopnumber =('" & b & "')and wstate ='ns'"
Thanks for any help
Dim strString As String
Dim a, b
Dim conn As New Connection
Dim rec As New Recordset
Dim ws As Worksheet
Dim sql$
today = Date
strString = txt1
'Range("A1")
a = Mid(strString, 2, InStr(strString, "%") - 2) 'get value of barcode from midstring from % and starts from 2nd letter
'Range("A1") = Left(strString, InStr(strString, "%") - 1)dead line
'Range("B1")
b = Right(strString, Len(strString) - InStr(strString, "%")) ' value of barcode from % to the end
'MsgBox (a & b)
conn.Open "provider=msdasql.1;driver=sql server;server=wrem-efacs;database=efacdb"
sql = "insert into used values ('" & a & "','" & b & "','DIGIT','1','1001','1','RUN','" & today & "',' ','2000-01-02 00:00:00',' ','1.0',' ',' ',' ','0.0','0.0',' ',0.000,0.000,' ',0.000,' ')"
rec.Open sql, conn
txt1 = Null 'clears contents of textbox
I have this code in an excel sheet
that has 1 SQl statement in it. I need to put another SQL statement in but dont know how or if it can be done.
Required SQL:
'update wip set wstate = 'RUN' where wona = ('" & a & "')
and wopnumber =('" & b & "')and wstate ='ns'"
Thanks for any help
Dim strString As String
Dim a, b
Dim conn As New Connection
Dim rec As New Recordset
Dim ws As Worksheet
Dim sql$
today = Date
strString = txt1
'Range("A1")
a = Mid(strString, 2, InStr(strString, "%") - 2) 'get value of barcode from midstring from % and starts from 2nd letter
'Range("A1") = Left(strString, InStr(strString, "%") - 1)dead line
'Range("B1")
b = Right(strString, Len(strString) - InStr(strString, "%")) ' value of barcode from % to the end
'MsgBox (a & b)
conn.Open "provider=msdasql.1;driver=sql server;server=wrem-efacs;database=efacdb"
sql = "insert into used values ('" & a & "','" & b & "','DIGIT','1','1001','1','RUN','" & today & "',' ','2000-01-02 00:00:00',' ','1.0',' ',' ',' ','0.0','0.0',' ',0.000,0.000,' ',0.000,' ')"
rec.Open sql, conn
txt1 = Null 'clears contents of textbox