Trying to find a DB user's workgroup programmatically

G

Guest

I have a VB form that on the onOpen event, needs to find out what the user's
group membership is. I have a command button that I want to set to
Visible=False unless the user is in the Admins group. However, I get a
strange error when I attempt to open the connection - "Cannot start your
application. The workgroup information file is missing or opened exclusively
by another user."

Except that it's NOT missing or opened exclusively. I have the path correct,
and the filename correct. Maybe one of you can give me a bit of insight on
this. My code is as follows (and thanks in advance!):


Private Sub Form_Open(Cancel As Integer)

Dim dbConn As New ADODB.Connection
Dim cat As New ADOX.catalog
Dim lngPerm As Long
Dim connStr As String
Dim recSet As Recordset


connStr = "data source = h:\ted\edpdb_2002.mdb; " &
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"jet oledb:system database=H:\TED\WIF.MDW" & "user
id=TheAdminID;password=TheAdminPassword; , " & _
adOpenKeyset & "," & adLockOptimistic & "," & adCmdTableDirect
dbConn.Open connStr

Set cat.ActiveConnection = dbConn

'Retrieve original permissions
lngPerm = cat.Users("admin").GetPermissions("MasterEquipmentList_notused",
adPermObjTable)
Debug.Print "Original permissions: " & Str(lngPerm)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top