connection string to connect access database from VB

  • Thread starter Thread starter vigneshwaran G via DotNetMonster.com
  • Start date Start date
V

vigneshwaran G via DotNetMonster.com

Hi ,
I am trying ot connect a VB application to Access database.
iam using the following connection string :

con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;data source=c:\
windows\desktop\ex1.mdb;Persist Security Info=False"

it worked where the access file is in the local system

but i want to access the datbase from anotehr system, a server.

Please help in forming the connection string so taht i can connect to the
remote system connected in network.

Vignesh
 
Vignesharaw,

Than just change the filepath in that, all users needs to have rights for
that by the way

Access is not a database server, it is a database file.

I hope this helps?

Cor
 
Hi Cor,
Thanks for that.
But it needs the folder containing the file to be shared!
Is there any otehr way to achieve this without sharing the file?

Thanks,
Vignesh
 
¤ Hi ,
¤ I am trying ot connect a VB application to Access database.
¤ iam using the following connection string :
¤
¤ con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;data source=c:\
¤ windows\desktop\ex1.mdb;Persist Security Info=False"
¤
¤ it worked where the access file is in the local system
¤
¤ but i want to access the datbase from anotehr system, a server.
¤
¤ Please help in forming the connection string so taht i can connect to the
¤ remote system connected in network.

Have you tried using a UNC path name?

\\servername\Database\db1.mdb


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi Paul,

Thanks for your comment.
I am not aware of the term UNC path ...

\\servername\Database\db1.mdb

As you mentioned, Please let me know how could i find the database name in
Access in the above path..and in which tag should i include this path in
connection string.

Thanks,
Vignesh
 
¤ Hi Paul,
¤
¤ Thanks for your comment.
¤ I am not aware of the term UNC path ...
¤
¤ \\servername\Database\db1.mdb
¤
¤ As you mentioned, Please let me know how could i find the database name in
¤ Access in the above path..and in which tag should i include this path in
¤ connection string.

You need to create a "file share" on the other machine to the path where the database is located.
For the following example the share name is Database:

con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;data
source=\\machinename\Database\ex1.mdb;Persist Security Info=False"

Of course, everyone who needs to access this database must have full permissions for the folder
(file share) where the database is located.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top