directory installation problems

i have a problem regarding the installation path and directory

below is my code

Private Sub Form_Load()
Dim rsregister As New ADODB.Recordset
' C:\Program Files\Ldsmem\Database.mdb
Let Ldsdb.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Program Files\Ldsmem\Database.mdb"
Ldsdb.Open
rsregister.Open "Select * from Stake", Ldsdb, adOpenDynamic, adLockOptimistic

If rsregister.EOF = True Then
Timer1.Enabled = False
frmsetup.Show
rsregister.Close
Me.Hide
End If
End Sub

my problem here is the source, paticulary the .mdb file

this is the default installation path

what if the user wants to change the directory then the program wont run

i want that wherever the installation path/directory is the the source of the .mdb file will also change

for example: the users wants to install it in drive D:\New Folder then the Source = D:\New Folder

the source path will also change somewhat app.path?
[1049 byte] By [matthewivan] at [2007-11-19 17:41:49]
# 1 Re: directory installation problems
When you build distribution package you can specify destination folder so you would be able to use App.Path instead:

strConString = = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =" & App.Path & "\Database.mdb"
RhinoBull at 2007-11-9 20:19:01 >
# 2 Re: directory installation problems
The mdb file goes into the same directory as your program?

I assume that's your case. To fix it, you'd need to make the path dynamic, which means something like:
Let Ldsdb.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & Replace(App.Path & "\Database.mdb", "\\", "\")
That will let them install the program wherever they want and the application will still find it (assuming, of course, it's set to install in the same directory).
ChaosTheEternal at 2007-11-9 20:19:56 >
# 3 Re: directory installation problems
thankz a lot
matthewivan at 2007-11-9 20:20:59 >