Results 1 to 2 of 2

Thread: Databases With ASP & VBscript

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    india , maharashtra
    Posts
    9

    Post

    How to use access database within the web directory when you dont have dsn setup on the server

    Can anybody tell me or direct me to some link

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    I'm not sure if this is what you're looking for, but here it is.

    Code:
    dim cn
    dim rs
    
    set cn = Server.CreateObject("ADODB.Connection")
    
    cn.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=relativepath\MyDb.mdb"
    
    set rs = cn.execute("Select * from MyTable",,1)
    
    do until rs.eof = true
        response.write rs.fields(0).value & "<BR>"
        rs.movenext
    loop
    
    cn.close
    set cn = nothing
    set rs = nothing

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