
Help: VB5 DAO connection failing
I ran in to a similar situation. It turned out it was a mix up in security
files. Try creating a DB on his computer from your computer. Your code
should be able to open up that database. If this is the case, your problem
might be that you need to create and access the file from the same
workgroup.
Chris First
Quote:
>Help. I am trying to set up a VB5 DAO connection from one PC with NT
>Server to an ACCESS95 .mdb file on another PC with NT Server
>(different Domain). When I execute the program and it gets to the
>"OpenDatabase" line I get the following error:
>"3051 The Microsoft Jet database engine cannot open the file
>'(unknown)'. It is already opened exclusively by another user, or you
>need permission to view its data."
>My code works on the local PC with a path that starts with C://, but
>when my path is a UNC, I have problems. I believe I have all the
>obvious sharing permissions between the PC's set correctly and I can
>see and manipulate the database using ACCESS or MSQuery but not the
>VB5 code. Here is my code:
>Public Sub DAOConnection()
> Dim Db As Database
> Dim Rs As Recordset
> Dim Path As String
>Path = "\\Server1\c\nettest\Test1.mdb"
>Set Db = Workspaces(0).OpenDatabase(Path, ReadOnly:=True) 'I get the
>Error here
>Set Rs = Db.OpenRecordset("An_SQL_query'")
>Rs.Close
>Db.Close
>End Sub
>Please e-mail any suggestions or ideas. Thanks.