Re: ADO connection with VBS to locally stored MS-Access database
From: Val Mazur (group51a_at_hotmail.com)
Date: 02/28/05
- Next message: Val Mazur: "Re: How works MaxRecords attribut ?"
- Previous message: Val Mazur: "Re: Unicode and CSV files"
- Maybe in reply to: Stephen Howe: "Re: ADO connection with VBS to locally stored MS-Access database"
- Next in thread: Stephen Howe: "Re: ADO connection with VBS to locally stored MS-Access database"
- Reply: Stephen Howe: "Re: ADO connection with VBS to locally stored MS-Access database"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 28 Feb 2005 18:49:50 -0500
Hi,
Even using of the OLEDB Jet provider is better, I do not see any confusion
here. You could use ODBC or OLEDB syntax but in this case ADO will using
different providers to accomplish the task. If you are using ODBC syntax,
then ADO will use OLEDB for ODBC provider. I would suspect it could be some
issue related to the security when application does not have permissions to
work with the database file from ASP environment. I would suggest to try to
put some messages for the tracing and check actual error message for the Err
object to see what is going on here.
-- Val Mazur Microsoft MVP http://xport.mvps.org "Peter Wetschnigg" <pwetsch@gmx.at> wrote in message news:n9858sqjvj5$.1gjb9bqi4edgg.dlg@40tude.net... > 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: Val Mazur: "Re: How works MaxRecords attribut ?"
- Previous message: Val Mazur: "Re: Unicode and CSV files"
- Maybe in reply to: Stephen Howe: "Re: ADO connection with VBS to locally stored MS-Access database"
- Next in thread: Stephen Howe: "Re: ADO connection with VBS to locally stored MS-Access database"
- Reply: Stephen Howe: "Re: ADO connection with VBS to locally stored MS-Access database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading