CRecordset: Error when adding records SQL Server view 
Author Message
 CRecordset: Error when adding records SQL Server view

Hi all,

I have a problem that looks quite simple: From an MFC application I want to
insert a record to an updateable SQL Server view:

myRecord.Addnew();
myRecord.m_col1val = 1;
myRecord-m_col2val = 2;
myRecord.Update();

The Update() fails with an exeption, showing an ODBC error S0022 (Column
'xxxx' not found). The column xxxx in the error message is a column name
from the table, not from the view ! The view itself is very simple, just
selects all columns exept one from one table and renames the columns. The
column mapping in the myRecords declaration contains the correct column
names from the view. If I link the view to an Access database as a linked
table I can insert records with no problem.

Does anyone know a solution (or at least the reason) for that problem ?
Any help would be appreciated.

(Win NT 4.0 SP 5, SQL Server 6.5 SP 3, Visual Studio 6 SP 4, ODBC driver
Version 3.7 for SQL server).

Michael Eisele



Tue, 18 Feb 2003 02:45:49 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Need ID of a record added to SQL-Server using MFC/ODBC/CRecordset

2. Error updating SQL-Server record via ODBC (CRecordset)

3. CRecordset and SQL Server Linked Server View

4. Adding records in custom SQL CRecordset

5. Adding records to SQL Server

6. SQL Server error when updating via CRecordset

7. SQL Server error when updating via CRecordset

8. SQL Server with CDatabase/CRecordset and server cursors

9. Adding a record to a CRecordSet

10. CRecordset AddNew() - moving to new record added.

11. CRecordset can't get Primary Key of newly Added record

12. Problem in adding new records using CRecordset class (in dialogbox)

 

 
Powered by phpBB® Forum Software