ADO connection with VBS to locally stored MS-Access database
From: Peter Wetschnigg (pwetsch_at_gmx.at)
Date: 02/25/05
- Next message: TA: "how to do an SQL statment using ADODC1"
- Previous message: Dave Anderson: "Re: Global.asa problems with IIS 6"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 22:59:44 +0100
Hello
I am trying to connect to a local Access database via ADO and VB Script.
The following code snippet is supposed to connect to a database and show
the number of records in table1 in a message box
----------------------------------------
<script type="text/vbscript">
Dim oRS
Dim oConn
Set oConn = CreateObject("ADODB.Connection")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=C:\MyDatabase.mdb;"
oRS.Open "Select * FROM table1", oConn
MsgBox oRs.RecordCount
oConn.Close
Set oConn = Nothing
</script>
----------------------------------------
But, when I load the html-document which contains this code into Iexplorer,
it crashes. :-( The database must have been opened, because a .ldb has been
created, which remains on the hard disk after the crash, but there still
must be a mistake in the oConn.Open statement. Could anyone give me an
advice?
Best regards,
Peter W.
- Next message: TA: "how to do an SQL statment using ADODC1"
- Previous message: Dave Anderson: "Re: Global.asa problems with IIS 6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|