This topic is locked

Save new data in another table

12/25/2006 12:36:40 PM
ASPRunnerPro General questions
P
Philip author

I use the following code to save a record into another table called "test" :
Function BeforeAdd(dict)
' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form represented as 'Field name'-'Field value' pair
'** Save new data in another table ****

strSQLSave = "insert into test (H_Kategorie_AOA, H_Klasse_AOA) values ("
strSQLSave = strSQLSave & dict(H_Kategorie_AOA) & ","

strSQLSave = strSQLSave & dict(H_Klasse_AOA)
strSQLSave = strSQLSave & ")"

dbConnection.Execute strSQLSave
BeforeAdd = True
' set BeforeAdd to True if you like to proceed with adding new record

' set it to False in other case
End Function
PROBLEM: I get this syntax error:
ASP ... Fehler ist aufgetreten

Technische Information

Error number -2147217900

Fehlerbeschreibung [Microsoft][ODBC Microsoft Access Driver] Syntaxfehler in der INSERT INTO-Anweisung.
Any idea what is wrong?
Regards,

Philip

Sergey Kornilov admin 12/26/2006

Philip,
instead of executing SQL statement try to print it on the page and post it here.
You might miss single quotes around text field values.