Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

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
[543 byte] By [ravinookala] at [2007-11-11 8:46:42]
# 1 Re: Rs.EOF evaluating true
We would need a bit more information, such as the PL/SQL query or stored procedure that you are using plus any code that might be filtering out the data.
pclement at 2007-11-11 17:25:02 >
# 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
ravinookala at 2007-11-11 17:26:02 >
# 3 Re: Rs.EOF evaluating true
I don't see anything out of the ordinary. Are both laptops accessing the same Oracle database? Same table?
pclement at 2007-11-11 17:27:11 >
# 4 Re: Rs.EOF evaluating true
Hi Paul

It is oracle's default emp table. I do not see any problem with my code at all.
This is the strange thing I am seeing for the first time.

Ravindra Nookala
ravinookala at 2007-11-11 17:28:05 >
# 5 Re: Rs.EOF evaluating true
Hi Paul

The databases are on Thinkpad : 9i and on Dell : 10g. There are local databases on the laptops. I boserve that it is doing only 2 rows from any table from any database when using dell laptop. Strange.

Ravindra Nookala
ravinookala at 2007-11-11 17:29:12 >
# 6 Re: Rs.EOF evaluating true
The only query I have is that you use the following line of code:

If Flag Then ...

Where is flag defined and set?
xnemsis at 2007-11-11 17:30:11 >
# 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.
ravinookala at 2007-11-11 17:31:15 >
# 8 Re: Rs.EOF evaluating true
Have you tried running your query through SQL Plus or another Oracle tool to verify that the data is the same on both computers?
pclement at 2007-11-11 17:32:06 >
# 9 Re: Rs.EOF evaluating true
Hi Paul

The issue is solved. I have changed the ODBC driver from oracle supplied one to Microsoft supplied one. This works fine.

Thank you very much for your help.

Ravindra Nookala
ravinookala at 2007-11-11 17:33:14 >