Connecting to a database
George11 | Posted 10:15pm 20. February 2008 Server Time |
I have a problem and need help from someone who knows how to conncwct to the database.
I have to connect to my database (ACCESS) that cannot be located in the same directory as all my all ASP files are located (requirement of the Web hosting company). I am using the following code and put them in a file I called dbconn.asp. Of course this file is called whenever I need to connect to the database. Can someone help me to see what is wrong with these codes since it does not make the connection.
Thanks
<%
Set Conn = Server.CreateObject("ADODB.Connection")
connPath = "DBQ=..\database\mydatabase.mdb"
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & connPath
%> |
katy8439 | Posted 6:22am 21. February 2008 Server Time |
You may have to put in the full physical path to the database. For example, if your database was on your C drive in a folder called database you'd put:
connPath = "DBQ=C:\database\mydatabase.mdb"
Your hosting provider should be able to tell you what the path to the database is.
Reply to Post Connecting to a database
|
|
|