Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a connection to DB without a DSN 1

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
If I can't get the web host to set up a DSN for my web page, How do I create a connection to my database using ADO?
(I do know its relative path to the db).

Thanks,
Rewdee
 
Dim c
set c = Server.CreateObject("ADODB.Connection")
'TODO: change directory when locally testing
c.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("yourdbname.mdb")

you can change the server.mappath to the fully qualified path to your DB, if you'd like leo

------------
Leo Mendoza
lmendoza@garbersoft.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top