Forums

ASP

This topic is locked

INSERT RECORD with PASSED information problem

Posted 25 Jun 2002 03:59:32
1
has voted
25 Jun 2002 03:59:32 kim monaco posted:
Hi, I am having a problem with an insert page that has passed information on it.

I made a page "all_clients" which is a master record page.
When you click on the last name of a client you pass the info to the next page (new_order_form) and fill some of the form.

My problem is that when I hit insert, I get an error.
The Passed information is coming from the client table and the form inserts into the order table.

I have made insert record pages that work but this is my first page that has passed info in it.

Can you look at it and tell me why it is not working, or what I am doing wrong.


Here are the links to the pages online.
www.flyersdirect.com/all_clients.asp
www.flyersdirect.com/new_order_form.asp

Thanks for your help.
Kim<b></b>

Replies

Replied 25 Jun 2002 04:03:24
25 Jun 2002 04:03:24 kim monaco replied:
I forgot to show the error I am getting.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

/new_order_form.asp, line 90


Thanks again.
Kim

Replied 25 Jun 2002 09:52:31
25 Jun 2002 09:52:31 Andrew Watson replied:
can you post the code for the insert?

:: Son, im Thirty.... ::
Replied 25 Jun 2002 18:43:11
25 Jun 2002 18:43:11 kim monaco replied:
Leed,
If you want I can email you the .asp page so you can look at it.

Here are some lines off code from the page.

ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i &lt;&gt; LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""

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
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl &lt;&gt; "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%&gt;
&lt;%
Dim PassUserID__MMColParam
PassUserID__MMColParam = "1"
if (Request.QueryString("UserID" &lt;&gt; "" then PassUserID__MMColParam = Request.QueryString("UserID"
%&gt;
&lt;%
set PassUserID = Server.CreateObject("ADODB.Recordset"
PassUserID.ActiveConnection = MM_fddb_STRING
PassUserID.Source = "SELECT FirstName, LastName, Email, billstreet, billcity, billstate, billzip, shipstreet, shipcity, shipstate, shipzip, Phone, AlternatePhone, Fax FROM client WHERE UserID = " + Replace(PassUserID__MMColParam, "'", "''" + ""
PassUserID.CursorType = 0
PassUserID.CursorLocation = 2
PassUserID.LockType = 3
PassUserID.Open()
PassUserID_numRows = 0
%&gt;
&lt;%
set ConnOder = Server.CreateObject("ADODB.Recordset"
ConnOder.ActiveConnection = MM_fddb_STRING
ConnOder.Source = "SELECT * FROM orders"
ConnOder.CursorType = 0
ConnOder.CursorLocation = 2
ConnOder.LockType = 3
ConnOder.Open()
ConnOder_numRows = 0
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;NEW ORDER PROCESS FORM&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;body bgcolor="#FFCC00" text="#000000"&gt;
&lt;img src="images/fdlogo.gif" width="210" height="75"&gt; &lt;br&gt;
&lt;b&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;NEW ORDER PROCESS SHEET&lt;/font&gt;&lt;/b&gt;
&lt;form ACTION="&lt;%=MM_editAction%&gt;" METHOD="POST" name="order"&gt;


Thanks,
kim

Replied 10 Jul 2002 23:53:44
10 Jul 2002 23:53:44 Auz Clement replied:

Reply to this topic