I am using the following code to connect to and insert data into a sql db. I get an error stating that the SQL statment coudn't be prepared. I have new used Rdo and Sql, ususally just use acess. Any help or links would be great.
Thanks
Nick
Dim en As rdoEnvironment
Dim cn As New rdoConnection
Set en = rdoEnvironments(0)
Conn = "DSN=SMHost;UID=sa;PWD=;DATABASE=SMHost;"
Set cn = en.OpenConnection("", rdDriverNoPrompt, False, Conn)
cn.QueryTimeout = 0
sSQL = "insert nh_inventory(DB_KEY,DB_STORENUM,DB_RECEIVERNUM,) " & _
"values(" & storenum & "," & storenum & "," & receivernum & ""
cn.Execute (sSQL)
Thanks
Nick
Dim en As rdoEnvironment
Dim cn As New rdoConnection
Set en = rdoEnvironments(0)
Conn = "DSN=SMHost;UID=sa;PWD=;DATABASE=SMHost;"
Set cn = en.OpenConnection("", rdDriverNoPrompt, False, Conn)
cn.QueryTimeout = 0
sSQL = "insert nh_inventory(DB_KEY,DB_STORENUM,DB_RECEIVERNUM,) " & _
"values(" & storenum & "," & storenum & "," & receivernum & ""
cn.Execute (sSQL)