Article View: borland.public.cppbuilder.database.ado
Article #4494Re: How to connect MySQL database by ADO and MyODBC
From: Giuliano
Date: Sun, 09 Dec 2001 21:48
Date: Sun, 09 Dec 2001 21:48
29 lines
1983 bytes
1983 bytes
On Fri, 7 Dec 2001 18:25:01 +0800, Liu Haizhou <zeroliu@163.com> wrote: > >Hi! > >I want to access MySQL database via MyODBC and ADO components. I've >setuped the ODBC as MyODBC required, i.e., checked the "Don't optimize >column widths" and "Return matching rows" options. But I faced a very >strange question: C++ Builder cannot identify the MySQL's varchar field >type. >I wanted to add fixed fields to the ADOTable or ADOQuery component. So I >chose "Add all fields", some VARCHAR fields were distinguished as >"TStringField", at the same time, the other were "TMEMOField". All of >these occured in the same table. I've tried many times, but these didn't >changed. I really don't know why. I've noticed that MyODBC fails to return correct types (it exchanges string fields with memo fields) when the returned recordset (relation) is an empty set. AFAIK, a possible workaround is to check, upon the opening, whether the DataSet's EOF flag is true. If it's true you can't make any access using (directly or indirectly) DataSet's fields. HTH Ciao! Giuliano
Technical Details
Message-ID:
<3c14dae2.260059565@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<MPG.167b19d79996fab1989680@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,e0991f248ed587e2 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-12-09 15:02:28 PST From: gcardinali@remove.adhoc.net (Giuliano) Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: How to connect MySQL database by ADO and MyODBC Date: Sun, 09 Dec 2001 21:48:40 GMT Message-ID: <3c14dae2.260059565@newsgroups.borland.com> References: <MPG.167b19d79996fab1989680@newsgroups.borland.com> X-Newsreader: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 194.183.65.48 X-Trace: dnews 1007938520 194.183.65.48 (9 Dec 2001 14:55:20 -0800) Lines: 29 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews