Unix Technical Forum

Re: Informix OLEDB driver and "RecordCount" property

This is a discussion on Re: Informix OLEDB driver and "RecordCount" property within the Informix forums, part of the Database Server Software category; --> --0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE Content-type: multipart/alternative; Boundary="1__=09BBE4EDDFE621CE8f9e8a93df938690918c 09BBE4EDDFE621CE" --1__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable To retrieve the RecordCount property, you ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 10:12 PM
Kanchana Padmanabhan
 
Posts: n/a
Default Re: Informix OLEDB driver and "RecordCount" property


--0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE
Content-type: multipart/alternative;
Boundary="1__=09BBE4EDDFE621CE8f9e8a93df938690918c 09BBE4EDDFE621CE"

--1__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: quoted-printable






To retrieve the RecordCount property, you will have to set the CursorTy=
pe
to adOpenStatic.
A call to MoveLast or MoveFirst too will not be necessary then.

This should work for both Ole DB & ODBC.


Regards,
Kanchana Padmanabhan

Software Engineer
R&D - IBM Data Management Group
11200 Lakeview, Lenexa, KS 66219
Tel: 913 599 8674 t/l : 337 8674 Fax: 913 599 7260



=

Richard Spitz =

<Richard.Spitz@me =

d.uni-muenchen.de =
To
> informix-list@iiug.org =


Sent by: =
cc
owner-informix-li =

st@iiug.org Subj=
ect
Informix OLEDB driver and =

"RecordCount" property =

04/22/2004 03:35 =

AM =

=

=

Please respond to =

Richard Spitz =

=

=





Hi Informixers,

why is the "RecordCount" property of a recordset retrieved
via the Informix OLEDB driver always "-1"?

I'm using VisualBasic 6 and need the RecordCount property
for subsequent calculations. With the ODBC driver, I had
to use the "MoveLast" and "MoveFirst" methods before the
RecordCount was set correctly. This doesn't help any more
with OLEDB, it stays at "-1" even after a "MoveLast".

In production, I'm still at CSDK 2.70, but even the
ifxoledbc.dll from the newest CSDK 2.81.TC3 didn't change
this.

Regards, Richard
--
+-------------------------------+-------------------------------+
| Dr. med Richard Spitz | Tel : +49-89-7095-6110
|
| Klinik f=FCr Anaesthesiologie | FAX : +49-89-7095-6420 =
|
| Klinikum der Univ. M=FCnchen | Page: +49-89-7095-789-2116 =
|
| 81366 M=FCnchen, Germany |
|
+-------------------------------+-------------------------------+
=

--1__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE
Content-type: text/html; charset=ISO-8859-1
Content-Disposition: inline
Content-transfer-encoding: quoted-printable

<html><body>
<p>To retrieve the RecordCount property, you will have to set the Curso=
rType to adOpenStatic.<br>
A call to MoveLast or MoveFirst too will not be necessary then.<br>
<br>
This should work for both Ole DB &amp; ODBC.<br>
<br>
<br>
Regards,<br>
Kanchana Padmanabhan<br>
<br>
Software Engineer<br>
R&amp;D - IBM Data Management Group<br>
11200 Lakeview, Lenexa, KS 66219<br>
Tel: 913 599 8674 t/l : 337 8674 Fax: 913 599 7260 <br>
<br>
<img src=3D"cid:10__=3D09BBE4EDDFE621CE8f9e8a93df938@us .ibm.com" width=3D=
"16" height=3D"16" alt=3D"Inactive hide details for Richard Spitz &lt;R=
ichard.Spitz@med.uni-muenchen.de&gt;">Richard Spitz &lt;Richard.Spitz@m=
ed.uni-muenchen.de&gt;<br>
<br>
<br>

<table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">=

<tr valign=3D"top"><td style=3D"background-image:url(cid:20__=3D09BBE4E=
DDFE621CE8f9e8a93df938@us.ibm.com); background-repeat: no-repeat; " wid=
th=3D"40%">
<ul>
<ul>
<ul>
<ul><b><font size=3D"2">Richard Spitz &lt;Richard.Spitz@med.uni-muenche=
n.de&gt;</font></b><font size=3D"2"> </font><br>
<font size=3D"2">Sent by: owner-informix-list@iiug.org</font>
<p><font size=3D"2">04/22/2004 03:35 AM</font>
<table border=3D"1">
<tr valign=3D"top"><td width=3D"168" bgcolor=3D"#FFFFFF"><div align=3D"=
center"><font size=3D"2">Please respond to<br>
Richard Spitz</font></div></td></tr>
</table>
</ul>
</ul>
</ul>
</ul>
</td><td width=3D"60%">
<table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">=

<tr valign=3D"top"><td width=3D"1%" valign=3D"middle"><img src=3D"cid:3=
0__=3D09BBE4EDDFE621CE8f9e8a93df938@us.ibm.com" border=3D"0" height=3D"=
1" width=3D"58" alt=3D""><br>
<div align=3D"right"><font size=3D"2">To</font></div></td><td width=3D"=
100%"><img src=3D"cid:30__=3D09BBE4EDDFE621CE8f9e8a93df938@us .ibm.com" =
border=3D"0" height=3D"1" width=3D"1" alt=3D""><br>
<font size=3D"2">informix-list@iiug.org</font></td></tr>

<tr valign=3D"top"><td width=3D"1%" valign=3D"middle"><img src=3D"cid:3=
0__=3D09BBE4EDDFE621CE8f9e8a93df938@us.ibm.com" border=3D"0" height=3D"=
1" width=3D"58" alt=3D""><br>
<div align=3D"right"><font size=3D"2">cc</font></div></td><td width=3D"=
100%"><img src=3D"cid:30__=3D09BBE4EDDFE621CE8f9e8a93df938@us .ibm.com" =
border=3D"0" height=3D"1" width=3D"1" alt=3D""><br>
</td></tr>

<tr valign=3D"top"><td width=3D"1%" valign=3D"middle"><img src=3D"cid:3=
0__=3D09BBE4EDDFE621CE8f9e8a93df938@us.ibm.com" border=3D"0" height=3D"=
1" width=3D"58" alt=3D""><br>
<div align=3D"right"><font size=3D"2">Subject</font></div></td><td widt=
h=3D"100%"><img src=3D"cid:30__=3D09BBE4EDDFE621CE8f9e8a93df938@us .ibm.=
com" border=3D"0" height=3D"1" width=3D"1" alt=3D""><br>
<font size=3D"2">Informix OLEDB driver and &quot;RecordCount&quot; prop=
erty</font></td></tr>
</table>

<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0">
<tr valign=3D"top"><td width=3D"58"><img src=3D"cid:30__=3D09BBE4EDDFE6=
21CE8f9e8a93df938@us.ibm.com" border=3D"0" height=3D"1" width=3D"1" alt=
=3D""></td><td width=3D"336"><img src=3D"cid:30__=3D09BBE4EDDFE621CE8f9=
e8a93df938@us.ibm.com" border=3D"0" height=3D"1" width=3D"1" alt=3D""><=
/td></tr>
</table>
</td></tr>
</table>
<br>
<tt>Hi Informixers,<br>
<br>
why is the &quot;RecordCount&quot; property of a recordset retrieved<br=
>

via the Informix OLEDB driver always &quot;-1&quot;?<br>
<br>
I'm using VisualBasic 6 and need the RecordCount property<br>
for subsequent calculations. With the ODBC driver, I had<br>
to use the &quot;MoveLast&quot; and &quot;MoveFirst&quot; methods befor=
e the<br>
RecordCount was set correctly. This doesn't help any more<br>
with OLEDB, it stays at &quot;-1&quot; even after a &quot;MoveLast&quot=
;.<br>
<br>
In production, I'm still at CSDK 2.70, but even the <br>
ifxoledbc.dll from the newest CSDK 2.81.TC3 didn't change<br>
this.<br>
<br>
Regards, Richard<br>
-- <br>
+-------------------------------+-------------------------------+<br>
| Dr. med Richard Spitz | Tel : +49-89-7095-6110 |<br>
| Klinik f=FCr Anaesthesiologie | FAX : +49-89-7095-6420 |<br>
| Klinikum der Univ. M=FCnchen | Page: +49-89-7095-789-2116 |<br>
| 81366 M=FCnchen, Germany | |<br>
+-------------------------------+-------------------------------+<br>
</tt><br>
</body></html>=


--1__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE--


--0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE
Content-type: image/gif;
name="graycol.gif"
Content-Disposition: inline; filename="graycol.gif"
Content-ID: <10__=09BBE4EDDFE621CE8f9e8a93df938@us.ibm.com>
Content-transfer-encoding: base64

R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu
ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYX J0U2F2ZXIhAAA7

--0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE
Content-type: image/gif;
name="pic26994.gif"
Content-Disposition: inline; filename="pic26994.gif"
Content-ID: <20__=09BBE4EDDFE621CE8f9e8a93df938@us.ibm.com>
Content-transfer-encoding: base64

R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA
AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh
EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZe ZgLVA9YVCpnGagVjV171aRVrYR
RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFil KQdI8GA5IcpApeJQt8L09lmgkH
LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d 5VyKtCKW3jfz4uMKmq3xu4N0nK
BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI
TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZl qWmyFy5/6yBBuji0AxFR
M00oQAqNIstqI6qKHUsWRAEAvagsmfUEAImyxgbmUpJk3IklNU tJOUAVLoUr1+wqDGTE4zk+T6FG
uQb3SizBCwatiiUgCBN8vrz+zFjVyQ8FWkOlg4NQiZMB5QS8QO 3mpOaKnL0Z2EKvNMSILEThKhCg
zMKPVxYJh23qm9KNW7pArPynMqZDiErsTMqI+LRi3QAgkFUbXp uFKhSYZALd0O5RKa2z9EYKBbpb
qxIKsjUPRgD7I2XYV6wyrOw92ykExP8NW4URhknC5dKGE4v4NE NQj2jXjmfNgOZDaXb5glRmXQ33
YEWQYNcZFnrYcIQLNzyTFDQNkXIff0ExVlY4srziQk43inZgL4 rwxxINMvpFFAz1KOODHiu+4aEw
NEjFl5B3JIKWKF3k6I9bfUGp5ZZcdunll5IA4cuHvQQJ5gcsoC WOOUwgltIwAKRxJgbIkJAQZEq0
2YliZnpZZ4BH3CnYOXldOUOfQoYDqF1LFHbXCrO8xmRsfoXDXJ 6ChjCAH3QlhJcT6VWE6FCkfCco
CgrMFsROrIEX3o2whVjWDjoJccN3LdggSGXLCdLEgHr1lyU3O3 QxhgohNKXJCWv8JQr/PDdaqd6w
2rj1inLiGeiCJoDspAoQlYE6QWLSECehcWIYxIQES6zhbn1iIm THEQyqJ4eIxJJoUBc+3CbBuwZE
V5cJPPkIjFDdeEabQbd6WgICTxiiz0f5dBKquXF6k4senwEhYG nKEFJeGrxUZy8dB8gmAXI/sPvH
ESfCwVt5hTgYiqQqtdRNHQIU1PJ33ZqmzgE90OwLaoJcnMop1W iMmgkPHQRIrwgFuNV90A3doNKT
mrKIN07AnGcI9BQjhCBN4RfA1qIZnMqorJCogKfGQnxSCDilTV IA0yl5ciTovgLuBDKFUDE9aQcw
9SA+rjSNf9/M1gxrj6VwDTS0IUSElMzBfsj0NFXR2kwsV1A5IF1grLgLL/r1R40BZEnuBWgmQEyb
jqRwSAt6bqMCOFkvKFN2GPPkUzIm/SCF8z8pVzpbjVnMsy0vOr1hw3SaSRUhpY09v0z0J1FnwzPl
fmh+xl4WtR0zGu24I4KbMQm3lnVu2oNWxI9W/lcyzA+mCKF4DBikxb/+UWtOGRiFP8qEwAayIgIA
Ow==

--0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE
Content-type: image/gif;
name="ecblank.gif"
Content-Disposition: inline; filename="ecblank.gif"
Content-ID: <30__=09BBE4EDDFE621CE8f9e8a93df938@us.ibm.com>
Content-transfer-encoding: base64

R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAQAAEAAAIEjI8ZBQA7

--0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDF E621CE--

sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 10:12 PM
Richard Spitz
 
Posts: n/a
Default Re: Informix OLEDB driver and "RecordCount" property

Kanchana Padmanabhan <kanchana@us.ibm.com> wrote:

>To retrieve the RecordCount property, you will have to set the CursorType
>to adOpenStatic.
>A call to MoveLast or MoveFirst too will not be necessary then.
>
>This should work for both Ole DB & ODBC.


It doesn't work for the OLEDB driver from CSDK 2.70 (ifxoledbc.dll
version 2.50.0.11061 from Nov. 26, 2001). This is what I'm doing
in my Visual Basic 6 program:

Dim cn_urlaub As New ADODB.Connection
Dim rs_quartal As New ADODB.Recordset

With cn_urlaub
.ConnectionString ="Provider=Ifxoledbc;Password=passwd;
PersistSecurity Info=True;User ID=userid;
Data Source=verteiler@opserver;Extended Properties='';
Connect Timeout=10"
.ConnectionTimeout = 10
.Open
End With

SQL = "<SQL statement here>"
rs_quartal.Open SQL, cn_urlaub, adOpenStatic, adLockReadOnly, adCmdText

After that, rs_quartal.RecordCount is "-1".

I also tried substituting the ifxoledbc.dll from CSDK 2.81TC3
(version 2.81.0.11811 from Dec. 14, 2003) for the old DLL, but
that didn't make any difference.

Regards, Richard
--
+-------------------------------+-------------------------------+
| Dr. med Richard Spitz | Tel : +49-89-7095-6110 |
| Klinik für Anaesthesiologie | FAX : +49-89-7095-6420 |
| Klinikum der Univ. München | Page: +49-89-7095-789-2116 |
| 81366 München, Germany | |
+-------------------------------+-------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 10:13 PM
Slawomir Lobaza
 
Posts: n/a
Default Re: Informix OLEDB driver and "RecordCount" property

Set CursorLocation = adUseClient

Example:

Dim cn_urlaub As New ADODB.Connection
Dim rs_quartal As New ADODB.Recordset

With cn_urlaub

.CursorLocation = adUseClient

.ConnectionString ="Provider=Ifxoledbc;Password=passwd;
PersistSecurity Info=True;User ID=userid;
Data Source=verteiler@opserver;Extended Properties='';
Connect Timeout=10"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 10:13 PM
Richard Spitz
 
Posts: n/a
Default Re: Informix OLEDB driver and "RecordCount" property

"Slawomir Lobaza" <slawekl@bsi.bytom.pl> wrote:

>Set CursorLocation = adUseClient
>
>Example:
>
> Dim cn_urlaub As New ADODB.Connection
> Dim rs_quartal As New ADODB.Recordset
>
> With cn_urlaub
>
> .CursorLocation = adUseClient

Thanks for your suggestion, but unfortunately that didn't help
either. Now no data are returned, and when I try to access the
rs_quartal.RecordCount property, I get an error message about
NULL not allowed.

Regards, Richard
--
+-------------------------------+-------------------------------+
| Dr. med Richard Spitz | Tel : +49-89-7095-6110 |
| Klinik für Anaesthesiologie | FAX : +49-89-7095-6420 |
| Klinikum der Univ. München | Page: +49-89-7095-789-2116 |
| 81366 München, Germany | |
+-------------------------------+-------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


All times are GMT. The time now is 10:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com