When Editing data in a grid, I get an error "String of Binary data would be truncated" when I enter a string containing the the same number of characters as the string width.
CREATE TABLE TestTypes(
[ID] [int] IDENTITY(1,1) NOT NULL,
[vChar_5] [varchar](5) NULL,
[Char_5] [char](5) NULL,
[NVChar_5] [nvarchar](5) NULL,
[NChar_5] [nchar](5) NULL
)
Using a TMSQuery with the query: "Select * from TestTypes".
Attached this to a TMSDataSource and the result to a TDBGrid.
The grid populates fine.
Entering '1234' into VChar_5 or Char_5 updates the table just fine.
Entering '12345' into VChar_5 or Char_5 results in the above error.
There is no problem with updates to NVChar_5 or NChar_5.
The SQL statement "UPDATE TestTypes SET cHAR_5='12345' where ID=3" works fine in SQL Mgmt Console
I'm pretty much using the default values on my TMSQuery and TMSDataSource
It's almost like the Grid is adding an extra character (perhaps a null char) before doing the post.
How can I get the updates to work properly with non-unicode data types?
Using SDAC 4.70.0.43 on Delphi 2009