I use the following code in a file called connection.asp and include that at the start of all the asp pages that i reference a database
Dim objConn, ConnStr
Set objConn = Server.CreateObject("ADODB.connection")
ConnStr= "Driver=Microsoft Visual Foxpro Driver; " + _
"UID=;SourceType=DBC;SourceDB=c:\location_of_database\database.dbc"
objConn.Open ConnStr 'This can be a datasource name or a connect string
this code is at the top off all my pages using the database
i reference the database a couple of ways, one is as follows
Dim adm_RS3, adm_SQL3
Set adm_RS3=Server.CreateObject("ADODB.Recordset")
adm_SQL3 = "SELECT * FROM loginlog"
set adm_RS3 = objConn.Execute(adm_SQL3)
HTH
~M
Go raibh maith agat
~M