Go Back  Xtreme Visual Basic Talk > Other Languages > Web Programming > ADO Connection string with Password protected database


Reply
 
Thread Tools Display Modes
  #1  
Old 02-02-2004, 12:01 PM
jmss66 jmss66 is offline
Newcomer
 
Join Date: Feb 2004
Posts: 17
Default ADO Connection string with Password protected database


I have an ACCESS password protected database I am constantly getting an invalid password error message. What is it I am missing? Below is my ADO Connection string. Any assistance will help.

Thanks,
Judy

Dim objConn
curDir = Server.MapPath("db/HFPension.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir & ";Persist Security Info=False;Jet OLEDBatabase Password=" & xerox
Reply With Quote
  #2  
Old 02-02-2004, 12:21 PM
rahamad rahamad is offline
Regular
 
Join Date: Aug 2002
Location: Earth
Posts: 59
Default

Here's what I use and it works:

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

Keep in mind this only works for a regular password-protected database. If you are using a workgroup security file, the way to pass in the info is different.
Reply With Quote
  #3  
Old 02-02-2004, 12:43 PM
jmss66 jmss66 is offline
Newcomer
 
Join Date: Feb 2004
Posts: 17
Default

I did try your connection string. I took out the Persist security info since this is the only thing different between you connection string and mine. I still get the error message invalid password. I swear I did not do a typo on the password. I still do not understand why it is working for you when I even copied your connection string to my program so there won't be any typing error.

Thanks,
Judy
Reply With Quote
  #4  
Old 02-03-2004, 08:33 AM
jmss66 jmss66 is offline
Newcomer
 
Join Date: Feb 2004
Posts: 17
Default

Quote:
Originally Posted by jmss66
I did try your connection string. I took out the Persist security info since this is the only thing different between you connection string and mine. I still get the error message invalid password. I swear I did not do a typo on the password. I still do not understand why it is working for you when I even copied your connection string to my program so there won't be any typing error.

Thanks,
Judy




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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a file in dat question ? murphys General 5 11-06-2002 08:34 PM
Open an associated Text Document knoxitis General 19 05-01-2002 11:26 PM
Shareware Registry Protection Technigue karachi999 General 2 01-21-2002 02:40 PM
Loop to format file kingesk General 2 09-10-2000 05:01 PM
File format problem kingesk General 1 09-08-2000 04:52 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->