Hi - I am changing a field from type nvarchar to type text, given that
I need to store strings longer than 255 characters. To do this I
change the data type in SQL Server, then I change the parameter code in
the calling procedure, as per below:
cmd.Parameters. Append(cmd.Crea teParameter("@t itle", adVarWChar,
adParamInput, 255, title));
becomes:
cmd.Parameters. Append(cmd.Crea teParameter("@t itle", adLongVarWChar,
adParamInput, 1073741823, title));
However, when I do this, for some reason, the field is still limited to
255 characters - when I try to update the field with 256 characters,
the error 'Application uses a value of the wrong type for the current
operation.' occurs.
Why is this? I've checked that the correct data is contained in the
parameter. When I look at the data in the database, the column in
question shows the content, whereas the next column, which has always
been of type text, shows '<LongText>' - does this mean anything? Do I
need to do something special to convert the column from nvarchar to
text?
Many thanks,
Iain
I need to store strings longer than 255 characters. To do this I
change the data type in SQL Server, then I change the parameter code in
the calling procedure, as per below:
cmd.Parameters. Append(cmd.Crea teParameter("@t itle", adVarWChar,
adParamInput, 255, title));
becomes:
cmd.Parameters. Append(cmd.Crea teParameter("@t itle", adLongVarWChar,
adParamInput, 1073741823, title));
However, when I do this, for some reason, the field is still limited to
255 characters - when I try to update the field with 256 characters,
the error 'Application uses a value of the wrong type for the current
operation.' occurs.
Why is this? I've checked that the correct data is contained in the
parameter. When I look at the data in the database, the column in
question shows the content, whereas the next column, which has always
been of type text, shows '<LongText>' - does this mean anything? Do I
need to do something special to convert the column from nvarchar to
text?
Many thanks,
Iain
Comment