If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > problem with password protected DB and ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-25-04, 12:15
jaberwocky jaberwocky is offline
Registered User
 
Join Date: Feb 2004
Location: Vancouver
Posts: 17
problem with password protected DB and ASP

Help!
I password protected an ACCESS DB. However now when i try to access any of my .asp pages that link to the database i am getting the following error.
Code:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Not a valid password.
Obviously it is looking for a password before it accesses my database. Is there anyway around this? I would like to keep my DB password protected, unless someone can suggest some other form of security where i can keep users out of the actual database itself (ie. not able to open it in Access), but still allow them to enter and view data via my asp pages.
__________________
still in the baby steps of coding
Reply With Quote
  #2 (permalink)  
Old 05-25-04, 13:23
ASP-Hosting.ca ASP-Hosting.ca is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
All you need to do is to put your Access database outside of the root folder of your website. This way the database won't be accessible for the users browsing the site.
Reply With Quote
  #3 (permalink)  
Old 05-25-04, 13:39
jaberwocky jaberwocky is offline
Registered User
 
Join Date: Feb 2004
Location: Vancouver
Posts: 17
on my server i do have the database outside the root of my website.

I am running IIS on WinXp and have my web pages located at c:\inetpub\wwwroot\databases\mydatabase.mdb

my asp pages are at c:\inetpub\wwwroot\asp\attendance folder

or do you mean to move my DB completely out of the wwwroot...... folder?
__________________
still in the baby steps of coding
Reply With Quote
  #4 (permalink)  
Old 05-25-04, 15:10
ASP-Hosting.ca ASP-Hosting.ca is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
If your Access db is password protected, you can put the password into your connection string and then you'll be able to open your database from your ASP application.

Putting your Access databases outside of the root of your web application, will make the db inaccessible for download for your website visitors.

I hope this helps.
Reply With Quote
  #5 (permalink)  
Old 05-25-04, 16:14
jaberwocky jaberwocky is offline
Registered User
 
Join Date: Feb 2004
Location: Vancouver
Posts: 17
OK, i understand the concept, but how would i code in a password below. Sorry my coding abilities are still rather novice. I am using a DSN connection
Code:
<%
Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "attendance2004","",""
    sql = "SELECT [staff].[fullname], [staff].[employeeno] FROM [staff] ORDER BY [staff].[fullname];"    
    Set rs = Server.CreateObject("ADODB.Recordset")    
    rs.Open sql, conn, 3, 3    
%>
I did a search on google for some examples and i found one on ASP101.com, but couldnt get it too work.
__________________
still in the baby steps of coding
Reply With Quote
  #6 (permalink)  
Old 05-25-04, 16:59
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Your connection string should look like:

"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=accessDB.mdb;Password=whatever;"
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #7 (permalink)  
Old 05-27-04, 20:55
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=MyDSN"; UserID=MyUserID; pwd=MyPassword"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On