Insert statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I haven't quite caught on to getting this right. Thanks in advance for
helping my syntax. Something's wrong with the quote marks:

strInsert = "INSERT SentinelNodeSt(AppointmentID, EmpCreated,
EmpUpdated)" & _
" VALUES(" & mlngAppointmentID & ", ' " & fstrGetUserName & " ', ' " &
fstrGetUserName " ')"

TIA
 
You are missing the key word 'INTO', and unless you want to put spaces into
the data you need to remove them from inside your single quotes:

strInsert = "INSERT INTO SentinelNodeSt(AppointmentID, EmpCreated,
EmpUpdated)" & _
" VALUES(" & mlngAppointmentID & ", '" & fstrGetUserName & "', '" &
fstrGetUserName "')"

HTH
John
 
Back
Top