PDA

View Full Version : Old database data not working


Unregistered
October 17, 2002, 21:09:28
I've used the sample code to add a tx control to a VB 6.0 project which is a front end to a SQL Server database. I can successfully add new data and read it back but the data which was in this field before (which is important to my users) does not show up in the control. The data type in SQL Server for the field is "text".
The new entries show up through Enterprise manager as <Long Text> or with a string like {rtf1\ansi\ansicpg1252\uc0\deff0{\fonttbl. The old data shows up as a literal string ("Next year we will increase our budget..."). The old data currently casues and error: "Error in text filter: Unknown format. (1-1d01)." How can I get the old data to show up or convert it to rtf?


This message was originally posted by Leo Sopicki in the old TX Text Control Support Forum.

Unregistered
October 18, 2002, 02:18:22
Looks like the old data was just an unformatted string and the new is rtf. perhaps you should check your load and save.


This message was originally posted by Peter Meachem in the old TX Text Control Support Forum.

Unregistered
October 18, 2002, 10:24:17
Sorry. I clearly didn't actually read what you wrote! Could you just read the text string into a variable and check the first few characters. If '{rtf1' load as rtf else as text. If you then do your current save it will be converted to rtf. Run through all your records doing that and they will all be rtf.


This message was originally posted by Peter Meachem in the old TX Text Control Support Forum.

Unregistered
October 19, 2002, 05:39:33
I converted the data. I looked at the new data that the TX control was creating and grabbed the header and footer. I used an SQL statement to convert the data as follows. This seems to be working now. Thanks you for the assistance.

USE bucs_r
DECLARE @front char(391)
DECLARE @back char(6)
SET @front = '{\rtf1\ansi\ansicpg1252\uc0\deff0{\fonttbl
{\f0\fswiss\fcharset0\fprq2 Arial;}
{\f1\froman\fcharset2\fprq2 Symbol;}}
{\colortbl;\red0\green0\blue0;\red255\green255\blu e255;}
{\stylesheet{\s0\f0\fs24 [Normal];}{\*\cs10\additive Default Paragraph Font;}}
{\*\generator TX_RTF32 9.1.312.500;}
\deftab1134\paperw12240\paperh15840\margl1440\marg t1440\margr1440\margb1440\pard\plain\f0\fs16 '
SET @back = '\par }'

update account
set justify = @front + RTRIM(CAST(justify as char(8000))) + @back


This message was originally posted by Leo Sopicki in the old TX Text Control Support Forum.