ADO V's ODBC Data types and formatting
From: John F (JohnFrizelle_at_hotmail.com)
Date: 10/14/04
- Next message: Mark J. McGinty: "Re: opening a specific set of information in a datagrid"
- Previous message: Kevin Yu [MSFT]: "Re: Saving RTB content to SQL Server"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: Mark J. McGinty: "Re: opening a specific set of information in a datagrid"
- Previous message: Kevin Yu [MSFT]: "Re: Saving RTB content to SQL Server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|