Can someone tell me whats broken in this SQL state

Results 1 to 2 of 2

Thread: Can someone tell me whats broken in this SQL state

  1. #1
    Mike Martin Guest

    Default Can someone tell me whats broken in this SQL state

    I get a syntax error whenever my asp program tries to execute this:<BR><BR> sSQL = "INSERT INTO Message ( `From`, Email, Subject, Body, When, MsgLevel, PrevRef, ThreadPos, GroupName, Host ) " _<BR> & "VALUES (&#039" & strFrom & "&#039, &#039" & strEmail & "&#039, &#039" & strSubject _<BR> & "&#039, &#039" & strBody &"&#039, &#039" & CStr(Now()) & "&#039, " & intNewMsgLevel _<BR> & ", " & lngPrevRef & ", " & intNewThreadPos & ", &#039" & strGroup & "&#039, &#039" &strHost &"&#039);"<BR> &#039Response.Write sSQL<BR> db.Execute(sSQL)<BR> <BR>Thanks!<BR><BR>Mike

  2. #2
    stephen of new york Guest

    Default RE: Can someone tell me whats broken in this SQL s

    it seems you stopped putting the single quotes around <BR>" & intNewMsgLevel _<BR>& ", " & lngPrevRef & ", " & intNewThreadPos & ", <BR><BR>try this <BR>&#039" & intNewMsgLevel _<BR>& "&#039, &#039" & lngPrevRef & "&#039, &#039" & intNewThreadPos & "&#039, <BR><BR>I don&#039t think you need a semi colon at the end <BR>I&#039m not sure you need the single quote around the word from.<BR>sSQL = "INSERT INTO Message ( `From`, <BR><BR>try these changes one at a time and do response.write sSQL to see if you have a nice string

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •