Professional Web Applications Themes

ASP newbie help! - ASP Database

I downloaded this asp script and I cannot get it to work as my reference book does not give examples like this. the asp file is in the "WWW" directory and is called vote_db.asp the access db file is in a directory called 'DB" and is called votes_db.mdb the DSN is called votes_db (i chose this name is that correct?) All the files are on my ISP's server How do I amend the following script to make it work? accessdb="votes_db" cn="driver={Microsoft Access Driver (*.mdb)};" cn=cn & "dbq=" & server.mappath(accessdb) set rs = server.createobject("ADODB.Recordset") sql = "select ip from ballot where ...

  1. #1

    Default ASP newbie help!

    I downloaded this asp script and I cannot get it to work as my
    reference book does not give examples like this.

    the asp file is in the "WWW" directory and is called vote_db.asp
    the access db file is in a directory called 'DB" and is called
    votes_db.mdb

    the DSN is called votes_db
    (i chose this name is that correct?)

    All the files are on my ISP's server


    How do I amend the following script to make it work?


    accessdb="votes_db"
    cn="driver={Microsoft Access Driver (*.mdb)};"
    cn=cn & "dbq=" & server.mappath(accessdb)
    set rs = server.createobject("ADODB.Recordset")
    sql = "select ip from ballot where ip ='" & u_ip & "'"

    rs.Open sql, cn


    Any help more than appreciated!


    Michael M



    Mint Guest

  2. #2

    Default Re: ASP newbie help!

    Mint wrote: 

    My preference is to create subfolders under sssroot to contain my asp files.
     

    ?? The name of a DSN does not matter. What matters is that you've chosen to
    use an obsoletee technology (ODBC) rather than the more robust and
    feature-laden OLEDB technology. See www.able-consulting.com/ado_conn.htm for
    examples of connection strings using the OLEDB Provider for Microsoft Jet.
     

    Hard to say without knowing what's not working. In the future, please do not
    make us ask. Fully describe the problem you are having without using the
    words "does not work". We are reading your newsgroup message, not looking
    over your shoulder at your computer screen as you attempt things.
     

    See the above website.
     
    Go to www.aspfaq.com for more answers to frequently-asked questions.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  3. #3

    Default Re: ASP newbie help!

    On Sun, 19 Sep 2004 07:17:31 GMT, Mint <net.au>
    wrote:
     

    The following script works fine as is.
     

    You got that right. The code is correct and fully functional above.
    Since you tell us it doesn't work, I have to assume that you had an
    indication of it not working, like an error message. Using that error
    message, you can track down your problem. Since we're not priveleged
    enough to know the error, we can't.

    It could be as simple as you not having a web server. It could be as
    complex as you having incorrect code for retrieving the u_ip variable
    from wherever you're getting it.

    Post the exact error, the version of IIS and the results you expected.
    And you may want to switch to a more current method, where you don't
    use a DSN.

    Jeff
    Jeff Guest

Similar Threads

  1. A newbie with a newbie question
    By dusty_davis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: October 14th, 07:54 AM
  2. Newbie - help please
    By Kenny in forum Macromedia Flash
    Replies: 4
    Last Post: December 21st, 06:31 AM
  3. Replies: 5
    Last Post: December 3rd, 10:44 AM
  4. Newbie Newbie Needs Help with starting
    By Rick in forum PHP Development
    Replies: 5
    Last Post: December 17th, 11:20 PM
  5. COM Newbie Help
    By Damien Phillips in forum ASP Components
    Replies: 2
    Last Post: November 15th, 02:13 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139