LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA excel - problem with having clause in sql with adodb.connection/recordset


Hi

i need a help on the following error

i am getting error in VBA excel when i am using having clause in the
sql.
i used adodb.connection and adodb.recordset.

my problem is, i need to check duplicates in the oracle table.
so i used the sql statement as follows

select count(*) from table-1
having count(*) 1
group by field-1,field-2,field-3.

and string the count in a variable.

var-1 = rs.fields(0).

when i execute that i am getting error as runtime error : 3021
and here is the description

" Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires current record"

here is my code

strsql = "select name,product,product_number,begin_date,end_date from
product_lisence_info" _
& " having count(*) 1 " _
& " group by
name,product,product_number,begin_date,end_date "


rs1.Open strsql, con1, adOpenKeyset

dupli = rs1.Fields(0)


rs1.close


thanks

Kiran


--
ukp9999
------------------------------------------------------------------------
ukp9999's Profile: http://www.excelforum.com/member.php...o&userid=28853
View this thread: http://www.excelforum.com/showthread...hreadid=486019

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB Connection Problem alpder Excel Programming 3 November 4th 05 09:28 PM
problem using isnull() to check a value in ADODB.Recordset tilmP Excel Programming 0 January 18th 05 07:42 AM
share adodb connection in excel Marek Excel Programming 3 September 7th 04 08:56 AM
ADODB Recordset problem Stefen Percoco Excel Programming 2 July 26th 04 06:31 PM
adodb.recordset with excel nate axtell Excel Programming 14 June 11th 04 01:32 PM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"