Please. What's wrong with my SQL Syntax?

Results 1 to 3 of 3

Thread: Please. What's wrong with my SQL Syntax?

  1. #1
    Stephen of New York Guest

    Default Please. What's wrong with my SQL Syntax?

    Gentlemen and Ladies;<BR>What is wrong with this syntax ? This gives the error message:<BR>Microsoft VBScript compilation error &#039 800a0401&#039 <BR>Expected end of statement <BR> <BR>strSQL="UPDATE chrprofiles1 SET Gender =&#039" & Session("gender") & "&#039, Hidden=&#039" & Session("hidden") & "&#039, WHERE Email = &#039& Session("email") &&#039"<BR><BR>you can copy and paste it in order to examine it.<BR>&#060;%<BR>Dim objBConn<BR>Set objBConn = Server.CreateObject("ADODB.Connection")<BR>objBCon n.Open "DSN=someaccessdatabase"<BR><BR>Dim objBRS<BR>Set objBRS = Server.CreateObject("ADODB.Recordset")<BR><BR>objB RS.LockType = adOpenStatic <BR>objBRS.CursorType = adOpenForwardOnly <BR><BR>Dim strSQL<BR>Session("hidden") ="test c"<BR>Session("gender") ="test d"<BR>Session("Email") = "MrHitmaker@aol.com"<BR><BR>strSQL="UPDATE chrprofiles1 SET Gender =&#039" & Session("gender") & "&#039, Hidden=&#039" & Session("hidden") & "&#039, WHERE Email = &#039& Session("email") &&#039"<BR>Response.write strSQL<BR>objBRS.Open strSQL, objBConn<BR><BR><BR><BR>%&#062;<BR><BR>Response.wr ite strSQL<BR>objBRS.Open strSQL, objBConn

  2. #2
    Join Date
    Dec 1969
    Posts
    1,388

    Default RE: Please. What's wrong with my SQL Syntax?

    This is the correct syntax, you got a little messed up in the quotes for the EMail<BR><BR>strSQL="UPDATE chrprofiles1 SET Gender =&#039" & Session("gender") & "&#039, Hidden=&#039" & Session("hidden") & "&#039, WHERE Email = &#039" & Session("email") & "&#039"<BR>

  3. #3
    Stephen of New York Guest

    Default THANKS

    Thank you very much. Much appreciation.<BR>If anyone can tell me a great reference book to know all these elementary tasks, it would be greatly appreciated :) <BR>Stephen

Posting Permissions

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