VB.NET App using MS Access Problem

ero_sennin

Member
Joined
May 16, 2005
Messages
6
Programming Experience
Beginner
hi to all,

my app uses MS Access 2003

it is working fine when i installed it on a PC with XP and Office 2003 however
i encountered a problem in my application when i installed it in a pc that only has windows 2000.

when i run my application is gives an error that says "Cannot Find Database File"
i can understand why it cant see the database file. because the MDB file was also in the same directory.

please help...

thx
 
I have used an Access 2003 database with no issue on Win2000 without Access. How have you created your connection string? Are you sure it is looking in the correct folder for the database file? If you have hard-coded your connection string or are storing it in an unedited configuration file, you must be sure that your application will be installed to the same location every time. If I know that an application's database will be in the program folder I usually build my connection string at run-time like so:
VB.NET:
[color=Blue]Dim[/color] connectionString [color=Blue]As[/color] [color=Blue]String[/color] = [color=Blue]String[/color].Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""{0}\{1}""", Application.StartupPath, dbFileName)
 

Latest posts

Back
Top