I have at lease one ADO data control on several VB forms.
Their ConnectionString property is set to the ff. value:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\ Security Info=False
Please note that the database H3.mdb is on drive C.
For various reasons when I install my program on another computer,
the database has to be located on drive D instead of Drive C
Thus in the above connection string I have to replace C: with D:
and set at runtime the ConnectionString property of all my ADO Data Controls on all forms
With adoDataControl
.ConnectionString = sNewConnectionString
.Refresh
end with
The variable sNewConnectionString has the value:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\ Security Info=False
All that has changed is the drive letter.
The problem now is when the Refresh method is called,
VB flashes an error saying it could not find the file on Drive C:
But when I checked the value of the ConnectionString property,
it already has the value of the variable sNewConnectionString.
Is there anything else I should do?
Their ConnectionString property is set to the ff. value:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\ Security Info=False
Please note that the database H3.mdb is on drive C.
For various reasons when I install my program on another computer,
the database has to be located on drive D instead of Drive C
Thus in the above connection string I have to replace C: with D:
and set at runtime the ConnectionString property of all my ADO Data Controls on all forms
With adoDataControl
.ConnectionString = sNewConnectionString
.Refresh
end with
The variable sNewConnectionString has the value:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\ Security Info=False
All that has changed is the drive letter.
The problem now is when the Refresh method is called,
VB flashes an error saying it could not find the file on Drive C:
But when I checked the value of the ConnectionString property,
it already has the value of the variable sNewConnectionString.
Is there anything else I should do?