Type mismatch for field

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Type mismatch for field

Post by MikaelNilsson » Mon 20 Jun 2011 09:53

Hi,

I just installed Devart drivers for interbase.

When trying it I get this error:
Type mismatch for field 'ENV', expecting: String actual: WideString

The field in the table is defined as varchar(12).
Why an error?
This program is working with standard DBXdrivers.

AndreyZ

Post by AndreyZ » Mon 20 Jun 2011 12:17

Hello,

To solve the problem, you should set the UseUnicode parameter to False in the following way:

Code: Select all

SQLConnection.Params.Values['UseUnicode'] := 'False';
The UseUnicode parameter enables or disables Unicode support. When it's set to True, all character data is stored as WideStrings, and TStringField is replaced with TWideStringField.

MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Post by MikaelNilsson » Tue 21 Jun 2011 06:44

Thanks it worked.
Now I got another error.
"arithmetic exception, numeric overflow, or string truncationCannot transliterate character between character sets"
remember that this program worked perfect before devart

AndreyZ

Post by AndreyZ » Tue 21 Jun 2011 08:41

Please supply me the following information:
- the exact version of dbExpress driver for InterBase & Firebird;
- the exact version of your IDE;
- the exact version of Firebird or InterBase.
- the character set of your database;
- a script to create and fill the table opening of which causes this problem.

MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Post by MikaelNilsson » Tue 21 Jun 2011 10:02

I solved it.
I have misspelled Charset ISO8859_1 instead of ISO8859-1.
Dont't you validate the values in options?

The program is now ok but very very slow. The program is a Service with severals treads with it's on datamodule that read XML files and loads data from the xml file in one database and the xmlfile it self in another database as a blob.
Before Devart I loaded about 60 xmlfiles per second. Now it only loads 28 xml files per second. I have added Preperad=True in options but it does not help.
Could the slow access depend on some settings with the blob?

SQLDialect=3
BlobSize=-1
ErrorResourceFile=
LocaleCode=0000
DevartInterBase TransIsolation=ReadCommited
WaitOnLocks=True
Charset=ISO8859-1
CharLength=1
EnableBCD=True
OptimizedNumerics=True
LongStrings=False
UseQuoteChar=False
FetchAll=False
UseUnicode=False
Prepared=True
TrimFixedChar=False

MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Post by MikaelNilsson » Tue 21 Jun 2011 11:56

Sorry I okeyd to soon.

Charset ISO8859_1 or ISO8859-1 does not work.
Not for all xmlfiles but a few.
Thes xmlfiles works without devart

AndreyZ

Post by AndreyZ » Tue 21 Jun 2011 12:44

We will investigate the possibility of adding charset checking on connecting.
I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create and fill a table. Also please supply the information that I asked for in my previous post.

MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Post by MikaelNilsson » Tue 21 Jun 2011 13:33

Ok I have finally got this to work.
It is a bug in DEVart. There is no ServerCharset only a charset.
charset is not used i think becuse you can put any value here with no error msg.

But still it's very very very slow.
Do you have tips to increase speed?

MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Post by MikaelNilsson » Wed 22 Jun 2011 07:05

Did you get my last message?

1. You have missed ServerCharset. You are only using something called Charset. I don't know what it's for.

2. Embarcadero drivers is 100% faster. why?

AndreyZ

Post by AndreyZ » Wed 22 Jun 2011 09:28

Thank you for the information. We have reproduced the problem with the Charset option and fixed it. This fix will be included in the next dbExpress driver for InterBase & Firebird build.
To set the server charset, you should add the ServerCharSet option to the SQLConnection.Params property with the ISO8859_1 value. Note that if you are using Delphi version earlier than RAD Studio 2007, you should use the TCRSQLConnection component instead of TSQLConnection. The TCRSQLConnection component is needed to overcome restrictions of dbExpress on Delphi versions earlier than RAD Studio 2007. For more information, please read the dbExpress driver for InterBase & Firebird documentation.

AndreyZ

Post by AndreyZ » Wed 22 Jun 2011 09:29

To help you with the working speed problem, I need additional information. Without it I will not be able to help you. Please specify the following:
- the exact version of dbExpress driver for InterBase & Firebird;
- the exact version of your IDE;
- the exact version of Firebird or InterBase.
- a script to create a table.
Also, I will be able to help you faster if you create a small sample to demonstrate this problem and send it to andreyz*devart*com.

MikaelNilsson
Posts: 8
Joined: Mon 20 Jun 2011 09:40

Post by MikaelNilsson » Wed 22 Jun 2011 12:43

- the exact version of dbExpress driver for InterBase & Firebird;
(The latest. Just downoalded a couple a days ago)

- the exact version of your IDE;
(Rad Studio XE)

- the exact version of Firebird or InterBase.
(Interbase 7.5.1)

- a script to create a table.
Also, I will be able to help you faster if you create a small sample to demonstrate this problem and send it to andreyz*devart*com.

It's impossible to that. If I do, I don't know if I get speed problem just on one table. I will sent more information to andreyz*devart*com

AndreyZ

Post by AndreyZ » Thu 23 Jun 2011 11:25

Unfortunately, I still cannot reproduce the problem with performance. I've tested our driver on records insertion and working with BLOB fields, and results showed that our driver is faster than the standard one. Therefore I need a sample project that demonstrates this problem. Please try composing this sample project and send it to me, including a script to create all needed server objects.

Post Reply