Hi,
I use last version of SDAC (8.2.8) for RAD Studio 10.2 + MS SQL Server 2012.
Tested with TMSQuery. I found bug on adding GUID data. For example you have table with uniqueidentifier column and trying to add data from client application that use TMSQuery.
If you pass such value {00000000-0000-0000-0000-000000000001} - everything fine.
But if you pass value without brackets 00000000-0000-0000-0000-000000000001 application shows exception: Invalid class string.
Thanks,
Alexey
Bug in GUID fields
Re: Bug in GUID fields
To convert a GUID string view into an equivalent TGUID data structure, SDAC uses a standard StringToGUID function.
The string literal must be enclosed in parentheses and look in the following way:
'{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
It is a standard approach in Delphi for the work with GUID.
The string literal must be enclosed in parentheses and look in the following way:
'{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
It is a standard approach in Delphi for the work with GUID.
-
- Posts: 11
- Joined: Wed 01 Jun 2011 07:54
Re: Bug in GUID fields
Hi,
Yes, you're right. But both {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} and XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX are correct too, so what's problem to check ingoing value on existing of brackets? When I got this strange error i spent lot of time to figure out, what's problem. For MS SQL Server both values are correct. I can receive GUID value from different sources, and I can get GUID without brackets in this case i will receive this strange error. This mean that I need to check every GUID on existing of brackets. I cannot believe that you think this that it good solution.
For my opinion it's bug or bad architecture.
Yes, you're right. But both {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} and XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX are correct too, so what's problem to check ingoing value on existing of brackets? When I got this strange error i spent lot of time to figure out, what's problem. For MS SQL Server both values are correct. I can receive GUID value from different sources, and I can get GUID without brackets in this case i will receive this strange error. This mean that I need to check every GUID on existing of brackets. I cannot believe that you think this that it good solution.
For my opinion it's bug or bad architecture.
Re: Bug in GUID fields
Thank you for the information. We have fixed the issue, and the fix will be included in the next SDAC build.
-
- Posts: 11
- Joined: Wed 01 Jun 2011 07:54
Re: Bug in GUID fields
Hi,
Thank you so much.
Thank you so much.