oracle - sqlserver , stringfield and widestringfield

oracle - sqlserver , stringfield and widestringfield

Postby rancio » Wed 09 Mar 2011 19:38

D2009 working with SqlServer and Oracle database I have in my application persistent fields of type string, if I connect to oracle fields recognized as twidestringfield, as I can do for you Acknowledge as Stringfield

both use their libraries to connect :?:
rancio
 
Posts: 3
Joined: Wed 09 Mar 2011 19:27

Postby AlexP » Thu 10 Mar 2011 11:09

Hello,

To get string field as ftString, you should create SQLConnection in run-time and set the UseUnicode options to false.
We will investigate the possibility of adding this feature in design-time in one of the next builds/versions.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Postby rancio » Thu 10 Mar 2011 11:57

please can you tell me how to change the parameter at runtime because they are not as allocating useunicode :?:
rancio
 
Posts: 3
Joined: Wed 09 Mar 2011 19:27

Postby rancio » Thu 10 Mar 2011 12:20

within the parameters that are in there one that is dbxconnections longstrings and other usequotechar for being better or I can give a detail that makes each one, could put here the useunicode
rancio
 
Posts: 3
Joined: Wed 09 Mar 2011 19:27

Postby AlexP » Thu 10 Mar 2011 13:21

Hello,

This sample shows how to set the UseUnicode property:

Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
  SQLConnection: TSQLConnection;
  SimpleDataSet: TSimpleDataSet;
  i: integer;
begin
SQLConnection := TSQLConnection.Create(nil);
SQLConnection.DriverName :='DevartOracle';
SQLConnection.ConnectionName :='Devart Oracle';
SQLConnection.GetDriverFunc := 'getSQLDriverORA';
SQLConnection.LibraryName := 'dbexpoda40.dll';
SQLConnection.LoginPrompt := False;
SQLConnection.Params.Values['Database'] := 'ORCL1020';
SQLConnection.Params.Values['User_Name'] := 'scott';
SQLConnection.Params.Values['Password'] := 'tiger';
SQLConnection.Params.Values['UseUnicode'] := 'False';
SQLConnection.Connected := true;
SQLConnection.ExecuteDirect('CREATE TABLE TESTSTRING (TEXT VARCHAR2(50))');


SimpleDataSet:= TSimpleDataSet.Create(nil);
SimpleDataSet.Connection :=SQLConnection;
SimpleDataSet.DataSet.CommandText := 'SELECT * FROM TESTSTRING';
SimpleDataSet.Active := true;
for i := 0 to SimpleDataSet.Fields.Count - 1 do
  case SimpleDataSet.Fields.DataType of
    ftString: ShowMessage('ftString');
    ftWideString:ShowMessage('ftString');
  end;

end;
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35


Return to dbExpress driver for Oracle