Results 1 to 3 of 3

Thread: Using VB Script to access an MDB file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2007
    Location
    Somewhere else today
    Posts
    355

    Using VB Script to access an MDB file

    I am new to writing vbscript and I was wondering how I would access an MDB file displaying multiple lines on a web page.

    Can someone give me a skeleton script which I could manipulate to suit my own needs.

    Any help would be appreciated.

    Computerman

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    21

    Re: Using VB Script to access an MDB file

    Use ADO or OLEDB with the proper connectionstring
    http://www.connectionstrings.com/

    Code:
    Dim CN, RS, SQL
    Set CN = Server.CreateObject("ADODB.CONNECTION")
    Set RS = Server.CreateObject("ADODB.Recordset")
    SQL = "Select * from thetableyouwant where whatever = 5 order by whoknows desc"
    CN.Open ConnectionString
    RS.Open SQL,CN,adForwardOnly,adReadOnly
    While not RS.EOF
    response.write "<tr><td>" & RS.Fields(0) & "</td><tr>"
    RS.Movenext
    Wend
    RS.Close
    CN.Close
    Set CN = nothing
    Set RS = nothing

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2007
    Location
    Somewhere else today
    Posts
    355

    Re: Using VB Script to access an MDB file

    Many thanks, I will try that.

    Computerman

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