I have a field named [Information text] which is a type varchar(8000).
I edit the field in a SQL database here:
If the character code is more than 8000 I get the following error:
I don’t want to store more than 8000 characters.
Can anyone help me handle this error?
Thanks.
Ah dinnae ken...
I edit the field in a SQL database here:
Code:
str_SQL = ""
str_SQL = str_SQL & " IF EXISTS (SELECT 1 FROM [System_Information] WHERE SystemID = '" & id & "') "
str_SQL = str_SQL & " UPDATE a "
str_SQL = str_SQL & " SET a.[Information Text] = '" & EditInformationText & "'"
str_SQL = str_SQL & " FROM [System_Information] a "
str_SQL = str_SQL & " WHERE [SystemID] = '" & id & "'"
str_SQL = str_SQL & " ELSE "
str_SQL = str_SQL & " INSERT INTO [System_Information] ([SystemID], [Information text] )"
str_SQL = str_SQL & " VALUES "
str_SQL = str_SQL & " ('" & id & "', '" & EditInformationText & "')"
Set obj_RS1 = obj_CN.Execute(str_SQL, adBoolean)
If the character code is more than 8000 I get the following error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E57)
String or binary data would be truncated.
I don’t want to store more than 8000 characters.
Can anyone help me handle this error?
Thanks.
Ah dinnae ken...