changing data environment datalink properties in code
Posted on 2006-06-01
I am developing a VB6.0 app linked to an MS Jet/Access database on my machine. Oviously the app will be distributed to my clients upon completion. In the data enviroment, on the 'connection' tab of the datalink properties I enter the path where the MDB is located on my development machine, 'C:\TestApp\Client.MDB'. This works great for testing but when I let the client install the app they do not have to use the same directory strcuture or even drive letters that I use in testing.
When the app is distributed how do I alter the 'connection' tab property to point to the production MDB. The MDB may be in another directory that the one I tested with and will most likely be on a network drive rather than C:.
I am making some adhoc connections to the database using the following:
dbName = "NEIntAndWeb.mdb"
Open_Ini 'loads 'networkPath' based on values in the .ini
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & NetworkPath & dbName
can I overlay the Data Environment connection with 'strConnect'