Hi all,
This one is really confusing me because I think I have all of my quotes in the right spot, and I have the fields in the insert statement matching the fields in the table. When I submit the information on the form, I am receiving this error message: "Number of query values and destination fields are not the same."
Here is my code:
<%
Option Explicit
Dim strConnect
%>
<html>
<head>
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<!-- #INCLUDE FILE="datastore_psa.asp" -->
<title>Receipt of submitance</title>
</head>
<body>
<%
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open strConnect
Dim objCommand
Set objCommand = Server.CreateObject("ADODB.Command"
Dim strFName, strLName, strAddress1, strAddress2, strCity, strState, strZip, strPhone, strDistrict, strEmail
Dim SQLResponders
strFName = Request.Form("first_name"
strLName = Request.Form("last_name"
strAddress1 = Request.Form("address1"
strAddress2 = Request.Form("address2"
strCity = Request.Form("city"
strState = Request.Form("state"
strZip = Request.Form("zip"
strPhone = Request.Form("phone"
strDistrict = Request.Form("school_district"
strEmail = Request.Form("email"
SQLResponders = "INSERT INTO Members VALUES ('" & strFName & "', '" & strLName & "', " & _
"'" & strAddress1 & "', '" & strAddress2 & "', '" & strCity & "', '" & strState & "', " & _
"'" & strZip & "', '" & strPhone & "', '" & strDistrict & "', '" & strEmail & "')"
objCommand.ActiveConnection = objConn
objCommand.CommandText = SQLResponders
objCommand.CommandType = adCmdText
objCommand.Execute
Set objCommand = Nothing
My Access database has a Member table with the following fields:
memberID (AutoNumber)
first_name (text)
last_name (text)
address1 (text)
address2 (text)
city (text)
state (text)
zip (text)
phone (text)
school_district (text)
email (text)
Any idea as to why I am getting this error?
Thanks in advance,
Rob
![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)
This one is really confusing me because I think I have all of my quotes in the right spot, and I have the fields in the insert statement matching the fields in the table. When I submit the information on the form, I am receiving this error message: "Number of query values and destination fields are not the same."
Here is my code:
<%
Option Explicit
Dim strConnect
%>
<html>
<head>
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<!-- #INCLUDE FILE="datastore_psa.asp" -->
<title>Receipt of submitance</title>
</head>
<body>
<%
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open strConnect
Dim objCommand
Set objCommand = Server.CreateObject("ADODB.Command"
Dim strFName, strLName, strAddress1, strAddress2, strCity, strState, strZip, strPhone, strDistrict, strEmail
Dim SQLResponders
strFName = Request.Form("first_name"
strLName = Request.Form("last_name"
strAddress1 = Request.Form("address1"
strAddress2 = Request.Form("address2"
strCity = Request.Form("city"
strState = Request.Form("state"
strZip = Request.Form("zip"
strPhone = Request.Form("phone"
strDistrict = Request.Form("school_district"
strEmail = Request.Form("email"
SQLResponders = "INSERT INTO Members VALUES ('" & strFName & "', '" & strLName & "', " & _
"'" & strAddress1 & "', '" & strAddress2 & "', '" & strCity & "', '" & strState & "', " & _
"'" & strZip & "', '" & strPhone & "', '" & strDistrict & "', '" & strEmail & "')"
objCommand.ActiveConnection = objConn
objCommand.CommandText = SQLResponders
objCommand.CommandType = adCmdText
objCommand.Execute
Set objCommand = Nothing
My Access database has a Member table with the following fields:
memberID (AutoNumber)
first_name (text)
last_name (text)
address1 (text)
address2 (text)
city (text)
state (text)
zip (text)
phone (text)
school_district (text)
email (text)
Any idea as to why I am getting this error?
Thanks in advance,
Rob
![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)