Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: connection string to access database


Message #1 by Mona Elias <MonaE@i...> on Wed, 31 Jan 2001 15:40:48 +0200

hi ,

how should my connection string be , if I have Access Data Base ?





Message #2 by Imar Spaanjaars <Imar@S...> on Wed, 31 Jan 2001 15:26:46 +0100
It should look like this if you want to use OLEDB (which is recommended):



sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\somepath\mydb.mdb;" & _

"User Id=admin;" & _

"Password=;"





You may need to use Server.MapPath(FileName) to translate the virtual path 

to a real path, if you use an ISP and don't know the physical location of 

the database:



sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=" & Server.MapPath("/somepath/mydb.mdb") & ";" & _

"User Id=admin;" & _

"Password=;"



Check out 

http://www.able-consulting.com/ado_conn.htm#OLEDBProviderForMicrosoftJet 

for more examples. Look under Jet for the Access drivers.



HtH



Imar



At 03:40 PM 1/31/2001 +0200, you wrote:



>hi ,

>how should my connection string be , if I have Access Data Base ?



Message #3 by "Wally Burfine" <oopconsultant@h...> on Wed, 31 Jan 2001 17:01:05 -0000
try this:



"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _

          Server.Mappath("../Data/MyDB.mdb") & ";"





>From: Mona Elias <MonaE@i...>

>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>

>To: "ASP Web HowTo" <asp_web_howto@p...>

>Subject: [asp_web_howto] connection string to access database

>Date: Wed, 31 Jan 2001 15:40:48 +0200

>

>

>hi ,

>how should my connection string be , if I have Access Data Base ?

>

>

  Return to Index