Results 1 to 5 of 5

Thread: VBScript/Database/ASP

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    181

    VBScript/Database/ASP

    I'm basically a newcomer to ASP and I was wondering if I could do something like this
    Code:
    <%
       Dim DB as Database
       Dim RS as Recordset
    
       Set DB = "DBQ=/db/products.mdb;DRIVER={MS Access (*.mdb)}"
       
       For Each RS in DB
             Response.Write "<li>" & RS.Name
       Next RS
    
    %>
    Also, If I can't do this, can I at least go thru a table getting all of the data from one field and making a list from this?

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    yes you can do this,

    your can build a whole html page with asp!!

  3. #3
    CMangano
    Guest
    A couple of problems here.

    First, VBScript variables are variants. This means VBScript doesn't care if you put an integer, a string or whatever in there. So, doing:

    Code:
    Dim DB As Database
    will return an error. Instead, you would do:

    Code:
    Dim DB, RS
    You should also have a reference to the adovbs file by downloading it from:

    ADOVBS Article

    Lastly, you are missing quite a bit, such as your sql statement, your database, etc. To learn how to read in data from a database, go to:

    Connecting To DB

    There are also 2 links from here to other good articles.

    HTH.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    181
    I didn't think that code was gonna work

  5. #5
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    the code wont work,
    but what he wants to do will!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width