# Trying to connect my database to my website Vista



## natte700 (Oct 17, 2008)

I've been working on this weeks now and can't seem to move forward. I am trying to link a database to my website using frontpage 2003 and access 2007 for my project. my website deals with reserving equipment for a copmany i have these fields in my database
*reservation*Reservation#CustomerIDReservationdateEquipmentNoEquipmentnameCategoryQuantity41110/13/20087Light Tower 4000 WattGenerators & Lighting151010/15/20086Towable GeneratorsGenerators & Lighting2

I have converted the access 2007 database to 2000 file format and am currently getting this error

 Microsoft JET Database Engine error '80040e07' 

Data type mismatch in criteria expression. /companysite5/reservation.asp, line 22 


Here is my code that i have placed in an reservfation.asp page

<%
sconnstring="PROVIDER=Microsoft.Jet.OLEDB.4.0;"& _
"Data Source=" & Server.Mappath("companydb00.mdb")
Set rs = Server.CreateObject("ADODB.Connection")
CustomerID = Request.Form("CustomerID")
Reservationdate = Request.Form("Reservationdate")
EquipmentNo = Request.Form("EquipmentNo")
Equipmentname = Request.Form("Equipmentname")
Category = Request.Form("Category") 
Quantity = Request.Form("Quantity")
sql = "INSERT into reservation (CustomerID,Reservationdate,EquipmentNo,Equipmentname,Category,Quantity) Values ('" & CustomerID &"', '" & Reservationdate &"', '" & EquipmentNo &"', '" & Equipmentname &"', '" & Category &"', '" & Quantity &"')" 
rs.open(sconnstring)
rs.execute(sql)
rs.close
response.write"Your Reservation has been Sucessfully Submitted"
resopnse.write (reservationNo)
%>

PLEASE HELP ME ANY ASSISTANCE WILL BE GREATLY APPRECIATED.


----------



## grovelli (Oct 18, 2008)

I'm in a boat similar to yours but I'm tackling it the opposite way: first I've built an Access database and then I'm trying, with the very limited knowledge of ASP.Net I have, to build a website around it
Do you get the error when you try to open reservation.asp?
I don't see in your code where you get reservationNo from.


----------



## MustBNuts (Aug 21, 2003)

The problem seems to be the type of data you are trying to insert into one of the fields of the database.

Compare the format of each of your fields in the dbase (CustomerID, Reservationdate, EquipmentNo, Equipmentname, Category, Quantity) with the format in your ASP page.

For instance, if your ASP page is collecting a string type in the reservation number but the dbase is expecting an integer, it would throw an error like this.

Hope this helps,

MBN


----------



## pvc_ (Feb 18, 2008)

why don't you start with a simple query and a simple database, and then move on to more complicated stuff. This website should help you with the connection strings: "http://www.connectionstrings.com."

I just recently did the same thing... started my website on Vista, but I'm using MS-SQL instead of access. First make sure you can connect to the database, and then try to run queries.


----------

