BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MySQL text field lengths truncated

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Bill Saffin
Guest





PostPosted: Sat Oct 21, 2006 5:12 am    Post subject: MySQL text field lengths truncated Reply with quote



I'm new to MySQL development. I'm using Delphi 7, ADO components, connecting
to a remote MySQL server 4.1.10.

I've got a text field in a table in the database. When I use varchar(255)
for the type, I get 255 characters in the field. When I try other text types
(Medium Text, Long Text) with larger numbers specified (I've tried 512,
1024, 4096), I can't get more than 162 characters. I checked this by adding
fields to the query (edit the field list).

I've searched for this type of error, but can't find a solution. I can't use
a longer varchar type because the web hosting company isn't ready to move to
MySQL 5.

Anybody solve this type of problem?
Back to top
Guillem
Guest





PostPosted: Mon Oct 23, 2006 3:21 pm    Post subject: Re: MySQL text field lengths truncated Reply with quote



Bill Saffin wrote:

Quote:
I'm new to MySQL development. I'm using Delphi 7, ADO components,
connecting to a remote MySQL server 4.1.10.

I've got a text field in a table in the database. When I use
varchar(255) for the type, I get 255 characters in the field. When I
try other text types (Medium Text, Long Text) with larger numbers
specified (I've tried 512, 1024, 4096), I can't get more than 162
characters. I checked this by adding fields to the query (edit the
field list).

I've searched for this type of error, but can't find a solution. I
can't use a longer varchar type because the web hosting company isn't
ready to move to MySQL 5.

Anybody solve this type of problem?

How are you accessing the MySQL server? What does your connection
string look like? What kind of field are you trying to use (in your
app, not in the MySQL server)?

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
Back to top
Bill Saffin
Guest





PostPosted: Tue Oct 24, 2006 7:21 am    Post subject: Re: MySQL text field lengths truncated Reply with quote



Here's the connection string (using TAdoConnection):
Provider=MSDASQL.1;Password=****;Persist Security Info=True;User
ID=****;Data Source=LeoKevinIssues

I've connected the field in question to a TDBMemo component. The first error
message I received said it was expecting a memo field but it was actually a
string.

"Guillem" <guillemvicens-nospam (AT) clubgreenoasis (DOT) com> wrote in message
news:453c97c3$1 (AT) newsgroups (DOT) borland.com...
Quote:
Bill Saffin wrote:

I'm new to MySQL development. I'm using Delphi 7, ADO components,
connecting to a remote MySQL server 4.1.10.

I've got a text field in a table in the database. When I use
varchar(255) for the type, I get 255 characters in the field. When I
try other text types (Medium Text, Long Text) with larger numbers
specified (I've tried 512, 1024, 4096), I can't get more than 162
characters. I checked this by adding fields to the query (edit the
field list).

I've searched for this type of error, but can't find a solution. I
can't use a longer varchar type because the web hosting company isn't
ready to move to MySQL 5.

Anybody solve this type of problem?

How are you accessing the MySQL server? What does your connection
string look like? What kind of field are you trying to use (in your
app, not in the MySQL server)?

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
Back to top
Guillem
Guest





PostPosted: Tue Oct 24, 2006 1:49 pm    Post subject: Re: MySQL text field lengths truncated Reply with quote

Bill Saffin wrote:

Quote:
Here's the connection string (using TAdoConnection):
Provider=MSDASQL.1;Password=****;Persist Security Info=True;User
ID=****;Data Source=LeoKevinIssues


ok, so you're accessing to MySQL as local database using ODBC, right?
In this case:

- make sure you have the latest MyODBC version. I remember having
serious issues with dates with the last version I used, which was 3.51.
Can't tell if there was any problem with large strings, though. AFAIK
they are testing now version 5.05

- I see you are missing the OPTION parameter in the connection string.
Take a look at the following URLs and check if you need to set any of
the options. Either case, OPTION=3 is a good beginning and won't hurt.

http://www.connectionstrings.com/

http://dev.mysql.com/doc/refman/5.0/en/myodbc-configuration-connection-p
arameters.html

Quote:
I've connected the field in question to a TDBMemo component. The
first error message I received said it was expecting a memo field but
it was actually a string.

a TDBMemo is well suited for text BLOBs and long alphanumeric fields.
That shouldn't be the issue. How are you connecting it?


--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.