datasourcing
-
Hi, I am having a very simple problem perhaps. I am using visual studio 2008 and have input an access data file called db1.mdb from hard disk. This contains a file called Sheet1. I would like to connect to that database from my form. I am using following code which says connection failure. My file contain no password and username.
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=db1.mdb")
Please help me
-
Hi, I am having a very simple problem perhaps. I am using visual studio 2008 and have input an access data file called db1.mdb from hard disk. This contains a file called Sheet1. I would like to connect to that database from my form. I am using following code which says connection failure. My file contain no password and username.
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=db1.mdb")
Please help me
is the .mdb file in the same folder your .exe is in??
-
is the .mdb file in the same folder your .exe is in??
-
OK, then try - adding a semi-colon - adding a default account and empty password - adding an empty account and password - using full path This works for me:
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+file+";User Id=admin;Password=;";
where file is a string containing the full path. This article is an introduction to using MDB files: Using ADO.NET for beginners[^] :) -
Hi, I am having a very simple problem perhaps. I am using visual studio 2008 and have input an access data file called db1.mdb from hard disk. This contains a file called Sheet1. I would like to connect to that database from my form. I am using following code which says connection failure. My file contain no password and username.
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=db1.mdb")
Please help me
Hi, Try "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mdb" good luck :) NajiCo
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice... http://www.facebook.com/group.php?gid=5932660937[^]
-
Hi, Try "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mdb" good luck :) NajiCo
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice... http://www.facebook.com/group.php?gid=5932660937[^]
That works for ClickOnce deployed applications. If you're not using ClickOnce, it's pretty much useless.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
That works for ClickOnce deployed applications. If you're not using ClickOnce, it's pretty much useless.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Hi Dave, Actualy, using "|DataDirectory|" is very helpful to locate a database in the app's folder, it's not restricted to ClickOnce, just give it a try! best regards, NajiCo
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice... http://www.facebook.com/group.php?gid=5932660937[^]
-
Hi Dave, Actualy, using "|DataDirectory|" is very helpful to locate a database in the app's folder, it's not restricted to ClickOnce, just give it a try! best regards, NajiCo
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice... http://www.facebook.com/group.php?gid=5932660937[^]
Naji El Kotob wrote:
is very helpful to locate a database in the app's folder
That's the one place I never put a database. In most corporate environments I've been in, Program Files is ReadOnly, unless absolutely necessary.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Hi, Try "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mdb" good luck :) NajiCo
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice... http://www.facebook.com/group.php?gid=5932660937[^]
-
Hi, Great :) ... on the other hand, check Dave's comment regarding the location of database! best regards,
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice... http://www.facebook.com/group.php?gid=5932660937[^]