Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2004, 11:33 AM
Registered User
 
Join Date: May 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Newbie asp form to database ERROR

ERROr Code:
Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/_contact/thankyou.asp, line 191


Code in question:
    <%
Dim FirstName, LastName, Company, Telephone, Email, Business, Service, Pages, Length, Message
Dim Conn
Dim SQLTemp

If request("insrow") = "1" THEN
FirstName = request("FirstName")
LastName = request("LastName")
Company = request("Company")
Telephone = request("Telephone")
Email = request("Email")
Business = request("Business")
Service = request("Service")
Pages = request("Pages")
Length = request("Length")
Message = request("Message")

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("..\..\Database\quote.mdb")& ";"
Conn.Open

SQLTemp = "INSERT INTO tblCustomer (FirstName, LastName, Company, Telephone, Email, Business, Service, Pages, Length, Message)VALUES ('" & FirstName & "', " & LastName & ", '" & Company & "', '" & Telephone & "', '" & Email & "', '" & Business & "', '" & Service & "', '" & Pages & "', '" & Length & "', '" & Message & "')"

Conn.execute(SQLTemp)

Conn.Close
Set Conn = Nothing

End If

%>


 
Old May 19th, 2004, 11:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're missing at least the closing quote for LastName:

('" & FirstName & "', " & LastName & "', '" &


There may be more problems, but to find out for sure, use Response.Write(SQLTemp) to dump the SQL statement to the screen. Makes it easier to diagnose the problem....
Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Free by Prince (Track 7 from the album: 1999) What's This?
 
Old May 19th, 2004, 12:38 PM
Registered User
 
Join Date: May 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you the progression come along
though no the error is
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 's', 's', 's', 's', 's', '', '2', '2', 'hey')'.

That from testing the form

should I put Response.Write(SQLTemp)
before the sql statement

thx again
you are most kind
"sharing is caring"

 
Old May 19th, 2004, 01:18 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome.

The Response.Write statement is just for debugging purposes. You can add the code like this:
Code:
' Comment out or remove the next two lines when the code works.
Response.Write("SQL statement is " & SQLTemp)
Response.End()
Conn.execute(SQLTemp)
If you can't figure out the problem by looking at the statement, post the results of the Response.Write statement to this list.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Optigan 1 by Blur (Track 13 from the album: 13) What's This?
 
Old May 19th, 2004, 02:22 PM
Registered User
 
Join Date: May 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do have to delimit the quotes?

SQL statement is INSERT INTO tblCustomer (FirstName, LastName, Company, Telephone, Email, Business, Service, Pages, Length, Message)VALUES ('somenme', somename', 'somecompany', '253-555-1212', '[email protected]', 'somecompany', 'edu', '5', '15', 'words words')

thx again
you rock

 
Old May 19th, 2004, 04:30 PM
Registered User
 
Join Date: May 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

now I'm getting
Microsoft JET Database Engine error '80040e37'

Could not find output table 'tblCustomer'.
hmm

 
Old May 20th, 2004, 03:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not sure if it matters for Access (it doesn't on SQL Server), but try adding a space between the ) and the word VALUES.

Also, the columns Pages and Length sounds like they are a number column. If that is the case, you shouldn't use quotes for the values of those columns. E.g.:

... 's', '', 2, 2, 'hey' ...

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Adore by Prince (Track 7 from the album: Sign O The Times (Disk 2)) What's This?
 
Old May 20th, 2004, 12:43 PM
Registered User
 
Join Date: May 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm stumbed..
now I just get

Microsoft JET Database Engine error '80040e37'

Could not find output table 'tblCustomer'.


thoughts
thx

 
Old May 20th, 2004, 12:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The best way to debug this statement is to paste it in the Access query designer.

Run the page with the Response.Write statement in it, copy the output of the Write statement, create a new query in Access and paste your code in the SQL dialog for the query. Access usually provides you with much better error messages.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 27th, 2004, 03:20 AM
Authorized User
 
Join Date: May 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your database might be missing a table tblcustomer






Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: Input Form Problem kwilliams ASP.NET 2.0 Professional 1 June 12th, 2008 08:15 AM
asp help for newbie syntax error jennypretty Classic ASP Basics 2 June 1st, 2007 01:08 PM
Email Form - Question from a Newbie morgan270 ASP.NET 2.0 Basics 8 September 13th, 2006 03:58 PM
ASP Form to Database to HTML Hyperlinks remnatch Access ASP 1 August 9th, 2004 10:38 PM
ASP code to update database on submitting form? kkbigal Classic ASP Databases 3 July 14th, 2003 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.