Using DataConnection across network

bjdobosh

Member
Joined
Sep 5, 2006
Messages
6
Programming Experience
1-3
Hey Everyone -

Hoping someone has tried this before.

I have a database that is sitting in a shared folder with open
permissions on my hdd on a network.

It is accessible on the network to everyone.

the location is similar to \\ComputerName\Click\Test.mdb

where computerName is my computer name, the folder being called click, and the Test.mdb being an access database.

When I add the connection in server explorer within Visual Studio, the test connection
works. I add a oledbconnection to the form. When I run the form, and
use oledbconnection.open() I recieve an error message saying

"Format of the initialization string does not conform to the OLE DB
specification"

the string is as follows

Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=;Data
Source="\\ComputerName\Click\test.mdb";Password=;Jet OLEDB:Engine
Type=4;Jet OLEDB:Global Bulk
Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode="Read|Share
Deny Read|Share Deny Write";Jet OLEDB:New Database Password=;Jet
OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Admin;Jet OLEDB:Encrypt Database=False

Can anybody help me out?

I don't want to use SQL Server. The point is for the program to run
on a person's local hdd and it connect through the network I live on and to
access the database sitting on my hdd in the shared folder.

I don't understand why it connects on the server explorer, but not
when run.

I know the database works - if i do a local connection string i.e. c:\mydocument\click\test.mdb, the program works.

Thanks!
 
As far as I can tell.... that isn't a standard connection string..... where did you get it from?

-tg
 
vb generated

Well that connection string is Visual studio connection string that is generated once i drop the connection onto the form. I didn't write that, that's what visual studio generated.
 
the main question

the main question I have is how to connect to an access database over a network. Has anyone ever tried? does it even work? I would imagine it would, but i'm not sure.

Thanks
 
It does indeed work... just not with a connection string constructed like that.... I'll ask again.... where did that connection string come from? You had to have copied it from somewhere....

Secondly... did you try looking at connectionstrings.com? .... they've got all the connectionstring formats in an easily navigatable format...

All you have to do is find the right one, copy it, and fill in your settings, and it's goodto go.

-tg
 
the main question I have is how to connect to an access database over a network. Has anyone ever tried? does it even work? I would imagine it would, but i'm not sure.

Thanks

You can, but if your experiences are anything like mine (paired point-of-sale till system using an access db) you will rue the day you decided to use Access. Access is a database for single user purposes, suitable for holding grandma's record collection and your favourite recipes.

I encourage you to choose sql server express if you require networked databasing. Forming a connection over file shared network paths will work but will be prone to complications and record locking issues. We never found the reason why some of our systems froze several times a day without warning yet others worked fine for months - they were all identical when shipped!

If you insist on using access, there is an easy way to design a connection string
Make a file called a.udl on your desktop and double click it. Set all the parameters for accessing your DB and get a successful test connection. Then open the a.udl file in notepad, and there is your conenction string
 
Back
Top