PDA

Click to See Complete Forum and Search --> : Setting up connectionless database


hwakern
Dec 7th, 2000, 11:48 PM
good day,
i have database.mdb access file and want to use connectionless to connect the dababase.please help.
Below is the code i try but i can't get it worked

<%
Dim objDB
Dim DBName

DBName = "driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("../db/database.mdb")
Set objDB = Server.CreateObject("ADODB.Connection")
objDB.Open DBName
%>

Chris
Dec 8th, 2000, 01:39 AM
perhaps you can do this...


<%
Set Conn = Server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\db\database.mdb"
%>

hwakern
Dec 8th, 2000, 01:56 AM
i'm upload my files to host server.
and i not sure the directory my database.mdb are put in.
please help

monte96
Dec 8th, 2000, 08:45 AM
With an Access database you *MUST* know where it is.

You can't have a connection-less database. You can create connectionless recordsets that are not based on a database at all, but in order to use a database, you need a connection whether you create one explicitly or implicitly.

You need to contact your host provider and get the information or use the server.mappath method.