Knowledgebase: Database
Ms Access
Posted by - NA - on 17 September 2005 08:22 PM
Ms Access Database

 

[1] Question: Where is the database folder for MSAccess database ??


"Db" folder created along with the ""www"" or "wwwroot" folder is the recommended folder for .mdb file placements. Reasons why we recommend is...

  1. Security
    Folder "Db" is out of the public area of your web site. Any content you place inside the "Db" folder is not accessible via http protocol to the web surfer.
  2. Read/Write Access
    System users have complete read-write access of the "dB" folder, while the other folders like "www" & folders inside that; are read-only folder.
  3. ODBC DSN Creation
    You can create DSN via HELM Control panel for the .mdb files placed inside the folder "Db" & it's sub-folder.

 

Please contact the support technician, if you have further queries.


[2] Question:
I need help on connecting with the database.
 

Ms Access Database Connection ASP Code.

  • DSN less connection:

Dim strConn

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

strConn="DRIVER={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & "DBQ=" & Server.mappath("db/mydb.mdb")

 

 

-OR-

 

strConn=strConn & "DBQ=C:\domains\mydomain.com\db\mydb.db"

 

  • DSN based connection:

Dim strConn

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

strConn.ConnectionString = "DSN=test"

strConn.Open

Response.Write "Access Connection Successful"

(683 votes)
This article was helpful
This article was not helpful

Comments (0)
Help Desk Software by Kayako Resolve