Hello all,
I am a newbie in ASP development and I have an error. I am suspecting that I have a problem with the delete sql statement in my ASP page, which I cannot figure out what it is. Here is my code:-
'*** Create the sql to insert the e-mail address in the database if not empty
if EMail <> "''" then
sql1 = ""
sql1 = sql1 & "DELETE FROM contact "
sql1 = sql1 & " WHERE e-mail = " & oldEMail
sql1 = sql1 & " AND pAddress1 = " & oldAddress1
sql1 = sql1 & " AND pAddress2 = " & oldAddress2
sql1 = sql1 & " AND others = " & oldOthers & ";"
rs1.open (sql1)
rs1.open "INSERT INTO contact (e-mail,pAddress1,pAddress2,others) VALUES (" & EMail & "," & oldAddress1 & "," & oldAddress2 & "," & oldOthers & "
;"
Response.Write(sql1)
oldEMail = EMail
end if
And this is the error it is giving me:-
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'e-mail = 'info@otters.com.mt' AND pAddress1 = '13, St.Paul's Street', AND pAddress2 = 'Victoria', AND others = 'other info';'.
Please can you help me out! All help is much appreciated.
Thanks
I am a newbie in ASP development and I have an error. I am suspecting that I have a problem with the delete sql statement in my ASP page, which I cannot figure out what it is. Here is my code:-
'*** Create the sql to insert the e-mail address in the database if not empty
if EMail <> "''" then
sql1 = ""
sql1 = sql1 & "DELETE FROM contact "
sql1 = sql1 & " WHERE e-mail = " & oldEMail
sql1 = sql1 & " AND pAddress1 = " & oldAddress1
sql1 = sql1 & " AND pAddress2 = " & oldAddress2
sql1 = sql1 & " AND others = " & oldOthers & ";"
rs1.open (sql1)
rs1.open "INSERT INTO contact (e-mail,pAddress1,pAddress2,others) VALUES (" & EMail & "," & oldAddress1 & "," & oldAddress2 & "," & oldOthers & "
Response.Write(sql1)
oldEMail = EMail
end if
And this is the error it is giving me:-
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'e-mail = 'info@otters.com.mt' AND pAddress1 = '13, St.Paul's Street', AND pAddress2 = 'Victoria', AND others = 'other info';'.
Please can you help me out! All help is much appreciated.
Thanks