Re: Informix OLEDB driver and "RecordCount" property
Posted in 2004
Topics: Connectivity: ODBC / JDBC / .NET
--0__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDFE621CE Content-type: multipart/alternative; Boundary="1__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDFE621CE" --1__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDFE621CE 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__=09BBE4EDDFE621CE8f9e8a93df938690918c09BBE4EDDFE621CE 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 & ODBC.<br> <br> <br> Regards,<br> Kanchana Padmanabhan<br> <br> Software Engineer<br> R&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 <R= ichard.Spitz@med.uni-muenchen.de>">Richard Spitz <Richard.Spitz@m= ed.uni-muenchen.de><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 <Richard.Spitz@med.uni-muenche= n.de></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 "RecordCount" 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@@DQ@
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 | | +-------------------------------+-------------------------------+
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" . . . Uzytkownik "Richard Spitz" <Richard.Spitz@med.uni-muenchen.de> napisal w wiadomosci news:56dh80t5buurf1teaqgfa01pho4od01lj4@4ax.com... > 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 | | > +-------------------------------+-------------------------------+