mrshlick Posted January 12, 2006 Share Posted January 12, 2006 Im trying to make links that will only bring up data form my database based on thier ID number. Im using microsoft Access and the database is called database.mdb, with the table Adaptors and the field ID which is set to autonumber. heres my code:<% Dim ID, conn, rs, dataSQLID = Request.QueryString ("ID")Set conn = Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("database\database.mdb"))Set rs = Server.CreateObject("ADODB.recordset")dataSQL = " SELECT * FROM Adaptor WHERE ID = '" & ID & "' "rs.Open dataSQL, connDo While Not rs.EOF%>and heres the browser error:Error Type:Microsoft JET Database Engine (0x80040E07)Data type mismatch in criteria expression./partswebsite/includes/adaptor.inc, line 10Line 10 is: rs.Open dataSQL, connThanks Link to comment Share on other sites More sharing options...
bolado Posted January 12, 2006 Share Posted January 12, 2006 try: dataSQL = " SELECT * FROM Adaptor WHERE ID = " & ID hope this helps.. Link to comment Share on other sites More sharing options...
mrshlick Posted January 12, 2006 Author Share Posted January 12, 2006 No didnt work try:dataSQL = " SELECT * FROM Adaptor WHERE ID = " & ID hope this helps.. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
aspnetguy Posted January 12, 2006 Share Posted January 12, 2006 just a questionwhy does the page end in .inc and not .asp? Perhaps this is the cause of the error. /partswebsite/includes/adaptor.inc Link to comment Share on other sites More sharing options...
mrshlick Posted January 12, 2006 Author Share Posted January 12, 2006 Its an include just a questionwhy does the page end in .inc and not .asp? Perhaps this is the cause of the error.<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
aspnetguy Posted January 12, 2006 Share Posted January 12, 2006 well, I learned something new...I have always named my includes pages as .asp aswell, I guess this helps keep them organized. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now