After installing on a clean machine that doesn't have a copy of VB, and on attempting to run the wizard created packaged application, I get the error message "Unable to open database".
If I install on a machine which has a copy of VB it runs fine with errors.
Below is the code which generates the error-
Any ideas?Code:Sub Main()
On Error GoTo Err_Main
' Assumming 'MDB' will be kept in the same folder
' as the 'EXE' file, save the app path in a global variable.
'
g_sDataPath = App.Path & "\sfdatafirst.mdb"
' Establish a global database connection that can be used
' throughout your application for creating recordsets.
'
g_DB.ConnectionString = "Data Source=" & g_sDataPath
g_DB.Provider = "Microsoft.Jet.OLEDB.3.51"
g_DB.CursorLocation = adUseServer
g_DB.Open
' Open the startup form of your application.
'
frmLogin.Show
Exit Sub
Err_Main:
MsgBox "Unable to open database.", vbCritical, "See Administrator"
End
End Sub
