0

Hi,
I am creating a small application which connects to an MS access database.
I am using app to get the path of the mdb. This works fine when I am accessing the exe from my own machine.
When I share the folder containing the exe and access it over the LAN, app looks for the mdb in the client machine. How do I reference the mdb on server?

Following is the code for db connection:

'Module to connect to the database.
Sub db_connect()
Dim AccessConnect As String
Dim sPath As String

sPath = App.Path & "/../MasterDB"

AccessConnect = "Driver={Microsoft Access Driver (*.mdb)};" & _
                     "Dbq=My_Master.mdb;" & _
                     "DefaultDir=" & sPath & ";" & _
                     "Uid=;Pwd=test123;"
                     
con.ConnectionString = AccessConnect
con.Open
End Sub

Can anyone please guide me ahead?
Regards,
ss

4
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by ryan_vietnow
0

Thanks Dilip. I tried this. Didn't seem to work. :(
I am thinking of using a config file to get the path. Couldn't find any other way.
Regards,
ss

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.