SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jet.OLEDB Conn to ADO.DB Conn

    Hi,
    I'm newbie to ASP
    I used to use this connection string to connect my asp script to mdb in Localhost:

    -----------------------------------------
    my_connection_file.asp:

    Connect_String="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("/somewwwfolder/db/mydatabase.mdb")&";Persist Security Info=False"
    -----------------------------------------

    it is worked in my localhost.
    then now I put the script in some free asp host, all file uploaded, but somehow when i run .asp file, got error in the connection string.
    after read the hoster faq, it stated to

    related FAQ
    How do I connect to my MS Access database?
    Make sure your database is in the "db" directory in your file space.
    Here is a sample ASP code to connect to a MS Access database.

    Set Conn = Server.CreateObject("ADODB.Connection")
    strConnection = "DRIVER=Microsoft Access Driver(*.mdb);DBQ=" & Server.MapPath("/USERNAME/db/yourdatabase.mdb")

    so my Question is, how do you make a db connection from my_connection_file.asp to become a connection db string as related hoster faq?

    thanks in advance,
    cepot

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just use the example they provided and you should be ok

    Code ASP:
    Set Conn = Server.CreateObject("ADODB.Connection")
    strConnection = "DRIVER=Microsoft Access Driver(*.mdb);DBQ=" & Server.MapPath("/USERNAME/db/yourdatabase.mdb")

  3. #3
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    359
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Also you probably can use the more robust OLEDB driver if you modify the connection string you started with to the proper path to the .mdb. You can find examples of connection strings at connectionstrings.com
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is this hosted at Brinkster by any chance?

    You may find my tutorial here of some use.
    Ian Anderson
    www.siteguru.co.uk

  5. #5
    SitePoint Member
    Join Date
    Nov 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @all : thanks for helping. It just solved by moving to other paying asp hosting. i guess it was caused of some restriction of include file .inc (Global Asa something, according Microsoft Knowledge sort of). anyway thanks for helping guys.

    @webber: I did use the example hoster provide, and its not worked so i came here to asked about it.

    @Doug: yes, i put in the connection string valid path & file name

    @siteguru: no, it isn't sire. its other free hosting.


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
  •