• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 27. STARTUP CHECKING SYSTEM ROUT... > SETTING AND RETRIEVING SYSTEM SETTIN...

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)

   rstDBProps.Close


End Function


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint