Print Page | Close Window

Number of query values and destination...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1648
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Number of query values and destination...
Posted By: Zeffy
Subject: Number of query values and destination...
Date Posted: 06 April 2003 at 10:16pm
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.

/booking/addbook.asp, line 28

-------------------------

<%
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "DRIVER={Microsoft Access Driver (*.md}; DBQ=" & Server.MapPath("book.mdb") & ";User ID=admin; Password=123;"
objConn.Open(strConnection)

SQLstmt = "INSERT INTO booking (name,address,postcode,email,adyear,admonth,adday,ddyear,ddmonth,ddday,ppl,nights,hear,other,furthinfo)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & name & "',"
SQLstmt = SQLstmt & "'" & address & "',"
SQLstmt = SQLstmt & "'" & postcode & "',"
SQLstmt = SQLstmt & "'" & email & "'"
SQLstmt = SQLstmt & "'" & adyear & "',"
SQLstmt = SQLstmt & "'" & admonth & "',"
SQLstmt = SQLstmt & "'" & adday & "'"
SQLstmt = SQLstmt & "'" & ddyear & "',"
SQLstmt = SQLstmt & "'" & ddmonth & "',"
SQLstmt = SQLstmt & "'" & ddday & "'"
SQLstmt = SQLstmt & "'" & ppl & "',"
SQLstmt = SQLstmt & "'" & nights & "',"
SQLstmt = SQLstmt & "'" & hear & "'"
SQLstmt = SQLstmt & "'" & other & "',"
SQLstmt = SQLstmt & "'" & furthinfo & "',"
SQLstmt = SQLstmt & ")"

set RS = objConn.Execute(SQLstmt)
objConn.Close

Set RS = Nothing
Set objConn = Nothing

response.write("
<CENTER>")
response.write("Thank you!</CENTER>

")

%>

 

HELP




Replies:
Posted By: Flamewave
Date Posted: 06 April 2003 at 11:37pm

Try:

SQLstmt = "INSERT INTO booking ([name], [address], [postcode], [email], [adyear], [admonth], [adday], [ddyear], [ddmonth], [ddday], [ppl], [nights], [hear], [other], [furthinfo])"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "' & name & "', "
SQLstmt = SQLstmt & "' & address & "', "
SQLstmt = SQLstmt & "' & postcode & "', "
SQLstmt = SQLstmt & "' & email & "', "
SQLstmt = SQLstmt & "' & adyear & "', "
SQLstmt = SQLstmt & "' & admonth & "', "
SQLstmt = SQLstmt & "' & adday & "', "
SQLstmt = SQLstmt & "' & ddyear & "', "
SQLstmt = SQLstmt & "' & ddmonth & "', "
SQLstmt = SQLstmt & "' & ddday & "', "
SQLstmt = SQLstmt & "' & ppl & "', "
SQLstmt = SQLstmt & "' & nights & "', "
SQLstmt = SQLstmt & "' & hear & "', "
SQLstmt = SQLstmt & "' & other & "', "
SQLstmt = SQLstmt & "' & furthinfo & "', "
SQLstmt = SQLstmt & ")"

you were missing a few commas and had some of your quotes wrong.



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net