Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: How to connect an Access Database with password


Message #1 by "Frankie Ha" <fanki@p...> on Wed, 31 Jan 2001 06:32:05 -0000
My current connection with the database like the following.  I would like

to set a password for the database because I don't wanna let other people

can open the database.  So any changes should I do for my connection?

Thank you very much.







<%

Function NewCounter (filename, tablename)



	Set conn = Server.CreateObject("ADODB.Connection")

	Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"

	DBPath = "Data Source=" & Server.MapPath("security/" &filename)



	conn.Open Provider & DBPath



	Set rs = Server.CreateObject("ADODB.Recordset")

	rs.Open tablename, conn, Cursor, 2



	Set NewCounter = rs

END Function

%>

Message #2 by Imar Spaanjaars <Imar@S...> on Wed, 31 Jan 2001 09:29:47 +0100
Change your connection string to this:



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

"Data Source=" & Server.MapPath("security/" & filename) & ";" & _

"Jet OLEDB:Database Password=MyDbPassword;", _

"admin", ""



(Taken from 

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



But who is "other people"?? Put your database in a not downloadable / 

secure area of your site and you should be safe. Unless you don't trust the 

people that have access to your server of course.



Imar





At 06:32 AM 1/31/2001 +0000, you wrote:

>My current connection with the database like the following.  I would like

>to set a password for the database because I don't wanna let other people

>can open the database.  So any changes should I do for my connection?

>Thank you very much.

>

>

>

><%

>Function NewCounter (filename, tablename)

>

>         Set conn = Server.CreateObject("ADODB.Connection")

>         Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"

>         DBPath = "Data Source=" & Server.MapPath("security/" &filename)

>

>         conn.Open Provider & DBPath

>

>         Set rs = Server.CreateObject("ADODB.Recordset")

>         rs.Open tablename, conn, Cursor, 2

>

>         Set NewCounter = rs

>END Function

>%>




  Return to Index