?
Solved

MySQL, Blob and ADO

Posted on 2003-03-06
11
Medium Priority
?
1,204 Views
Last Modified: 2013-11-23
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
Comment
Question by:geobul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 800 total points
ID: 8082356
?
and
SELECT ma_FirstName FROM ma
works ?

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


0
 
LVL 17

Author Comment

by:geobul
ID: 8084216
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
 
LVL 2

Expert Comment

by:d3lph1
ID: 8086464
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.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 8086468
hmm, ihave no mySQL-database,
therefore its hard for me
to reproduce :-(
0
 
LVL 17

Author Comment

by:geobul
ID: 8089143
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
 
LVL 3

Expert Comment

by:loop_until
ID: 8089741
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
 
LVL 3

Expert Comment

by:loop_until
ID: 8089770
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
 
LVL 3

Expert Comment

by:loop_until
ID: 8089786
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
 
LVL 17

Author Comment

by:geobul
ID: 8090680
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
 
LVL 3

Expert Comment

by:loop_until
ID: 8090737
>> 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
 
LVL 17

Author Comment

by:geobul
ID: 8117425
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

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question