How do I connect to my database ?

You can use DSN-less connections.
DSN-less connections are faster than System DSN connections because DSN-less avoids doing a registry lookup. Furthermore you can receive additional performance benefits by directly using the OLEDB layer.

Here is an example:
Dim Conn, dbPath
dbPath = "D:\domains\yourdomain.com\db\youraccessfile.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath

Or you can use server map path:

Set MyConn = Server.CreateObject("ADODB.Connection")
conString = "DBQ=" & Server.MapPath("YourDatabase.mdb")
Myconn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & conString

More information can be found at:
http://www.aspin.com
http://www.powerasp.com

Was this answer helpful?

 Print this Article

Also Read

Which directory do I have to put the database in ?

Any directory can be used as long as your connection strings points to the right place. You can...

Do you support MySQL or MS SQL ?

Yes, we offer access to SQL Server databases with MS SQL 2005 and MySQL 5

Create ODBC DSN's

ODBC DSN's are the perfect way to add dynamic content to your website from a database. HELM...

What databases do you support ?

Currently, MS Access 2000, 2002, 2003 and 2007