PHP and an MDB web database....

Discussion in 'Technology' started by Phil Mitchell, Feb 15, 2006.

Users Viewing Thread (Users: 0, Guests: 0)

  1. Phil Mitchell

    Phil Mitchell check me a dollar brer?

    Joined:
    May 19, 2005
    Messages:
    8,965
    Likes Received:
    1
    Location:
    Melbourne
    PHP and an MDB web database....

    if i am working on a database that i have on my system i simply use a DSN and in PHP i use


    $conn = odbc_connect ('emailDSN', '', '') or die( "Could Not Connect to ODBC Database!");



    but what is the PHP command to access an MDB that i have saved on the Web (e.g www.mysite.com/add_info.mdb)????
  2. 1615634792921.png
  3. Jason Bourne

    Jason Bourne Registered User

    Joined:
    Oct 14, 2002
    Messages:
    5,337
    Likes Received:
    0
    This is something I have been wondering about..
    Its one thing setting up a website to run off IIS but I have no clue how a local DSN would work online :spangled:
  4. Phil Mitchell

    Phil Mitchell check me a dollar brer?

    Joined:
    May 19, 2005
    Messages:
    8,965
    Likes Received:
    1
    Location:
    Melbourne
    glad im not the only one then :lol:
  5. Jason Bourne

    Jason Bourne Registered User

    Joined:
    Oct 14, 2002
    Messages:
    5,337
    Likes Received:
    0
    I'm probably gonna be buying some webspace between 2night and friday.. so I'll let u know what the crack is.

    If I can decipher it.. :dunce:
  6. Jason Bourne

    Jason Bourne Registered User

    Joined:
    Oct 14, 2002
    Messages:
    5,337
    Likes Received:
    0
    Finally got round this..

    In your page simple add an include file such as -

    then inside that include file add a connection string like so -

    Then reference to this connection in your code before attempting a sql statement -

    It seems to work for me.
    I was using a local DNS to text out the site I was developing for a project.. but thought how the hell was I gonna get it to work on the lecturers machine when hes trying to grade it, as it won't have my local DNS configured on it.

    Therefore by using this method, possibly with an app.path line, you can set up the site to access the database from where you tell it to, withoutthe requirement for a DNS.

    I ended up with this as my starting code for one of the pages -

    This reads the include file and uses strConnect as the activeconnection to run the SQL statement.
    I'm using asp to do this though.. might be different in PHP but you get the general idea..

    :up:
  7. trance_fan

    trance_fan Registered User

    Joined:
    Nov 7, 2002
    Messages:
    9,079
    Likes Received:
    0
    my god you GEEKS
  8. Jason Bourne

    Jason Bourne Registered User

    Joined:
    Oct 14, 2002
    Messages:
    5,337
    Likes Received:
    0
    I thought you were one of us??!?!? :(
  9. trance_fan

    trance_fan Registered User

    Joined:
    Nov 7, 2002
    Messages:
    9,079
    Likes Received:
    0
    11001010 100101 101010011 11010101 101001100!

    Which of course in english means.....of course i am

    :lol:

Share This Page