#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Earth
    Posts
    18
    Rep Power
    0

    ASP and MS Access database


    hello...
    i currently have a Ms Access database stored at
    c:\database\db.mdb

    how do i use Asp to connect to the database??

    I would like to know how to access the database with and without using odbc
  2. #2
  3. superficial
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Peterborough, England
    Posts
    188
    Rep Power
    13
    With ODBC
    - Open ODBC data source administrator, which is within control panel->administrative tools on win2k, or c:\winnt\system32

    Without ODBC
    - Use server.mappath, or a physical string

    Like this.

    PHP Code:
    dim path
    dim provider

    path 
    "C:\blah\blah.mdb"
    'path = "" & Server.MapPath("../database.mdb") & ""
    provider = "Microsoft.Jet.OLEdb.4.0"

    dim objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.provider = provider
    objConn.ConnectionString = path
    objConn.Open 
    etc etc.....

    pretty simple stuff.
    _______________
    Matt

IMN logo majestic logo threadwatch logo seochat tools logo