Rs.EOF evaluating true
Hi
I have a VBA macro in a spread sheet. This macro imports rows from a oracle databse to spread sheet. The same programme beheaves differently on 2 different Laptops.
1. IBM Thinkpad -- imports 14 rows from emp table.
OS - xp professional sp1
MS office 2000.
2. Dell Laptop -- imports 2 rows only
OS - xp professional sp2
MS office 2003.
Can any anybody suggest me why this difference and how to overcome
from this situation.
Ravi Nookala
# 2 Re: Rs.EOF evaluating true
Hi Paul
As required by you , below is the code.
The code works perfect on IBM Think pad whereas it fetches only 2 rows from DELL laptop database.
Ravindra Nookala
Rs.Open "select * from " & txtTname.Value & " where " & txtWhereColumn.Value & " " & Trim(txtWhereValue.Value), Cn, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
Rs.MoveFirst
While Not Rs.EOF
If Flag Then
DoEvents
v_WrittenRows = v_WrittenRows + 1
For v_FieldsCount = 0 To Rs.Fields.Count - 1
ActiveCell.Offset(i, v_FieldsCount) = Trim(Rs.Fields(v_FieldsCount).Value)
Next
Else
MsgBox " Import Process Terminated Successfully !!! ", vbInformation, "Data Import Process."
Call RsCnClose
Call Properties
Exit Sub
End If
Rs.MoveNext
lblCounter.Caption = "Rows Processed : " & v_WrittenRows
Wend
MsgBox v_WrittenRows & " Rows Imported Successfully !!!", vbInformation, "Data Import Process."
ActiveWorkbook.Save
Call RsCnClose
Exit Sub
Else
If chkFilter.Value = True Then
MsgBox "There Is No Data To Import." _
& vbCrLf & "Please Verify Whether The Table Is Empty " _
& vbCrLf & "Or Case Sencitivity Of Column Value." _
, vbInformation, "Data Import Process."
Else
MsgBox "There Is No Data To Import." _
& vbCrLf & "Please Verify Whether The Table Is Empty." _
, vbInformation, "Data Import Process."
End If
Call RsCnClose
Exit Sub
End If
# 7 Re: Rs.EOF evaluating true
Hi Paul .
This flag is set false when I press stop button to stop the process. So as long as the flag is ture, it will do the process.
Code is absolutely perfect. What I need to know why the difference with the laptops change only.
Ravindra Nookala.