Hi there!
Can anyone help me out with a little problem im having with Visual Basic in Access? I'm kinda new to it so i dont know if this is possible, but can you write a connection string without specifying the exact path??
My current code is:
What i want to do is just specify the file name incase i move it to a different directory, because i dont want to have to keep changing the code each time. If i take out c:\test\ it looks for the file in myDocuments! I've tried using the Path command but it keeps coming back saying "constant required"
Anyone have any ideas??
Thanks
Can anyone help me out with a little problem im having with Visual Basic in Access? I'm kinda new to it so i dont know if this is possible, but can you write a connection string without specifying the exact path??
My current code is:
Code:
Const dbfile = "c:\test\test.mdb"
Const strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbfile & ";Persist Security Info=False"
What i want to do is just specify the file name incase i move it to a different directory, because i dont want to have to keep changing the code each time. If i take out c:\test\ it looks for the file in myDocuments! I've tried using the Path command but it keeps coming back saying "constant required"
Anyone have any ideas??
Thanks