-
HELP!! - dbSilentCmdText - HELP!!
When I execute the following code:
NewNum = Incrementer("ContestID"
SQL1 = "(INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'NumOfShipments 9;,1,1,0,0);INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'AverageMarginPerS hipment',2,1,0,0);INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'TotalMargin', 3,1,0,0;INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'TotalMarginByFive ',4,1,0,0;"
X.dbSilentCmdText = SQL1
I get this error:
Error # (Execute_Silent_Command) = 80040E14(-2147217900)
Description = [Microsoft][ODBC Visual FoxPro Driver]Syntax error.
Source = Microsoft OLE DB Provider for ODBC Drivers
SQL State = 37000
Native Error = 200
Please help.
-
HELP!! - dbSilentCmdText - HELP!! (reply)
Garth,
You MUST specify the delimiters. See doc at:
http://www.aspdb.com/docs/aspdbman.htm#dbSilentCmdText
So, use something like this:
SQL1 = "(;~)INSERT INTO ..."
Otherwise the comma gets used as a delimiter and you need to use commas INSIDE your SQL statement. So use a tilde (~) instead.
Also, I suggest you add a statement like this, just after the SQL1= statment:
Response.Write("SQL1=" & SQL1 & "<P>"
Mark.
------------
Garth Tuck at 12/5/00 12:32:28 PM
When I execute the following code:
NewNum = Incrementer("ContestID"
SQL1 = "(INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'NumOfShipments 9;,1,1,0,0);INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'AverageMarginPerS hipment',2,1,0,0);INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'TotalMargin', 3,1,0,0;INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'TotalMarginByFive ',4,1,0,0;"
X.dbSilentCmdText = SQL1
I get this error:
Error # (Execute_Silent_Command) = 80040E14(-2147217900)
Description = [Microsoft][ODBC Visual FoxPro Driver]Syntax error.
Source = Microsoft OLE DB Provider for ODBC Drivers
SQL State = 37000
Native Error = 200
Please help.
-
HELP!! - dbSilentCmdText - HELP!! (reply)
Mark,
Thanks for you help. That worked, I also discovered some other syntax errors in my code.
My new question is:
What I'm trying to do is create a set of related records (contestfields) in another table when a person submits a record for the display table (contests).
I only need to execute the X.dbSilentCmdText referred to earlier when a person clicks the submit button on an 'ADD' form.
Any suggestions would be greatly appreciated.
Thanks,
Garth
------------
Mark at 12/5/00 1:44:19 PM
Garth,
You MUST specify the delimiters. See doc at:
http://www.aspdb.com/docs/aspdbman.htm#dbSilentCmdText
So, use something like this:
SQL1 = "(;~)INSERT INTO ..."
Otherwise the comma gets used as a delimiter and you need to use commas INSIDE your SQL statement. So use a tilde (~) instead.
Also, I suggest you add a statement like this, just after the SQL1= statment:
Response.Write("SQL1=" & SQL1 & "<P>"
Mark.
------------
Garth Tuck at 12/5/00 12:32:28 PM
When I execute the following code:
NewNum = Incrementer("ContestID"
SQL1 = "(INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'NumOfShipments 9;,1,1,0,0);INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'AverageMarginPerS hipment',2,1,0,0);INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'TotalMargin', 3,1,0,0;INSERT INTO contestfields ( contestfieldid, contestid, combofieldname, fieldname, fieldnumber, fieldtype, tablename, databaseconnect ) VALUES ("&Incrementer("ContestFieldID"&","&NewNum&",0,'TotalMarginByFive ',4,1,0,0;"
X.dbSilentCmdText = SQL1
I get this error:
Error # (Execute_Silent_Command) = 80040E14(-2147217900)
Description = [Microsoft][ODBC Visual FoxPro Driver]Syntax error.
Source = Microsoft OLE DB Provider for ODBC Drivers
SQL State = 37000
Native Error = 200
Please help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|