SETTING AND RETRIEVING SYSTEM SETTINGS WITH ADO

The routines in Listing 27.2 reflect their DAO counterparts with the names ap_SetDatabaseProp and ap_GetDatabaseProp.

Listing 27.2. VideoApp(ADO).mdb: The Main Startup System Checking Routines
 Sub ap_SetDatabaseProp(strPropertyName As String, varValue As Variant) Dim rstDBProps As New ADODB.Recordset rstDBProps.Open "ztblDatabaseProperties", CurrentProject.Connection, _ adOpenDynamic, adLockOptimistic rstDBProps(strPropertyName) = varValue rstDBProps.Update rstDBProps.Close End Sub Function ap_GetDatabaseProp(strPropertyName As String) As Variant Dim rstDBProps As New ADODB.Recordset rstDBProps.Open "ztblDatabaseProperties", CurrentProject.Connection, _ adOpenStatic ap_GetDatabaseProp = rstDBProps(strPropertyName) ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.