Help! CRecordset/SQL Server 6.5 
Author Message
 Help! CRecordset/SQL Server 6.5


Someone should know this one:

I have several fields in the SQL Server 6.5 database that can be empty
strings or integers. (they are not part of primary key).  

I use CRecordset class with these and do AddNew()/Update().  Some of the
CRecordset member variables are CString("") or long = 0.  

During Update(), ODBC driver throws -- "Column may not be NULL".  

Now, I thought that "" is distinct from NULL in SQL server.  The thing
works if I don't use CRecordset and do SQLExec...    

I would rather not give up using CRecordset because in general I like it.
Also, I really can not set all of these strings to NULL in SQL server due
to system requirements.



Fri, 24 Sep 1999 03:00:00 GMT  
 Help! CRecordset/SQL Server 6.5

        use CRecordset::SetFieldNull(NULL, FALSE) to set all fields non-NULL
before you issue update(). hope can help



Quote:

> Someone should know this one:

> I have several fields in the SQL Server 6.5 database that can be empty
> strings or integers. (they are not part of primary key).  

> I use CRecordset class with these and do AddNew()/Update().  Some of the
> CRecordset member variables are CString("") or long = 0.  

> During Update(), ODBC driver throws -- "Column may not be NULL".  

> Now, I thought that "" is distinct from NULL in SQL server.  The thing
> works if I don't use CRecordset and do SQLExec...    

> I would rather not give up using CRecordset because in general I like it.
> Also, I really can not set all of these strings to NULL in SQL server due
> to system requirements.



Sun, 26 Sep 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help - Locking issue in sql server 2k in 6.5 comp mode

2. Trouble adding a CRecordset into a SQL 6.5 database

3. sql server version 6.5 problems

4. SQLConnect behaviour (MS SQL Server 6.5)

5. PROBLEM: Accessing SQL SERVER 6.5 from 16 bit ODBC Application (VC++ 1.5)

6. ADO Update very slow against SQL Server 6.5

7. DAO vs ODBC for SQL Server 6.5

8. SQL Server 6.5/ ADO

9. Connection is busy with results - VC++ 1.52, SQL Server 6.5, ODBC

10. Wrong German Umlaute in SQL SERVER 6.5 (NT)

11. VC++ Enterprise boxed with MS SQL Server, Developer Edition 6.5

12. CLongBinary SQL Server 6.5 Images

 

 
Powered by phpBB® Forum Software