SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    May 2000
    Location
    Rhode Island
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DSNless connection

    I am an ASP newbie. I am trying to setup a DSNless connection to an Access Database using:

    Dim objConn
    set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
    "DBQ=" & DBLoc
    objConn.Open

    The location of the database (DBLoc) is specified in an included file.

    My questions is, does the server need to have MSAccess installed in order for this to work?

    Thanks

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Needs to have MDAC (Microsoft Data Access Components) installed (or the access standalone driver) to be able to read it, not the whole program.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is what i use:

    set objConnectionToDatabase=Server.CreateObject("ADODB.Connection")

    objConnectionToDatabase.ConnectionTimeout=30

    objConnectionToDatabase.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= D:\website\datbase.mdb"

    objConnectionToDatabase.Open


    it works

  4. #4
    SitePoint Addict djh's Avatar
    Join Date
    Apr 2000
    Location
    Long Beach, CA
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But the same, as studiococo mentioned, still applies.

    If you are trying to work with an acess 2000 file, than you need to have the jet 4.0 engine installed, which comes as part of the latest downloadable MDAC package. (or alternatively, you can install acess 2000).

    Whether the jet 4.0 engine or the previous MDAC version, you need to have those installed on the server.

  5. #5
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use lucas' method of connecting to a database. I find it simpler to use / code.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I use another codeset which I don't have on me (it's at work) which I'll try and post tomorrow.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  7. #7
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The link below may help anyone who may be having connection string problems. It has connection string info on just about every type of data source that most of us might use.

    http://www.able-consulting.com/ADO_Conn.htm

  8. #8
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Some of it is wrong (foxpro) or misleading.

    Though it is a great resource
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •