You cannot open a recordset (RSinfo) on a "UPDATE..." SQL statement., You
open Recordset against either a table, or a query, or a "SELECT..." SQL
statement.
In your case, you want to update data ack to database. There is no need to
open a Recordset just to send that little amount of data back. You call
Database.Execute("UPDATE..."). That is:
DBinfo.Execute SQLQuery
Of course you have to make sure your "UPDATE..." statement is correct. Hind:
according to your this post, "lastweldno" seems a numeric type, while
according to your next post, it became text type. So, make sure what type
the value should be, then you can decide if the value has to be placed
between '...' or not.
"acadape" wrote in message news:6268345@discussion.autodesk.com...
hello fellas, could anyone please point out whats wrong with my SQL string?
when i run the RSinfo line i get an invalid arguement error.
SQLQuery = "UPDATE tblcompleteupdatetable " & _
"SET tblcompleteupdatetable.lastweldno = " & WeldNumber & " " & _
"WHERE tblcompleteupdatetable.linenumber = '" & DwgLineNumber & _
"' AND tblcompleteupdatetable.workpacknumber = '" & WorkPackNumber & "' ;"
ActiveDB = "P:\Plant_Projects\PlantProjects.mdb"
Set DBinfo = OpenDatabase(ActiveDB) 'Open database
Set RSinfo = Nothing
Set AllTables = DBinfo.TableDefs
For Each oTable In AllTables
If LCase(oTable.Name) Like "tblcompleteupdatetable" = True Then
Set RSinfo = DBinfo.OpenRecordset(SQLQuery, dbOpenDynaset)