🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1098

Re: Accessing MySQL via ADO

#1098
From: Tumurbaatar S.
Date: Fri, 24 Dec 2004 11:41
76 lines
3845 bytes
Thank you!
It seems, this driver does not support transactions.
And I've found a solution. It is MyODBC Option=3.
But there raised another problem. I pass datetime
field values as ODBC escape clauses, e.g. {ts '...'},
but MyODBC does not convert them. At least MySQL
server log file contains supplied datetime strings
as is and, as result, datetime fields are set to zero value.
Anybody knows what is a matter?
I use ODBC escapes because my program should work
with any ODBC compliant databases.



"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message 
news:41cb0467$1@newsgroups.borland.com...
> Native OLEDB provider for MySQL:
>
> http://www.mysql.com/Downloads/Win32/MyOLEDB.exe
> http://www.mysql.com/Downloads/Win32/MyOLEDB.chm
>
> Not sure that it completely supports features of version 4, but it is most
> native (goes from MySQL site).
>
> Try also cmd->Parameters->...->Value = bytes;
>
> //------------------------------------------
> Regards,
> Vassiliev V. V.
> http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> ADO.Net
> http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> MS Jet (Access) and Interbase (through OLEDB)
>
> "Tumurbaatar S." <nospam_tumur@magicnet.mn> �������/�������� � ��������
> ���������: news:41caab99@newsgroups.borland.com...
>> My program connects to MySQL 4.1.7 using ADO components.
>> The connection string points to MyODBC 3.51.10 DSN (Anybody know
>> MySQL native OLEDB provider?). The table has only 4 fields where one
>> of them is BLOB. The next code inserts a new record and it raises
>> EAccessViolation when a command executes. When Execute() is
>> removed/commented, no error.
>>
>>     int bounds[2] = {0};
>>     cmd->Parameters->ParamByName("id")->Value = PacketID++;
>>     cmd->Parameters->ParamByName("ip")->Value = AnsiString(Buff->ip);
>>     bounds[1] = Buff->size - 1;
>>     Variant bytes = VarArrayCreate(bounds, 1, varByte);
>>     memcpy(bytes.ArrayLock(), Buff->data, Buff->size);
>>     bytes.ArrayUnlock();
>>     cmd->Parameters->ParamByName("data")->AppendChunk(bytes);
>>     cmd->Execute();
>>
>> table stucture:
>>
>> CREATE TABLE packets
>> (
>>   id INT NOT NULL,
>>   ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
>>   ip VARCHAR(15) NOT NULL,
>>   data BLOB NOT NULL,
>>
>>   PRIMARY KEY (id)
>> );
>>
>> CREATE INDEX packets_ts ON packets (ts);
>> CREATE INDEX packets_ip ON packets (ip);
>>
>> P.S. Also, all 3 above parameters returned by TADOCommand are
>> ftString, Size=25165824, Attributes=paNullable, paLong. Why?
>> Does it mean that MyODBC and ADO do not understand each other?
>>
>>
>>
>
> 
Technical Details
Message-ID: <41cc005e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41caab99@newsgroups.borland.com> <41cb0467$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5756267530e63452
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Tumurbaatar S." <nospam_tumur@magicnet.mn>
Newsgroups: borland.public.cppbuilder.database.ado
References: <41caab99@newsgroups.borland.com> <41cb0467$1@newsgroups.borland.com>
Subject: Re: Accessing MySQL via ADO
Date: Fri, 24 Dec 2004 19:41:24 +0800
Lines: 78
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 202.131.0.41
Message-ID: <41cc005e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1103888478 202.131.0.41 (24 Dec 2004 03:41:18 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail