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.
 

Steve_

Board Regular
Joined
Apr 28, 2010
Messages
167
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?
 

rmagalhaes90

New Member
Joined
May 16, 2019
Messages
2
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.
 

Forum statistics

Threads
1,081,691
Messages
5,360,637
Members
400,591
Latest member
badgergurl

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top