PDA

View Full Version : ASP + OLEDB error probs


mid_gen
15-01-2001, 14:39
has anyone got a working database connection include file I can have a look at?

I'm trying to connect to an access DB, without a DSN, I'm using the following code atm :=

<%

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"<DBPATH>"
objConn.Open

%>

I've included ADOVBS.inc in the page that calls this one.

I get this error message when I try running it :=

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/DatabaseConnect.asp, line 8

line 8 being the 'objConn.Open' line

if anyone can send me a working dbconnect include I can have a look at, or just help me out it would be great.

e-mail chris@shotgunlan.com
ICQ# 45809082

Cheers

SPAWNO
15-01-2001, 15:17
Heres How I do it:


Access 97
strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\webroot\db\mydatabase.mdb"

Access 2000
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\webroot\db\mydatabase.mdb;"


Then this bit to connect to it
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

:)

Hope this helps

- Spawno