Need help!
I'm looking for the ADO equivalent of the following DAO code
(which interrogates the 'Database Properties' collection).
Ex: lStr = gfGetDBSProp("Summary","Author"
'
Public Function gfGetDBSProp(lpDoc As String, lpPrp As String) As String
Dim dbs As Database, cnt As Container
Dim doc As Document, prp As Property
Const conPropertyNotFound = 3270
On Error GoTo gfGetProp_Err
Set dbs = CurrentDb
Set cnt = dbs.Containers!Databases
Select Case lpDoc
Case Is = "Custom"
Set doc = cnt.Documents!UserDefined
Case Is = "Summary"
Set doc = cnt.Documents!SummaryInfo
Case Is = "General"
Set doc = cnt.Documents!generalinfo
End Select
doc.Properties.Refresh
gfGetDBSProp = doc.Properties(lpPrp)
gfGetProp_Bye:
Exit Function
gfGetProp_Err:
If Err = conPropertyNotFound Then
gfMsgBox "dbs Properties:" & lpPrp & " not found"
Resume gfGetProp_Bye
End If
End Function
'
-------------------------------
Any help would be appreciated!
vbprgmr
I'm looking for the ADO equivalent of the following DAO code
(which interrogates the 'Database Properties' collection).
Ex: lStr = gfGetDBSProp("Summary","Author"
'
Public Function gfGetDBSProp(lpDoc As String, lpPrp As String) As String
Dim dbs As Database, cnt As Container
Dim doc As Document, prp As Property
Const conPropertyNotFound = 3270
On Error GoTo gfGetProp_Err
Set dbs = CurrentDb
Set cnt = dbs.Containers!Databases
Select Case lpDoc
Case Is = "Custom"
Set doc = cnt.Documents!UserDefined
Case Is = "Summary"
Set doc = cnt.Documents!SummaryInfo
Case Is = "General"
Set doc = cnt.Documents!generalinfo
End Select
doc.Properties.Refresh
gfGetDBSProp = doc.Properties(lpPrp)
gfGetProp_Bye:
Exit Function
gfGetProp_Err:
If Err = conPropertyNotFound Then
gfMsgBox "dbs Properties:" & lpPrp & " not found"
Resume gfGetProp_Bye
End If
End Function
'
-------------------------------
Any help would be appreciated!
vbprgmr