CompuServe Thread

CString vs CRecordset

1 messages in this thread
#30633From: Chriss HillJul 12, 1994 2:46 AM
Greetings, I am using Q+E ODBC drivers, and like the SIMBA ODBC driver they return text fields with trailing spaces. I notice that the MFC notice that it is using SIMBA and set a flag to remove trailing spaces. Question 1) Is it possible to set this bRemoveTrailing flag outside of the class? Without this flag I have to try to remove the trailing spaces myself, which then leads to problems, cos CString will allocate a new block from the heap for the shortened string, but ODBC still has the old block bound to the query, which generates some *VERY* strange results – I know I've wasted 3 days looking for it! Question 2) How do I remove the trailing spaces AND guarantee that the data point won't change? Currently I am doing a CRecordset Move and then copying the strings to another member variable and use the copy publicly this is fine for reading, but before long I will want to write back, and I don't see how to copy the public variable into the private recordset variable, without upsetting the binding. HELP!!! Thank you for your help in advance. Chriss Hill @ Softcare UK