How to use adodb.recordset object in access2000? 
Author Message
 How to use adodb.recordset object in access2000?

Hi:
    I use adodb.recordset object in my program ,like so :
Private Sub Command1_Click()
Dim i As Integer
Dim rs As New ADODB.Recordset
Dim strsql As String
    strsql = "select IPSS,QOL from InputProstata "

    If Not (con.State = adStateOpen) Then
        con.Open
    End If
     Set rs = con.Execute(strsql)
    With MSChart1
   .RowCount = rs.RecordCount
    For i = 1 To rs.RecordCount
    .Row = i
    .Data = rs.Fields(1).Value
    .RowLabel = rs.Fields(0).Value
    rs.MoveNext
    Next i
    End With
  Set rs = Nothing
End Sub

I  use access 2000 for database ,When I run ,the "rs.recordcound " is error
,How to resolve the problem ?
    thank you in advance !



Tue, 25 May 2004 15:31:03 GMT  
 How to use adodb.recordset object in access2000?
Hi Jack,

Rather than using the Recordcount, a more efficient way
would be to detect the end of recordset.

Replace

Quote:
>    For i = 1 To rs.RecordCount
With
>    Do While Not rs.eof

-- Rest of your code here

Quote:
>    Loop

Hope this helps

Mark Sippitt MIAP

Quote:
>-----Original Message-----
>Hi:
>    I use adodb.recordset object in my program ,like so :
>Private Sub Command1_Click()
>Dim i As Integer
>Dim rs As New ADODB.Recordset
>Dim strsql As String
>    strsql = "select IPSS,QOL from InputProstata "

>    If Not (con.State = adStateOpen) Then
>        con.Open
>    End If
>     Set rs = con.Execute(strsql)
>    With MSChart1
>   .RowCount = rs.RecordCount
>    For i = 1 To rs.RecordCount
>    .Row = i
>    .Data = rs.Fields(1).Value
>    .RowLabel = rs.Fields(0).Value
>    rs.MoveNext
>    Next i
>    End With
>  Set rs = Nothing
>End Sub

>I  use access 2000 for database ,When I

run ,the "rs.recordcound " is error

- Show quoted text -

Quote:
>,How to resolve the problem ?
>    thank you in advance !

>.



Tue, 25 May 2004 20:02:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Question on Problem encountered w/ using ADODC DataControl.Recordset Property w/ ADODB.Recordset objects

2. Question on Problem encountered w/ using ADODC DataControl.Recordset Property w/ ADODB.Recordset objects

3. Recordset error Access2000 ADODB

4. return a ADODB::RecordSet from an ATL object

5. Feedback from a adodb.recordset object during query generation

6. object <-> adodb.recordset

7. Collection of ADODB.Recordset objects

8. Seek method not found for my ADODB.Recordset object

9. ADODB.Connection and ADODB.Recordset question

10. ADODB.Connection.Execute VS ADODB.Recordset.Update

11. Creating adodb.record from Adodb.recordset

 

 
Powered by phpBB® Forum Software