CDaoRecordset.AddNew() fails with ODBC Sybase SQL Anywhere 
Author Message
 CDaoRecordset.AddNew() fails with ODBC Sybase SQL Anywhere

I can't add a new record in a table of a SQL Anywhere Database with
DAO.
I can create new tables and fields. The database and the tables are
updatable. But all fields of all tables have the property
?DataUpdatable = FALSE.
I can open the CDaoRecordset, I can read the values of all fields, but
I can't use the AddNew() method. I get the CDaoException ?Database is
read-only.

The same procedure happens with the Visual Data Manager inside Visual
Basic. When I connect the SQL Anywhere Database via ODBC, the database
and all tables are updatable, but the fields are not. I can navigate
through the records, but I can't use the AddNew or Edit Button.

When I connect a dBase III or MDB Database via ISAM, I can edit the
records.

When I create a CRecordset derived class (not CDaoRecordset) with the
App Wizard and connect this class to a table in the SQL Anywhere
database, I can update the records.

Is it possible to edit the records in a table via DAO?
If yes, where is the mistake?

Thank you for help in advance,

Klaus



Fri, 15 Jun 2001 03:00:00 GMT  
 CDaoRecordset.AddNew() fails with ODBC Sybase SQL Anywhere
If you are opening the database/recordset using DAO, which is using a ODBC
datasource, maybe you should be using ODBC direct database etc. Im not sure
what this does, but your opendatabase and open recordset statements need to
be slightly different!

To help further i will need code examples of how you are creating/opening
the db and rs.

Regards
Michael G Walmlsey



Sun, 17 Jun 2001 03:00:00 GMT  
 CDaoRecordset.AddNew() fails with ODBC Sybase SQL Anywhere
Vladimir solves the problem:
There was no primary key in the table defined.

A happy new year to all,
Klaus



Wed, 20 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CDaoRecordset.AddNew() fails with ODBC Sybase SQL Anywhere

2. CDaoTableDef.GetIndexInfo fails with ODBC Sybase SQL Anywhere

3. How about Sybase SQL Anywhere?

4. C++ Library for database access (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase and ODBC)

5. C++ Library for Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase and ODBC

6. C++ Library for Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase and ODBC

7. C++ Library for Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase and ODBC

8. C++ Library for accessing SQL Serever, Oracle, Informix, Sybase, Interbase, SQLBase, DB2 and ODBC

9. AddNew on an empty Recordset fails in MS C++ AddNew Example

10. Accessing a sybase anywhere 5.0 server

11. Accessing a sybase anywhere 5.0 server

12. Accessing a sybase anywhere 5.0 server

 

 
Powered by phpBB® Forum Software