ADO Recordset empty on Office 2016 64bit (excel)

rmagalhaes90

New Member
Joined
May 16, 2019
Messages
2
Hi All,

Thanks in Advance

I am having issues with a script that I am trying to run, when I run a simple query it prints out the result but when I query any table on the DB it does show anything and prompts me an error. I ran both queries on PL/SQL and got the correct results, any ideas why it is happening?

Simple query that I have mentioned that works:
==============================================================
' TxtQuery1 Give recordset rows


TxtQuery1 = "select 1 as A, 2 as B, 3 as from dual union select 4 as A,5 as B,6 as C from dual union select 7 as A,8 as B, 9 as C from dual"
===========================================================


"Either EF is True, or the current record as been deleted.

Requested Operation requires a current record"

It works on Excel 32bit but we have to upgrade our clients to 64bit.

Maybe it gives some light:

Microsoft ActiveX Data Objects 6.1 Library

Oracle client 18.0.0.0 64bit



Thanks.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi All,

Thanks in Advance

I am having issues with a script that I am trying to run, when I run a simple query it prints out the result but when I query any table on the DB it does show anything and prompts me an error. I ran both queries on PL/SQL and got the correct results, any ideas why it is happening?

Simple query that I have mentioned that works:
==============================================================
' TxtQuery1 Give recordset rows


TxtQuery1 = "select 1 as A, 2 as B, 3 as from dual union select 4 as A,5 as B,6 as C from dual union select 7 as A,8 as B, 9 as C from dual"
===========================================================


"Either EF is True, or the current record as been deleted.

Requested Operation requires a current record"

It works on Excel 32bit but we have to upgrade our clients to 64bit.

Maybe it gives some light:

Microsoft ActiveX Data Objects 6.1 Library

Oracle client 18.0.0.0 64bit



Thanks.


"select 1 as A, 2 as B, 3 as from...

3 as what?
 
Upvote 0
Hi Steve,

Sorry for the delay, please see below an example that I had mentioned.

Code:
=========================================================================
Public Conn As New ADODB.Connection
Public RS As New ADODB.Recordset
 
UserNamePROD = "Scott"
PasswordPROD = "tiger"
SID = "ABCDEFDB"
 
 
ConnParam = "Provider=OraOLEDB.oracle;" & _
                  "Data Source=" & SID & ";" & _
                  "User ID=" & UserNamePROD & ";" & _
                  "Password=" & PasswordPROD & ";"
 
 
Conn.Open ConnParam
 
 
 
' TxtQuery1 Give recordset rows
TxtQuery1 = "select 1 as A ,2 as B,3 as C from dual union select 4 as A ,5 as B,6 as C  from dual union  select 7 as A ,8 as B,9 as C  from dual"
 
 
' TxtQuery2  DON'T Give recordset rows and the query is corret
TxtQuery2  = "Select * from Employees where Employess_name = 'Scott' "
 
 
RS.Open TxtQuery1, Conn, adOpenStatic, adLockReadOnly
'RS.Open TxtQuery2, Conn, adOpenStatic, adLockReadOnly
 
 
 RSOutput = RS.GetRows()
 
=========================================================================
IF  TxtQuery1 returns records
 
 
IF TxtQuery 2 Messagge :
 
Run-time error '3021':
 
EitherBOFor EOF is True, or the current record has been deleted.
Requested Operation requires a current record.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top