ADO V's ODBC Data types and formatting

From: John F (JohnFrizelle_at_hotmail.com)
Date: 10/14/04


Date: 14 Oct 2004 01:56:35 -0700

Hi,
I am replacing a VB5 application that handles database communication
directly through ODBC API calls with a VB5 application that uses ADO
to handle database communication.

The back end database is SQL Server 7.

I am having some issues with mapping the data types returned by ODBC
to the data types returned by ADO and am wondering is it possible to
get ADO to return the ODBC data type.

E.g.
Database field: ADO Data Type ODBC Data Type
bit 11 -7
int 3 4
numeric 131 2
money 6 3
datetime 135 11
char 129 1
varchar 200 12

I know I could use a case statement in the new ADO based application
to return the old values for the data types, but would rather not do
this because of the overheads of having to do it for every column
returned.

I am also having some issues with the way numbers are being formatted.

E.g for a money/currency field.
Database value: ODBC value ADO value
123.4500 123.4500 123.45

ADO is trimming the trailing spaces :-(
Again, I could format any numeric values that this is happening to,
but I hope that there is a cleaner solution. If ODBC can return the
number formatted to 4 DP, surely ADO can too??

Any ideas or help greatly appreciated.

John.



Relevant Pages

  • Re: Which database support?
    ... ADO is likely the better way to go, although ODBC is a close second. ... but *only* if the target database is based on the MSFT Jet Engine ... ADO is built on OLEDB; Both are based on a set of interfaces defined by ...
    (microsoft.public.vc.mfc)
  • Re: Regarding fastest database interaction with Oracle in VC++
    ... access Oracle database using VC++. ... It only use ODBC if the OLE DB provider for ODBC is used as the ADO ... Using native OLD DB providers with ADO is fastest and does not use ODBC. ...
    (microsoft.public.vc.database)
  • Re: Which database support?
    ... it presumes that the user is apparently interacting with the database through ... >ADO is likely the better way to go, although ODBC is a close second. ... >ADO is built on OLEDB; Both are based on a set of interfaces defined by ...
    (microsoft.public.vc.mfc)
  • Re: Which database support?
    ... it presumes that the user is apparently interacting with the database through ... >>ADO is likely the better way to go, although ODBC is a close second. ... >>ADO is built on OLEDB; Both are based on a set of interfaces defined by ...
    (microsoft.public.vc.mfc)
  • ADO Vs ODBC Data types and formatting.
    ... I am replacing a VB5 application that handles database communication ... directly through ODBC API calls with a VB5 application that uses ADO ... I am having some issues with mapping the data types returned by ODBC ...
    (microsoft.public.sqlserver.odbc)

Quantcast