Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Records

Status
Not open for further replies.

papakula

Programmer
Aug 21, 2001
33
GB
Hi!
I am trying to write a dll which helps me to display records one by one when I click on button called next
In dll I have this code.


Private Sub Class_Initialize()
Set cn = New ADODB.Connection
cn.Open "dsn=dsnRA;Uid=sa;Pwd=art"
rs.Open "cust", cn
End Sub

public sub movenext()
On Error Resume Next
customerId = rs.Fields(0)
cname = rs.Fields(1)
cadd = rs.Fields(2)
rs.movenext
If rs.EOF Then
rs.MoveLast
Exit Sub
end sub

Now I had created a new form and placed a button and called this procedure as
obj.movenext
Text1 = obj.customerId
Text2 = obj.cname
Text3 = obj.cadd

Now my problem is I am able to view all the records when i keep pressing the next button... but I unable to view the last record of my table..
what is the error in my application..
Please let me know. Many thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top