ADO Recordset and Informix
Posted in 1999
Topics: Stored Procedures & SPL, Third-Party Tools & Monitoring
I'm having a problem returning decimal datatypes from an Informix Database (SE 5.06.UC1) to an ADO recordset. Fields defined in the Informix Database are dropping 0. For example if the value in the table as 1000 I get back 1, 980 I get back 98, 981 I get back 981 correctly. Values with a decimal also come back fine (980.1 returns 980.1) I'm displaying the recordset.field.value in a message box immediately after execution so I know the value in the recordset is wrong. If I change the Datebase field to an integer or a Float it works great!! Any suggestions would be greatly appreciated.
What ODBC driver are you using??? Tim Del Bosco wrote in message <01befec1$073f8860$361f70ce@tdbpc>... >I'm having a problem returning decimal datatypes from an Informix Database >(SE 5.06.UC1) to an ADO recordset. > >Fields defined in the Informix Database are dropping 0. For example if the >value in the table as 1000 I get back 1, 980 I get back 98, 981 I get back >981 correctly. Values with a decimal also come back fine (980.1 returns >980.1) > >I'm displaying the recordset.field.value in a message box immediately after >execution so I know the value in the recordset is wrong. > >If I change the Datebase field to an integer or a Float it works great!! > >Any suggestions would be greatly appreciated.
I'm using Intersolv 3.11 32-BIT Informix 9 Chris Dornsife <chrisdornsife@yahoo.com> wrote in article <nAwD3.2$x43.101@news.ais.net>... > What ODBC driver are you using??? > > > Tim Del Bosco wrote in message <01befec1$073f8860$361f70ce@tdbpc>... > >I'm having a problem returning decimal datatypes from an Informix Database > >(SE 5.06.UC1) to an ADO recordset. > > > >Fields defined in the Informix Database are dropping 0. For example if the > >value in the table as 1000 I get back 1, 980 I get back 98, 981 I get back > >981 correctly. Values with a decimal also come back fine (980.1 returns > >980.1) > > > >I'm displaying the recordset.field.value in a message box immediately after > >execution so I know the value in the recordset is wrong. > > > >If I change the Datebase field to an integer or a Float it works great!! > > > >Any suggestions would be greatly appreciated. > > >
Intersolv drivers do things to the date type so it wouldnt surprise me if they do something to decimals too. Example: 12/01/1999 is changed to 12/1/99 I have not figured out if there is some sort of a ini file so you can set the ODBC drivers behavior. One solution would be cast it to a char, then cast it to a deecimal after you retrieve the value from the driver.: (If your using ASP) SqlString = "select decCol::char(16) decCol from wherever" RS.Open SqlString, adoConn If Not RS.EOF Then ' Convert String To Decimal MyLocalDecVar = CDbl(RS("decCol")) End If Also, you can post to intersolvs newsgroups, they have a news server that their techies browse. news.intersolv.com Good luck. Tim Del Bosco wrote in message <01beffbc$ddebb860$361f70ce@tdbpc>... >I'm using Intersolv 3.11 32-BIT Informix 9 > >Chris Dornsife <chrisdornsife@yahoo.com> wrote in article ><nAwD3.2$x43.101@news.ais.net>... >> What ODBC driver are you using??? >> >> >> Tim Del Bosco wrote in message <01befec1$073f8860$361f70ce@tdbpc>... >> >I'm having a problem returning decimal datatypes from an Informix >Database >> >(SE 5.06.UC1) to an ADO recordset. >> > >> >Fields defined in the Informix Database are dropping 0. For example if >the >> >value in the table as 1000 I get back 1, 980 I get back 98, 981 I get >back >> >981 correctly. Values with a decimal also come back fine (980.1 returns >> >980.1) >> > >> >I'm displaying the recordset.field.value in a message box immediately >after >> >execution so I know the value in the recordset is wrong. >> > >> >If I change the Datebase field to an integer or a Float it works great!! >> > >> >Any suggestions would be greatly appreciated. >> >> >>
Thanks for the advice..... Chris Dornsife <chrisdornsife@yahoo.com> wrote in article <eX9E3.3$t%5.65@news.ais.net>... > Intersolv drivers do things to the date type so it wouldnt surprise me if > they do something to decimals too. > Example: > 12/01/1999 is changed to 12/1/99 > > I have not figured out if there is some sort of a ini file so you can set > the ODBC drivers behavior. > > One solution would be cast it to a char, then cast it to a deecimal after > you retrieve the value from the driver.: > > (If your using ASP) > > SqlString = "select decCol::char(16) decCol from wherever" > > RS.Open SqlString, adoConn > > If Not RS.EOF Then > ' Convert String To Decimal > MyLocalDecVar = CDbl(RS("decCol")) > > End If > > Also, you can post to intersolvs newsgroups, they have a news server that > their techies browse. > news.intersolv.com > > Good luck. > > > > > > > > > > Tim Del Bosco wrote in message <01beffbc$ddebb860$361f70ce@tdbpc>... > >I'm using Intersolv 3.11 32-BIT Informix 9 > > > >Chris Dornsife <chrisdornsife@yahoo.com> wrote in article > ><nAwD3.2$x43.101@news.ais.net>... > >> What ODBC driver are you using??? > >> > >> > >> Tim Del Bosco wrote in message <01befec1$073f8860$361f70ce@tdbpc>... > >> >I'm having a problem returning decimal datatypes from an Informix > >Database > >> >(SE 5.06.UC1) to an ADO recordset. > >> > > >> >Fields defined in the Informix Database are dropping 0. For example if > >the > >> >value in the table as 1000 I get back 1, 980 I get back 98, 981 I get > >back > >> >981 correctly. Values with a decimal also come back fine (980.1 returns > >> >980.1) > >> > > >> >I'm displaying the recordset.field.value in a message box immediately > >after > >> >execution so I know the value in the recordset is wrong. > >> > > >> >If I change the Datebase field to an integer or a Float it works great!! > >> > > >> >Any suggestions would be greatly appreciated. > >> > >> > >> > > >
Tim, I have had the same problem on my box after Office 97 SR2 was pushed. I haven't figured out which DLL it is screwing up, but after re-installing Intersolv's ODBC and Informix IConnect the problem goes away. I hope this helps. Mike Lester USAA Investment Management Company On Fri, 17 Sep 1999, Tim Del Bosco wrote: > Thanks for the advice..... > > Chris Dornsife <chrisdornsife@yahoo.com> wrote in article > <eX9E3.3$t%5.65@news.ais.net>... > > Intersolv drivers do things to the date type so it wouldnt surprise me if > > they do something to decimals too. > > Example: > > 12/01/1999 is changed to 12/1/99 > > > > I have not figured out if there is some sort of a ini file so you can set > > the ODBC drivers behavior. > > > > One solution would be cast it to a char, then cast it to a deecimal after > > you retrieve the value from the driver.: > > > > (If your using ASP) > > > > SqlString = "select decCol::char(16) decCol from wherever" > > > > RS.Open SqlString, adoConn > > > > If Not RS.EOF Then > > ' Convert String To Decimal > > MyLocalDecVar = CDbl(RS("decCol")) > > > > End If > > > > Also, you can post to intersolvs newsgroups, they have a news server that > > their techies browse. > > news.intersolv.com > > > > Good luck. > > > > > > > > > > > > > > > > > > > > Tim Del Bosco wrote in message <01beffbc$ddebb860$361f70ce@tdbpc>... > > >I'm using Intersolv 3.11 32-BIT Informix 9 > > > > > >Chris Dornsife <chrisdornsife@yahoo.com> wrote in article > > ><nAwD3.2$x43.101@news.ais.net>... > > >> What ODBC driver are you using??? > > >> > > >> > > >> Tim Del Bosco wrote in message <01befec1$073f8860$361f70ce@tdbpc>... > > >> >I'm having a problem returning decimal datatypes from an Informix > > >Database > > >> >(SE 5.06.UC1) to an ADO recordset. > > >> > > > >> >Fields defined in the Informix Database are dropping 0. For example > if > > >the > > >> >value in the table as 1000 I get back 1, 980 I get back 98, 981 I get > > >back > > >> >981 correctly. Values with a decimal also come back fine (980.1 > returns > > >> >980.1) > > >> > > > >> >I'm displaying the recordset.field.value in a message box immediately > > >after > > >> >execution so I know the value in the recordset is wrong. > > >> > > > >> >If I change the Datebase field to an integer or a Float it works > great!! > > >> > > > >> >Any suggestions would be greatly appreciated. > > >> > > >> > > >> > > > > > > > >