Good morning, Any suggestions? I keep getting the following error when I try to INSERT data into my databse from my asp webpage. Here is the code that produces the error:
MM_editQuery = "insert into Clarify_Case_Number (engineer_id) values (10),(20),(30);"
If (Not MM_abortEdit) Then ' execute the insert Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute ' ** Code fails here ** MM_editCmd.ActiveConnection.Close
I am trying to insert 10, 20, and 30 into the engineer_id column when the code executes.
I think what you have instructed the engine to do is insert 3 values into a single column. If you need to insert 3 new rows, each with a different value in a particular column, you must INSERT 3 times. But shouldn't this be in Technical Q & A?
John, Good afternoon. I'm new to TechRepublic, I thought this message got posted to "Client Support". Thanks for replying. I an trying to insert multiple records from webpage at one time. The values are selected from a webpage list box. User can select several item from box (by holding ctrl-key). I won't always know how many records need to be inserted. I am looking for a method to insert each selection as a seperate record. I found a clue at: //www.mail-archive.com/asp_databases@p2p.wrox.com/msg09540.html">http://www.mail-archive.com/asp_databases@p2p.wrox.com/msg09540.html
but I kept getting that error. Any help is much appreciated.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Missing semicolon at end of SQL statement.
Any suggestions? I keep getting the following error when I try to INSERT data into my databse from my asp webpage. Here is the code that produces the error:
MM_editQuery = "insert into Clarify_Case_Number (engineer_id) values (10),(20),(30);"
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute ' ** Code fails here **
MM_editCmd.ActiveConnection.Close
I am trying to insert 10, 20, and 30 into the engineer_id column when the code executes.
Thanks!
Aaron
arobin4@hotmail.com