Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1220
  • Last Modified:

MySQL, Blob and ADO

Hi,

I constantly receive EOleException error 'Table does not exist' using TADOQuery with the following SQL:

SELECT ma_FirstName, ma_Address FROM ma

where ma_Address is either BLOB or TEXT field. 'SELECT * FROM ma' raises the same error.

Setting that field using 'UPDATE' SQL statement is OK. 'mysql' command tool executes SELECT statements above without errors.

Environment:
MySQL 3.23.55 on a WinXP Pro
MyOLEDB3 provider
Delphi 5 Ent.

Where is the problem and how can I get that field ???

Thanks in advance.

Regards, Geo
0
geobul
Asked:
geobul
  • 4
  • 4
  • 2
  • +1
1 Solution
 
kretzschmarCommented:
?
and
SELECT ma_FirstName FROM ma
works ?

just for pointing out that the problem
is the field and not the table


0
 
geobulAuthor Commented:
Hi meikl,

No problems using other field types (char and varchar). I can UPDATE and SELECT them. Only BLOB/TEXT fields are misterious. There are also TINYTEXT/TINYBLOB field types which I can read but their implementation (in OLEDB provider, I guess) equals to varchar(255).

I'm trying to write/read a RichEdit contents in a memo field (TEXT or BLOB in MySQL). Simple, isn't it? I've done it so many times using other databases.

MySQL is pretty new to me. But as this query works fine in the MySQL tools itself, I suppose that MyOLEDB driver is the part that is creating my problem. I have a clean installation of both MySQL and MyOLEDB. I mean that I haven't changed anything afterwards. Perhaps I should have set something. Who knows ...

I'm going to try TADOTable and TADODataSet components tomorrow and will let you know.

Regards, Geo
0
 
d3lph1Commented:
It could be MySQL driver issue.

FROM Delphi 6 Update 1 README

* dbExpress now includes mysql 3.23.41 support with a new
  driver (dbexpmysql.dll).
  To use the new driver, specify
    LibraryName = "dbexpmysql.dll"
  in the Object Inspector or in dbxdrivers.ini.

FROM D6 Update Pack 2 README

dbExpress now includes mysql 3.23.45 support with a new
  driver (dbexpmysql.dll).
  To use the new driver, specify
    LibraryName = "dbexpmysql.dll"
  in the Object Inspector or in dbxdrivers.ini.

Here is nice article that might help
http://www.thedelphimagazine.com/Samples/1540/1540.htm
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
kretzschmarCommented:
hmm, ihave no mySQL-database,
therefore its hard for me
to reproduce :-(
0
 
geobulAuthor Commented:
Hi,

Thank you guys for your comments.

I gave up because all ADO components behaved strange. I'm going to try MyODBC driver instead, in conjunction with 'Microsoft OLE DB Provider for ODBC Drivers'.

d3lph1, check this link. There are some points for you:
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20542530.html

Regards, Geo
0
 
loop_untilCommented:
geobul, check if your BLOB or TEXT field type let NULL be available in your mySQL table. If it does not allow NULL, ADO raises this error if you have an invalid field in your table. For example, you have 30 records, you choose to add a ma_FirstName with BLOB but with the field not being NULL (problem is your already there records are null). When you try to open the whole thing or whatever with ma_FirstName in it, it doesn't want to. This is my guess.

Does this help? I know, ADO is touchy with mySQL, you might want to use http://www.fichtner.net/delphi/mysql.delphi.phtml, it is quite fast. But ADO works okay for me, when you've passed thru a lot of hell... ;-)


Anyway, have a nice day! :-)
0
 
loop_untilCommented:
Oh, and you're better using TEXT if it is only for text (such as a first name)! You can edit it using phpMyAdmin this way. ;-)
0
 
loop_untilCommented:
By the way, the address I gave you is without a (,) at the end... This is a bug from the EE parser. So the good address is:

http://www.fichtner.net/delphi/mysql.delphi.phtml
0
 
geobulAuthor Commented:
Thanks loop_until.

This is not the issue. All fields are correct. As I already said, I was able to read them using mysql.exe (this is a tool where you can execute SQL statements).

I'm aware of all possible db components sets that support MySQL. Changing ADO with something else is not an option. The project already can use different SQL based servers and adding MySQL support has to be done with ADO.

There only difference between BLOB and TEXT is case-sensitivity when sorting and comparing is being performed.

Regards, Geo
0
 
loop_untilCommented:
>> This is not the issue. All fields are correct. As I already said, I was able to read them using mysql.exe (this is a tool where you can execute SQL statements).

Yes, I know mysql.exe, but I talk about a problem relative to ADO. But you're right, it is not necessarily that. You might want to check if you don't have something invalid in your fields definition.


>> I'm aware of all possible db components sets that support MySQL. Changing ADO with something else is not an option. The project already can use different SQL based servers and adding MySQL support has to be done with ADO.

myODBC drivers work quite well, it is what I prefer when I use ADO. Latest version, altought beta, haven't done trouble to me yet.


>> There only difference between BLOB and TEXT is case-sensitivity when sorting and comparing is being performed.

I know this difference, I was just saying that if you use phpMyAdmin for editing your fields, you might want to be able to edit and you need TEXT type for that (keeping in mind that you are storing text anyway).
0
 
geobulAuthor Commented:
loop_until,

Can you create (and show to me) an ADO Connection String without using a DSN entry? I'm speaking about MyODBC connection via TADOConnection component. I want to avoid ODBC DSN if possible.

Thanks, Geo
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now