Help changing connectionstring....

KozmiKKicK
04-17-2004, 09:23 PM
I am using vb6 right now and I am using the adodc control... The data app runs well under on my computer, but when I install to another computer, it doesn't work, because the database path listed under the connectionstring is wrong. What I thought I could do was:


Private Sub Form_Load()
adoSubstrate.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data\Database\mycophile.mdb;Persist Security Info=False"
adoSubstrate.RecordSource = "Substrate"
End Sub


But when I execute, it won't work... Is there another way to do this??

webbone
04-17-2004, 10:08 PM
Are you certain that your database file is getting placed in that directory under your application? You might want to check for the existence of the file before using that path in your connection string:


Dim sFilePath as String

sFilePath = App.Path & "\Data\Database\mycophile.mdb"

If Dir(sFilePath)="" Then 'does the file exist?
Msgbox "File Not Found: " & sFilePath
'Do something here to allow user to find the file...
End If


Have you checked manually on another computer where you have run your installer to verify that the Paths you expect to be created and installed have actually been done? I would bet the problem is in the Installer script.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum