Thursday, March 29, 2012

EOF Issue

I am trying to write data to a recordset and it doesn't write to the last record. Here is my code:

Set rs = New ADODB.Recordset
rs.Open sql, conn, 1, 2
With rs
j = 0
Do While Not rs.EOF
rs(0).Value = j
j = j + 1
.Update
.MoveNext
Loop
End With
Set rs = Nothing

I think the problem is my eof setting but I don't know how to adjust that in code since I am not using an adodc. If that is my problem then can I get the code snippet, please?

Otherwise, what is my problem?

Thanks!Have you referred to any VB forums, as I can see most of the SQL database related questions. Try it and see.sql

No comments:

Post a Comment