sql statement

  • Thread starter Thread starter Terry VanDuzee
  • Start date Start date
T

Terry VanDuzee

Hello
Can anyone suggest what may be wrong with this sql statement/quotes?

sql = " insert into names
(strName,Address,City,State,Zip,Phone,dtmdate,Comments ) " & _
" values ('" & strName & "','" & Address & "','" & _
City & "','" & State & "','" & Zip & "','" & Phone & "',#" & dtmdate &
"# & "','" & Comments )"

I know this works:
sql = " insert into names (strName,Address,City,State,Zip,Phone,dtmdate ) "
& _
" values ('" & strName & "','" & Address & "','" & _
City & "','" & State & "','" & Zip & "','" & Phone & "',#" & dtmdate &
"#)"

All I did was add a comments field on the end. I cannot figure out why it
is not working. I comes up saying:

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression '#8/6/2003# &'.

The sql is within an asp page, but I cannot figure out the proper syntax for
the quotes

Thank you so much

Terry V
 
Back
Top