Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: please help me, i'm having errors


Message #1 by blueatmosphere@y... on Thu, 3 Oct 2002 08:21:38
hi. please help me!

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0;Data 
Source=C:\Inetpub\wwwroot\023291A-web-\db7.mdb;Persist Security Info=False"
strDB = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="
conn.Open(Server.MapPath("db7.mdb"))

strInsertSQL = "INSERT INTO Customer VALUES ('" & firstname & "','" & 
lastname & "','" & myemail & "','" & passwrd & "','" & confirmpasswrd 
& "','" & gender & "','" & number & "','"& dateofbirth & "')"


conn.execute strInsertSQL
conn.close
%>    


Microsoft JET Database Engine error '80040e07' 

Data type mismatch in criteria expression

there's a error on the line conn.execute strInsertSQL

thanks!
Message #2 by "Chetan Kelkar" <chetan@c...> on Thu, 3 Oct 2002 16:49:22 +0530
try this

strInsertSQL = "INSERT INTO Customer(firstname, lastname, myemail, passwrd,
confirmpasswrd, gender, number, dateofbirth) VALUES('"&firstname&"',
'"&lastname&"', '"&myemail&"', '"&passwrd&"', '"&confirmpasswrd&"',
'"&gender&"', '"&number&"', '"&dateofbirth&"')"

hth
c
----- Original Message -----
From: <blueatmosphere@y...>
To: ASP Databases <asp_databases@p...>
Sent: Thursday, October 03, 2002 8:21 AM
Subject: [asp_databases] please help me, i'm having errors


> hi. please help me!
>
> <%
> set conn=Server.CreateObject("ADODB.Connection")
> conn.Provider="Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Inetpub\wwwroot\023291A-web-\db7.mdb;Persist Security
Info=False"
> strDB = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="
> conn.Open(Server.MapPath("db7.mdb"))
>
> strInsertSQL = "INSERT INTO Customer VALUES ('" & firstname & "','" &
> lastname & "','" & myemail & "','" & passwrd & "','" & confirmpasswrd
> & "','" & gender & "','" & number & "','"& dateofbirth & "')"
>
>
> conn.execute strInsertSQL
> conn.close
> %>
>
>
> Microsoft JET Database Engine error '80040e07'
>
> Data type mismatch in criteria expression
>
> there's a error on the line conn.execute strInsertSQL
>
> thanks!
>


  Return to Index