hello all,
I'm getting an error that I can seem to find its location anywhere, maybe you can help me.
My code:
sql = "SELECT ProductName FROM tblSupports"
set rsFind = objConn.Execute(sql)
Do While Not rsFind.EOF
sqlX = "SELECT ProductID FROM tblProducts WHERE ShortName = '" & rsFind("ProductName") & "'"
set rsMatch = objConn.Execute(sqlX)
do while not rsMatch.eof
sql = "UPDATE tblSupports SET ProductID = " & rsMatch("ProductID") & " WHERE ProductName = '" & rsFind("ProductName") & "'"
objConn.Execute sql
rsMatch.movenext
loop
rsFind.MoveNext
Loop
the ERROR:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 's'.
Thanks!
I'm getting an error that I can seem to find its location anywhere, maybe you can help me.
My code:
sql = "SELECT ProductName FROM tblSupports"
set rsFind = objConn.Execute(sql)
Do While Not rsFind.EOF
sqlX = "SELECT ProductID FROM tblProducts WHERE ShortName = '" & rsFind("ProductName") & "'"
set rsMatch = objConn.Execute(sqlX)
do while not rsMatch.eof
sql = "UPDATE tblSupports SET ProductID = " & rsMatch("ProductID") & " WHERE ProductName = '" & rsFind("ProductName") & "'"
objConn.Execute sql
rsMatch.movenext
loop
rsFind.MoveNext
Loop
the ERROR:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 's'.
Thanks!