SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot karnetics's Avatar
    Join Date
    Dec 2004
    Location
    USA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question need help with access db

    Hello every. I have trying to help a friend out with his web site... I am more of a php person but he need my help so here I am... The he is having is that he is using ADODB.Connection to access an Access DB(mdb) on his website. He switch from one webhosting company to another and not his website can not connect to his access db. I have provided the code for your review.. Where is the problem.. How can I get the code to find the (MDB) database?

    Also I am connecting and testing is new web site via ip... His domain name is still pointing back to the old DNS address..
    <%
    ' Open Database Connection
    Set Con = Server.CreateObject( "ADODB.Connection" )
    Con.Open "gandeparts.com_access_gande","gande","xxxxxxxxxx"

    'DSN=gandeparts.com_access_gande;UID=[user_name];PWD=[password];

    sql = "SELECT * FROM members where username = '" & request("username") & "' and password = '" & request("password") & "';"

    set rs = server.createobject("ADODB.Recordset")

    rs.Open sql, Con, 3 'adOpenStatic

    if rs.EOF <> true then
    rs.close
    set rs = nothing
    Con.close
    set con = nothing
    session("username") = request("username")
    response.redirect "lookupparts.asp"
    end if

    rs.close
    set rs = nothing
    Con.close
    set con = nothing

    response.redirect "logina.asp"
    %>
    <html>
    <body>
    <%= sql %><br>
    <%= rs("username") %>
    </body>
    </html>

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The problem here is that he is using a DSN, and his new host doesn't support DSN's. Thus what he needs is a DSN-less connection.

    More info and help here and here
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Zealot karnetics's Avatar
    Join Date
    Dec 2004
    Location
    USA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found out that his new host account is a linux, instead of MIS II

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Does this new host even support ASP?

    Maybe he needs to recode using PHP and connect to the database using the COM method.
    Ian Anderson
    www.siteguru.co.uk

  5. #5
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by karnetics View Post
    I found out that his new host account is a linux, instead of MIS IIS
    Scrap this code then. You won't be able to use it unless they're running something like ChiliSoft. (And I doubt they are.)


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
  •