% 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsDisplay 'Holds the recordset for the records in the database Dim strSQL 'Holds the SQL query to query the database 'Create an ADO connection odject Set adoCon = Server.CreateObject("ADODB.Connection") 'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../files/stock.mdb") 'Set an active connection to the Connection object using DSN connection 'adoCon.Open "DSN=contact" 'Create an ADO recordset object Set rsDisplay = Server.CreateObject("ADODB.Recordset") 'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT DISTINCT Product FROM Locations ORDER BY Product ASC" 'Set the cursor type we are using so we can navigate through the recordset rsDisplay.CursorType = 2 'Set the lock type so that the record is locked by ADO when it is updated rsDisplay.LockType = 3 'Open the Comments table using the SQL query held in the strSQL varaiable rsDisplay.Open strSQL, adoCon %>
![]() |
|||
|
|||
De.Solv.It is the
registered Trade Mark of Orange-Sol Inc. |