Hello, When writing a text to a SQL database nvarchar(6) field, I get following error when the size of the input is larger than the available length of the textfield (larger than 6). String or binary data would be truncated. The statement has been terminated. How can I make that at least the first 6 characters will be saved and the input is indeed truncated without generating an error or at least to catch the error silently? Many thanks and greetings, Michel
> > When writing a text to a SQL database nvarchar(6) field, I get following > error when the size of the input is larger than the available length of > the textfield (larger than 6). > > String or binary data would be truncated. > The statement has been terminated. > > How can I make that at least the first 6 characters will be saved and the > input is indeed truncated without generating an error or at least to catch > the error silently? > See if your database supports a left() or substr() function, or do this in your VB code.