I'm having trouble connecting to a database file on another PC. In this case, my PC is the client.

Using:

  1. Windows 7 32-bit on both PC's.
  • Same Workgroup
  • Connection verified using cmd (PING)
  • Connected using hub (straight through)
  • Workgroup status: Joined
  1. MS Access 2007 as database app.

My connection string:

    Con.Open "Provider=Microsoft.ACE.OLEDB.12.0;
    Data Source=\\192.168.1.1\SERVERPC\C:\MYDB.accdb;
    Persist Security Info=False;User Id=Admin;
    Jet OLEDB:Database Password = mypassword"

The IP address and database locations are correct.

I'm recieveing THIS error.

Is my connection string wrong or is it on the hardware?

A share path is usually specified as

\\MACHINE\SHARE\PATH\FILE

where SHARE is defined on the sharing machine and is never specified as an actual device like C:. If an administrative share is used, C: might be replaced with C$. In any case, if you can't browse to the file using the share path then you won't have access to it through the application. So try typing

\\SERVERPC\C$

into the address bar of an explorer window and see if you can browse to the folder containing MYDB.accdb.

  1. If you shared your ms access database, it might look something like this;

\192.168.1.1\SERVERPC\MYDB.accdb

and NOT \192.168.1.1\SERVERPC\C:\MYDB.accdb;

Try to open \192.168.1.1\SERVERPC\ and see if the database exist or not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.