Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data type mismatch in criteria expression.

Status
Not open for further replies.
May 12, 2002
51
US
I have a script on my site that writes the output of a form to a MS Access DB and e-mails the output of the form to an e-mail address. When a form is submitted, I get this error:

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/mp3feeds/register/register.asp, line 404



Here is the code:

<%
else

strFirstName=Request.form(&quot;FirstName&quot;)
strLastName=Request.form(&quot;LastName&quot;)
strTitle=Request.form(&quot;Title&quot;)
stremail=Request.form(&quot;email&quot;)
strStations=Request.form(&quot;Stations&quot;)
strCity=Request.form(&quot;City&quot;)
strState=Request.form(&quot;State&quot;)
strTelA=Request.form(&quot;TelA&quot;)
strTelB=Request.form(&quot;TelB&quot;)
strTelC=Request.form(&quot;TelC&quot;)
strFaxA=Request.form(&quot;FaxA&quot;)
strFaxB=Request.form(&quot;FaxB&quot;)
strFaxC=Request.form(&quot;FaxC&quot;)
strShows=Request.form(&quot;Shows&quot;)
strComments=Request.form(&quot;Comments&quot;)
strDate=Date

Set Conn=Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Open &quot;PROVIDER=Microsoft.Jet.OLEDB.4.0;&quot; & _
&quot;DATA SOURCE=&quot; & server.mappath(&quot;/login/data/affiliatedata.mdb&quot;)

MySQL=&quot;Insert into Mp3feeds (FirstName, LastName, Title, email, Stations, City, State, TelA, TelB, TelC, FaxA, FaxB, FaxC, Shows, Comments, SubmitDate) VALUES ('&quot;
MySQL=MySQL & strFirstName & &quot;', &quot; & &quot;'&quot; & strLastName & &quot;', &quot; & &quot;'&quot; & strTitle & &quot;', &quot; & &quot;'&quot;
MySQL=MySQL & stremail & &quot;', &quot; & &quot;'&quot; & strStations & &quot;', &quot; & &quot;'&quot; & strCity & &quot;', &quot; & &quot;'&quot;
MySQL=MySQL & strState & &quot;', &quot; & &quot;'&quot; & strTelA & &quot;', &quot; & &quot;'&quot; & strTelB & &quot;', &quot; & &quot;'&quot;
MySQL=MySQL & strTelC & &quot;', &quot; & &quot;'&quot; & strFaxA & &quot;', &quot; & &quot;'&quot; & strFaxB & &quot;', &quot; & &quot;'&quot;
MySQL=MySQL & strFaxC & &quot;', &quot; & &quot;'&quot; & strShows & &quot;', &quot; & &quot;'&quot; & strComments & &quot;', &quot; & &quot;'&quot;
MySQL=MySQL & strSubmitDate & &quot;')&quot;

Set RS=Conn.Execute(MySQL)

Conn.Close
set Conn=nothing


What am I doing wrong? help!

Thanks Thanks!
-JusTin
 
I dont know if this is the problem but I think you have a miismatch bewteen strdate and strsubmitdate i.e. you define a value for strdate but use a seperate (undefined) variable strsubmitdate in you sql string

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top