[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

VBScript and database

 Is it possible to use VBScript to query an access 97 file directly?  If I have the Access file in my Web directory, can I use VBScript to query information from it?  Or do I need an ODBC connection provided by my ISP provider?
0
critter017
Asked:
critter017
  • 2
  • 2
1 Solution
 
MasseyMCommented:
You can create a DSN-less connection...

Do this (3 files):
dsn.asp
----------
<%
      sDB = "database.mdb"
      sScriptDir = "./"
      sPath = Server.MapPath(sScriptDir) + "\"
      sDSN = "filedsn=" & sPath & "database.dsn;DefaultDir=" & sPath & ";DBQ=" & sPath & sDB & ";"
%>

database.dsn
--------------
[ODBC]
DRIVER=Microsoft Access Driver (*.mdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=512
ImplicitCommitSync=Yes
FIL=MS Access
DriverId=25


yourfile.asp
--------------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.OPen sDSN, "", ""
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open "SELECT * FROM Database_Table", Conn, 3, 3

etc...


0
 
critter017Author Commented:
I will try your suggestion.  If it works I will double the points and award them to you.
0
 
MasseyMCommented:
Thanks... If you need any more help, please email me at masseym@mrqcorp.com
0
 
critter017Author Commented:
Adjusted points to 200
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now