DougAtAvalon
Programmer
The workspaces code gets an error
How do a reference an external database?
**********************
Public Function GetSecurityOnOff(vNetworkPath)
GetSecurityOnOff = "Off"
Dim vSecurityValue As Integer
Dim dbs As Object
Dim vRecordset As Object
Set vRecordset = DBEngine.Workspaces(0).Databases(vNetworkPath)
SQLstring = "SELECT DefaultSettings.*, DefaultSettings.DefaultID FROM DefaultSettings WHERE DefaultID = 'SecurityOn'"
Set vRecordset = dbs.OpenRecordset(SQLstring)
With vRecordset
vSecurityValue = ![DefaultValue]
End With
If vSecurityValue = 0 Then GetSecurityOnOff = "Off"
If vSecurityValue <> 0 Then GetSecurityOnOff = "On"
Set vRecordset = Nothing
Set dbs = Nothing
End Function
How do a reference an external database?
**********************
Public Function GetSecurityOnOff(vNetworkPath)
GetSecurityOnOff = "Off"
Dim vSecurityValue As Integer
Dim dbs As Object
Dim vRecordset As Object
Set vRecordset = DBEngine.Workspaces(0).Databases(vNetworkPath)
SQLstring = "SELECT DefaultSettings.*, DefaultSettings.DefaultID FROM DefaultSettings WHERE DefaultID = 'SecurityOn'"
Set vRecordset = dbs.OpenRecordset(SQLstring)
With vRecordset
vSecurityValue = ![DefaultValue]
End With
If vSecurityValue = 0 Then GetSecurityOnOff = "Off"
If vSecurityValue <> 0 Then GetSecurityOnOff = "On"
Set vRecordset = Nothing
Set dbs = Nothing
End Function