Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,895 members, 7,817,634 topics. Date: Saturday, 04 May 2024 at 03:57 PM

[Help Request] Help With Database Connectivity Error - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / [Help Request] Help With Database Connectivity Error (2317 Views)

[Help Request] Teach Me How To Design Databases. / [Help Request] Help On Java download and Installation Oo! / [Help Request ] I Want To Learn Programming, what are the requirements (2) (3) (4)

(1) (Reply) (Go Down)

[Help Request] Help With Database Connectivity Error by Nobody: 6:58pm On Feb 16, 2012
i am having a connectivity error am using vb express 2008 and microsoft access
whwni link it with following code i have an error c:\db1.mdb is not a valid path any solution or code i can use am using window 7




Dim dbProvider As String
Dim dbSource As String

dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = C:/db1.mdb"

con.ConnectionString = dbProvider & dbSource
Re: [Help Request] Help With Database Connectivity Error by csharpjava(m): 10:36pm On Feb 16, 2012
First move the db1.mdb file to the root directory of your application, then use one of the connections below that applies to your application.

' Use this for a windows application
Dim dbProvider As String
Dim dbSource As String

dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source=" & System.Environment.CurrentDirectory & "./db1.mdb; User Id=admin;Password=;"
con.ConnectionString = dbProvider & dbSource

' Use this for a web application
Dim dbProvider As String
Dim dbSource As String

dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source=" & Server.MapPath("db1.mdb"wink
con.ConnectionString = dbProvider & dbSource
Re: [Help Request] Help With Database Connectivity Error by Nobody: 7:53pm On Feb 17, 2012
WHERE IS THE ROOT FOLDER OF MY APPLICATION CAN BE IS IT DRIVE C/PROGRAM FILES OR WHERE MIND YOU I AM USING MSS ACCESS 2007 DATABASE WITH AN EXTENSION OF db1.accdb how can i connect to it
Re: [Help Request] Help With Database Connectivity Error by csharpjava(m): 10:29pm On Feb 17, 2012
Ok leave your database file on drive C and then try this code below, it should work for Access 2007 .accdb extention.

Dim dbProvider As String
Dim dbSource As String

dbProvider = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
dbSource = "Data Source=  C:\\db1.accdb; User Id=admin;Password=;"
con.ConnectionString = dbProvider & dbSource
Re: [Help Request] Help With Database Connectivity Error by Beaf: 8:03am On Feb 18, 2012
wus1:

i am having a connectivity error am using vb express 2008 and microsoft access
whwni link it with following code i have an error c:\db1.mdb is not a valid path any solution or code i can use am using window 7

Dim dbProvider As String
Dim dbSource As String

dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = C:/db1.mdb"

con.ConnectionString = dbProvider & dbSource

You are getting the error because the Microsoft.Jet.OLEDB driver cannot see the database. In other words, your path is either wrong or your application does not have read permissions on drive C:\.

Do this quick test:
> paste the string, C:/db1.mdb in Windows Explorer, press Enter. Does the file open? If no, you have found the problem; its a bad path. However, if it opens, you need to check if the user your application is running under has read permissions on C:\.
Re: [Help Request] Help With Database Connectivity Error by leastpay(m): 1:32am On Mar 19, 2012
load vb.net 2008, then goto BUILD menu, click configuration manager,below the active solution platform,click the drop down list for ANY CPU you will see options like NEW,EDIT etc click NEW. NEW SOLUTION PLATFORM DIALOG WILL COME OUT ,instead of x64 pick x86.click close.

go back to ur project folder, under BIN folder you will see x86 folder inside you have debug folder .that is where you will put ur ms access file.mdb

these steps will only work if ur connection string is correct.i.e you normal connection string


if i solved ur problem reached me via 08067361023 , leastpaysolution@yahoo.com
Re: [Help Request] Help With Database Connectivity Error by cripnip(m): 11:11am On Mar 20, 2012
windows is c:\ and not c:/. this slash / is for linux and web paths.
Re: [Help Request] Help With Database Connectivity Error by BizBooks(m): 12:48pm On Mar 26, 2012
wus1:
Dim dbProvider As String
Dim dbSource As String

dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = C:/db1.mdb"

con.ConnectionString = dbProvider & dbSource

@Wus1,

A problem such as yours can keep one up for hours. Did any of the
suggested solutions work for you. If not, try changing the dbSource
line to:

dbSource = "Data Source="Server.MapPath("YourDBName.mdb"wink

With Server.MapPath, you do not need to specify the location of the DB.
The server will find it. Below is the exact code snippet I used to connect
successfully to an Access web database without specifying the actual location.
Note the use of "&" and "_" to indicate string continuity.

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection"wink
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("Classified.mdb"wink
Re: [Help Request] Help With Database Connectivity Error by BizBooks(m): 12:56pm On Mar 26, 2012
Apparently NL code translates apostrophe (") and D to a grinning
face and apostrophe (") and closing bracket to a winking face. Those
were not my intention in the post above. So wherever you see a grinning
face, that's a D and wherever you see a winking face, that's a closing bracket.

(1) (Reply)

If You Want To Learn Angularjs With Php..using XAMP ...why Not Join In Here / What Percentage Of Nigerian Citizens Are Developers? / 1. Learning Android Programming

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.