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.
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.