0

Here's my connection string:

sConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\" + lstNet.SelectedItem.ToString() + "\SharedDocs\Documents\Debug\App_File\ggbase.mdb;Jet OLEDB:Database Password=g3n3r4l;";

lstNet is a listbox that contains all computers found in the network.

I'm assuming something else is wrong with my connection string.

According to Connection Strings website, to access a database over LAN, the following connection string format is used:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\serverName\shareName\folder\myDatabase.mdb;User Id=admin;Password=;

I'm assuming that shareName is where my Connection String fails. What is a shareName? And what are the shareNames of Windows XP and Windows Vista / 7 if, say, I placed my database in their Shared Documents / Public Files?

I've tried modifying my connection string into the following:

\C$\Users\Public\Documents\Debug\App_File\ggbase.mdb;Jet OLEDB:Database Password=g3n3r4l;";

And I still get the following error:

"Format of Initialization string does not conform to specification"

May I have some help on this, please?

EDIT: Tried accessing the database in the Public\Documents section of a Windows Vista PC on my network with the following connection string:

\Public\Documents\Debug\App_File\ggbase.mdb;Jet OLEDB:Database Password=g3n3r4l;";

I also tried to access my own (Windows 7 PC) local Public\Documents section using the same connection string, since the serverName can be changed using the program.

Still nothing.

3 Answers 3

1

Try this:

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\serverName\shareName\folder\myDatabase.mdb; Jet OLEDB:Database Password=g3n3r4l;Persist Security Info=False;" 

You must need to test first if you can access the shared path folder on client P.C. And if it can access it there will be no problem. Make sure also that the client user is administrator so it can do CRUD using your app.

Sign up to request clarification or add additional context in comments.

1 Comment

On the client PC? I can access the shared path folder fine on both the Server, and the Client. I added the "Persist Security", but I'm sorry to say it didn't work. I still think it has something to do with that shareName. I just don't know what it is. Researching it had me come up with some codes, so I'm pretty sure it's not a folder. (c$, winnt, stuff like that).
0

Well, I actually solved it. Wow.

It turns out, there was an extra " at the very end of the connection string from the .ini file.

Comments

0

//Try This One...

        string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\\PIS(ACU).mdb;";
        Con = new OleDbConnection(@constr);
        Con.Open();
        Com = new OleDbCommand();
        Com.Connection = Con;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.