TMSLoader 6.2.8 Trial save wrong string parameters

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

TMSLoader 6.2.8 Trial save wrong string parameters

Post by Tarifer » Fri 27 Jul 2012 19:50

Hello, I install SDAC 6.2.8 Trial on Delphi XE2 Update 4 Hotfix 1.

I use TMSLoader, and PutColumnData(...) save only first character of string or saved it in wrong encoding.
I use this code:

FConnection: TMSConnection;
FLoader: TMSLoader;
..
FConnection.Authentication := auWindows
FConnection.LoginPrompt := False;
FConnection.Server := ConnectionString;
FConnection.Database := SchemaName;
FConnection.Open;

FLoader := TMSLoader.Create(nil);
FLoader.Connection := Connection;
FLoader.TableName := TableName;
FLoader.CreateColumns;


Table definition is:
CREATE TABLE TABLE_FOR_LOADING (
CALLER_NUMBER varchar(100),
SERVICE_DATE_TIME DATETIME,
CALLED_NUMBER varchar(100),
...

SQL Server 2008 R2 Express.

Before I use ODAC, and it works fine.

Please help me.

Dmitry.

Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

Re: TMSLoader 6.2.8 Trial save wrong string parameters

Post by Tarifer » Sat 28 Jul 2012 14:54

I compile and run Demo application in Delphi XE2 and got the same effect.
I think it encountered zero byte in unicode string and breaks. When I send cyrilic string, it write more than one char, but saved text is wrong (not-readable wrong encoding text).

I compile Demo application in Delphi 7, and it works fine.
Please help, I need working Delphi XE2 code.

Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

I found, it save Unicode as single-byte encoded values.

Post by Tarifer » Sat 28 Jul 2012 18:37

After some investigations I found that unicode values saved as single-byte encoding. I have LEN(c)=22 instead of 11 in the source.
MS SQL Server Management studio can see only part of value (up to first zero in Unicode).
Please give me workaround or fix this bug, and I will buy it.

Thanks,
Dmitry.

Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

Re: TMSLoader 6.2.8 Trial save wrong string parameters

Post by Tarifer » Sat 28 Jul 2012 19:07

I found workaround. if VarType(Value)=varString it works, but varUString don't works.

Workaround is:

Code: Select all

  if VarType(Value)=varUString then
    FLoader.PutColumnData(ColName, FRowIndex, AnsiString(VarToStr(Value)))
  else
    FLoader.PutColumnData(ColName, FRowIndex, Value);
it is ugly, but works.

AndreyZ

Re: TMSLoader 6.2.8 Trial save wrong string parameters

Post by AndreyZ » Mon 30 Jul 2012 09:11

Thank you for the information. We have reproduced this problem. We will fix this problem in the next SDAC build. For the time being you can use your workaround, it is correct.

AndreyZ

Re: TMSLoader 6.2.8 Trial save wrong string parameters

Post by AndreyZ » Thu 02 Aug 2012 12:22

We have fixed this problem. This fix will be included in the next SDAC build.

Post Reply