PDA

Click to See Complete Forum and Search --> : Connecting to Access 2000 with ASP.


BJ
Apr 30th, 2001, 09:58 AM
I use this code to connect to Access 97 but when I update the DB to 2000 it won't work.

dim Database, Query
set Database = server.createobject("ADODB.Connection")
Database.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("Database\Knowledgebase.mdb")
Database.Open

Can someone give me the command to connect to 2000.

Thanks
Brandon

PJB
Apr 30th, 2001, 12:17 PM
not really sure what's wrong with the way your doing it, seems like that should work, maybe try this:


Set Conn = Server.CreateObject("ADODB.Connection")

DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("Database\Knowledgebase.mdb")
conn.Open DSNtemp


does your string give you any sort of error?

BJ
May 1st, 2001, 07:41 AM
Sorry it was one of those thing that you do once and it doesn't work and you do again and it works. It was my first day doing asp. Sorry. It works fine now.

Brandon