Re: VB-Script Counts of Recordsets ADODB MS Access
- From: ralph <nt_consulting64@xxxxxxxxx>
- Date: Fri, 20 Jan 2012 10:21:47 -0600
On Fri, 20 Jan 2012 15:05:06 +0100, Uwe Wiards
<nospam@xxxxxxxxxxxxxxxx> wrote:
Hello,
i´m trying to read in VB-Script datas from a MS-Access database, but...
Into the table "Bestelldaten" are four test records, but .recordcount
told me "-1"
System: MS-XP and MS-Access 2002 SP3
Where are my mistakes?
SQL = "SELECT Bestelldaten.Nummer FROM Bestelldaten;"
strPfadDB = "c:\Testdb.mdb"
strConn = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" &
strPfadDB
Set Conn = CreateObject("ADODB.Connection")
Set Cmd = CreateObject("ADODB.Command")
conn.open strConn
cmd.ActiveConnection = conn
cmd.commandText=SQL
Set rs=CMD.Execute
If Not rs.EOF And Not rs.BOF Then
Msgbox "Count= " & rs.recordcount
Else
End If
Thanks an best regards
To amplify.
The value -1 means the RecordCount is not available at the moment you
asked.
This article gives a decent summary of the issues involved:
http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=33
hth
-ralph
.
- References:
- VB-Script Counts of Recordsets ADODB MS Access
- From: Uwe Wiards
- VB-Script Counts of Recordsets ADODB MS Access
- Prev by Date: Re: VB-Script Counts of Recordsets ADODB MS Access
- Next by Date: Re: VB-Script Counts of Recordsets ADODB MS Access
- Previous by thread: Re: VB-Script Counts of Recordsets ADODB MS Access
- Next by thread: Re: VB-Script Counts of Recordsets ADODB MS Access
- Index(es):
Relevant Pages
|