1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Dim strProvider 'Connection string
Dim objConn 'Connection object
Dim cm 'ADODB command
Dim rstQuery
Sub connect()
'Connects to the Access driver and Access database in the Inetpub directory where the database is saved
strProvider = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\CHEMIN_VERS_LA_BASE\BASE.MDB;"
'Creates an instance of an Active Server component
set objConn = server.createobject("ADODB.Connection")
'Opens the connection to the data store
objConn.Open strProvider
'Instantiate Command object and use ActiveConnection property to attach connection to Command object
set cm = Server.CreateObject("ADODB.Command")
cm.ActiveConnection = objConn
'Instantiate a Recordset object and open a recordset using the Open method
Set rstQuery = Server.CreateObject("ADODB.recordset")
end sub |