Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2004, 11:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default ADO Connection String

I have an ACCESS database which I am going to put a password. What do I need to do or add in my connection string for the password? The connection string below is working till I put a database password.


  Dim objConn
  curDir = Server.MapPath("db/MyDatabase.mdb")
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir

Thanks,
Judy
 
Old February 2nd, 2004, 03:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try adding a password to the Admin account instead. Typically passwords are user-oriented instead of file-oriented. If you give the Admin a password, then add the following to the connection string:

User ID=Admin; Password=<password>;

Hope this helps,

Brian
 
Old February 3rd, 2004, 09:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

Hi Brian,

I tried putting a user id and password and it didn't work. I researched on it some more and this is suppose to be the correct way of handling the connection string. The only problem is, it still does not work. I am getting an invalid password error message. I swear I did not make a mistake on typing the password. Can anyone please help.

Thanks,
Judy

  Dim objConn
  curDir = Server.MapPath("db/myDatabase.mdb")
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir & ";Jet OLEDB:Database Password=" & mypassword
 
Old February 3rd, 2004, 12:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

I finally figured out what I was doing wrong. I am passing my password as a variable which I should not.

Wrong way

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & myPath & ";Jet OLEDBatabase Password=" & myPassword

Correct Way

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & myPath & ";Jet OLEDBatabase Password=myPassword"

It was right in front of my eyes and it took me half a day to figure it our. Oh well...

Thanks for your help.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DAO and ADO within ADODB.connection faridrd Access VBA 0 January 8th, 2008 10:43 PM
Exclusive ADO Connection bsa Pro VB Databases 1 September 6th, 2004 07:16 AM
Exclusive ADO Connection bsa SQL Server 2000 2 August 24th, 2004 12:10 AM
ADO Connection Crashes IIS byron Pro VB Databases 0 July 29th, 2004 10:46 AM
ADO connection string to dBase IV EddyT Excel VBA 2 June 21st, 2004 02:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.