Hi All,

I have Code on PC1. and Access DB on PC2 . I have shared Folder on PC . And very much able to access from PC1 with full ownership.

Now I was trying to connect Msaccess from PC1 using below code.

cnn.Provider = "Microsoft.ACe.OLEDB.12.0"
    cnn.Open "Data Source=\\192.168.0.1\Public\tels.accdb;Persist Security Info=False"

and i was able to connect. However i have broswed that remote folder already on PC1 that time.

But i want to pass PC2 window's User/pass as well in code itself. so that i don't need to open shared folder seaparatly.
Please advice.

I found this one Click Here .. Mikey can help with exact code.

Like the post you are mentioning, go to http://www.connectionstrings.com/access-2007
and verify that your connection string is correct:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\serverName\shareName\folder\myAccess2007file.accdb;

The file should already be setup with the required read/write priviledges for the PC2 account under witch your program will run.

Hi Adam,

My string is perfect as it get connect to PC2s DB. if i map it manually in PC1 .(\pc2\folder). it ask for authentication.

i want to pass same thing there . if you see Click Here. second last post. i want to do that one here. i need code for that.

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.