Problem with type of field

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
Sandro.nil
Posts: 3
Joined: Wed 25 Nov 2009 13:40

Problem with type of field

Post by Sandro.nil » Wed 25 Nov 2009 15:24

Hi,

We are substituing the vitavoom driver to devart driver "dbxpgsql110", but we are having a problem with type of field.

When a ClientDataSet is open it's happening the following error:

Tape mismatch for Field "empresa_razaosocial", expeting: String Actual: WideString.

We are using Delphi2010 and PostgreSql 8.2.7.

PS' When we were using vitavoom driver it was work.

thank's.

Claudio
Posts: 25
Joined: Tue 17 Mar 2009 12:47

Veja opção "UseUnicode"

Post by Claudio » Thu 26 Nov 2009 11:06

Veja na documentação:

UseUnicode
Enables or disables Unicode support. Affects character data fetched from the server. When set to True all character data is stored as WideStrings and TStringField is replaced with TWideStringFiled.
This option is available for Delphi 2006 and higher IDE versions.
Default value of this option is True for Delphi 2009 and higher IDE versions, and False for Delphi 2006 and 2007.
const
coUseUnicode = TSQLConnectionOption(209); // boolean
. . .
SQLConnection1.SQLConnection.SetOption(coUseUnicode, Integer(True));

Sandro.nil
Posts: 3
Joined: Wed 25 Nov 2009 13:40

Post by Sandro.nil » Thu 26 Nov 2009 15:42

Ola Claudio,

obrigado pela dica, mas o meu componente TSQLConnection não dispoe desse metodo.

SQLConnection.SQLConnection.SetOption(coUseUnicode, Integer(True));

meu componente esta com o seguinte nome "SQLConnection"

não diponibilizou o metodo .SetOption

alguma dica?

Claudio
Posts: 25
Joined: Tue 17 Mar 2009 12:47

Instalar TCRSQLConnection

Post by Claudio » Thu 26 Nov 2009 16:29

Olá,

Vc tem que instalar o componente "TCRSQLConnection" que vem junto.

Veja pacote em

\Program Files\Devart\Dbx\PostgreSQL\Source\Delphi14

Boa sorte t+

Sandro.nil
Posts: 3
Joined: Wed 25 Nov 2009 13:40

Post by Sandro.nil » Thu 26 Nov 2009 18:56

Ola claudio.

mais uma vez agradeço sua atenção, mas não consegui instalar o pacote esta dando um erro na compilação.

pelo que li na documentação creio esta fazendo certo.

o erro é esse:

[DCC Fatal Error] CRDbxDesign.pas(17): E2225 Never-build package 'dcldbx' must be recompiled

tem mais uma dica?

vc tb usa delphi 2010?

desde ja agradeço.

Claudio
Posts: 25
Joined: Tue 17 Mar 2009 12:47

Post by Claudio » Fri 27 Nov 2009 12:02

Olá,

Uso delphi 2010, não tive esse problema.

Verifique se vc está usando o pacote correto.

Eu só abri o pacote "dclcrdbx140" e instalei.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 27 Nov 2009 13:02

You don't need TCRSQLConnection for Delphi 2010. This component is provided for backward compatibility.

Use standard TSQLConnection component, and add

UseUnicode=False
or
UseUnicode=True

to its Params property.

Post Reply