|
-
Jul 2nd, 2009, 04:26 PM
#1
Thread Starter
Hyperactive Member
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
-
Jul 3rd, 2009, 04:15 AM
#2
Junior Member
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
-
Jul 3rd, 2009, 03:04 PM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|