By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,346 Members | 2,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,346 IT Pros & Developers. It's quick & easy.

Im always denied! when accessed .mdb file

P: 38
hi! I'm new to coding with access and vb and I'm very lost here. I created a
an HookItUp.mdb with a tblProductData, for a table. Now I want to Preview it so I
created a Form named it frmPerview and now I add some coding using a module.I then created this code.

Sub OpenReadOnly()
Dim conn As ADODB.Connection
Dim rstschema As ADODB.Recordset
Dim strCnn As String

Set conn = New ADODB.Connection
strCnn = "Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=C:\Documents and Settings\MyNetworkSharedFolder\Desktop\PM_Complian ce_Access\HookItUp.mdb"

conn.CursorLocation = adUseServer
conn.Mode = adModeShareDenyNone
conn.Open strCnn

'Open the tables schema rowset
Set rstschema = conn.OpenSchema(adSchemaTables)

'Loop through the results and print the names in the Immediate window
While Not rstschema.EOF

If rstschema.Fields("ProdID") = "tblProductData" Then _
Debug.Print rstschema.Fields("ProdID")

End Sub

there are few things I want to declare, first my PC is on a network and running Win 2000, if this helps. then when I run this using F5, this error pops up.

Run-time error '-2147467259(80004005)':

the database has been placed in a state by user 'Admin' on machine
'ALA-D-99980' that prevents it from being opened or locked.

this guy -> ALA-D-99980 is our server. Pls. help I'm really trying hard to understand this. but clearly I AM LOST. that's all thanks!
Feb 1 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 14,534
Are you trying to open the database that is already open or another database entirely?
Feb 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.