Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert SQL and RecordSets 1

Status
Not open for further replies.

seema165

Programmer
Jul 11, 2005
48
0
0
GB
Hi,

I have an error in my code which says:

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ':'.
At line 69.

Here's the code:

strInsertSQL = "INSERT INTO Navigation (UserName, SystemTime, InitialProcess, OpportunityGUID, ActivityGUID) "
strInsertSQL = strInsertSQL & "VALUES (" & userID & ", " & time() & ", " & "TEST" & ", " & "Blank" & ", " & strActivityID & ")"

objRS= objConn.Execute(strInsertSQL)

line 69 of my code is the last line above where it executes the sql. The connection I have used is:

Const ODBCConnection = "Driver={SQL Server};Server=AGGTEX;Database=Rental;Uid=xxx;Pwd=xxx;"

I know the connection works as I have successfully managed to do a select statement using the same database.

Please could somebody help as I have been working on this for a while.

Thanks in advance :)
 
Cheers Tony!

I always forget to add the obvious things to my code! ;-)


Thanks for all your help today :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top