#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    1
    Rep Power
    0

    Question Access Database Connection String & Recordset (Help)


    I am passing 3 hidden fields to another page using the method="post"

    Here is the next page -
    <%
    Dim fmMemberID, fmUsername, fmPassword
    fmMemberID = request.Form("memberID")
    fmUsername = request.Form("username")
    fmPassword = request.Form("password")
    %>
    <%
    Dim dbConn
    set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\inetpub\credencia.net\fpdb\members.mdb"
    dbConn.Open

    Dim rsMember
    Set rsMember = Server.CreateObject("ADODB.Recordset")
    rsMember.Open "SELECT * FROM Members WHERE MemberID=179", dbConn,
    %>

    What am I doing wrong here?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Melbourne, Australia
    Posts
    212
    Rep Power
    12
    Do you have the ODBC client setup on your machine?

    If not, there are a number of good threads on this site as well as Your First Database

    Which has reference and guidelines on how to setup your machine for databases.
    How can I soar like an eagle when
    I'm flying with turkey's?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    6
    Rep Power
    0
    Hi,
    First thing, I find it more successful if I keep this line all on one line. Sounds goofy, but it works.
    dbConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\inetpub\credencia.net\fpdb\members.mdb"

    Next, take the comma off the end of this line;

    rsMember.Open "SELECT * FROM Members WHERE MemberID=179", dbConn,

    I would also put my sql statement into a separate variable and then open the recordset using that variable like this;

    src=""SELECT * FROM Members WHERE MemberID=179"

    Better to refer to the variable containing the value you are looking for.
    src=""SELECT * FROM Members WHERE MemberID= " & fmMemberID

    dbConn.open src

    I know it's 4 days after the fact, but I hope it helps.
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12
    What is the error that you get?
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca

IMN logo majestic logo threadwatch logo seochat tools logo