This topic is locked

Before Delete Event

6/26/2006 6:58:58 PM
ASPRunnerPro General questions
F
fnqchick author

Could anyone help me out with why this error is happening?
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/Purchasing/db/include/tblQuotes_events.asp, line 16
strSQLInsert = "insert into tblQuotes_copy select * from tblQuotes where " & where dbConnection.Execute strSQLInsert
I am trying to insert records into another table using the BeforeDelete Event, I keep getting stuck on this line of code.
Cheers,

Susan

Sergey Kornilov admin 6/26/2006

Susan,
here is how it should be:

strSQLInsert = "insert into tblQuotes_copy select * from tblQuotes where " & where

dbConnection.Execute strSQLInsert
A
akira_nagasaki 8/12/2008

Susan,

here is how it should be:

strSQLInsert = "insert into tblQuotes_copy select * from tblQuotes where " & where

dbConnection.Execute strSQLInsert


still error when i follow this code put under before deleted event
i got this error
Technical information

Error number -2147217900

Error description Syntax error in INSERT INTO statement.

URL /Project1/End_User_list.asp

SQL query delete from [End User] where ID=6

Solution This commonly occurs when you have a field name that is a reserved word.
Please refer to the following article in the ASPRunner's FAQ for detailed information

http://www.xlinesoft.com/asprunner/faq.htm#updatesyntax
pls help <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=32099&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />
this is my code
strSQLInsert = "insert into Deleted EndUser select * from End User where " & where

dbConnection.Execute strSQLInsert
BeforeDelete = True

J
Jane 8/12/2008

If your field names contain white spaces use square brackets:

strSQLInsert = "insert into [Deleted EndUser] select * from [End User] where " & where

dbConnection.Execute strSQLInsert

A
akira_nagasaki 8/13/2008

If your field names contain white spaces use square brackets:



it's working.. tq very muchh jane..