From: Matt Houser on
Using Visual Studio 2008, MFC, C++, I am doing the following:

CDatabase db;
db.OpenEx(_T("Driver=SQL Server; Server=SUEDE\\SQLEXPRESS; Integrated
Security=true; AttachDbFilename=C:\\Temp\\DesignList.mdf;"),
CDatabase::noOdbcDialog);
CDesignData rs(&db);
rs.Open();
BOOL bUpdatable = rs.CanUpdate();
BOOL bAppendable = rs.CanAppend();
rs.AddNew();
rs.m_nDesignId = 5;
rs.m_sDesignName = _T("Hello");
rs.Update();


However, during the call to CRecordset::Open(), the record set is going into
read-only mode. The following is output in the debugger window:

DBMS: Microsoft SQL Server
Version: 09.00.3077
ODBC Driver Manager Version: 03.80.0000
Optional feature not implemented
State:S1C00,Native:0,Origin:[Microsoft][ODBC SQL Server Driver]

Warning: Driver does not support requested concurrency.
Optional feature not implemented
State:S1C00,Native:0,Origin:[Microsoft][ODBC SQL Server Driver]

Warning: Driver does not support requested concurrency.
Warning: Setting recordset read only.



It seems that the preparation of the SELECT call is failing during Open().

And any efforts to update my recordset fail. bUpdatable ends up being
false.

I've read that lack of a primary key may be the issue, however, my table in
my MDF file has a primary key.

I've tried using a non-MDF (regular SQLExpress database) with similar
results.

Any ideas?

Thanks,

....Matt



From: itsthesource on
On Apr 8, 4:28 pm, "Matt Houser" <m...(a)houser.ca> wrote:
> Using Visual Studio 2008, MFC, C++, I am doing the following:
>
> CDatabase db;
> db.OpenEx(_T("Driver=SQL Server; Server=SUEDE\\SQLEXPRESS; Integrated
> Security=true; AttachDbFilename=C:\\Temp\\DesignList.mdf;"),
>      CDatabase::noOdbcDialog);
> CDesignData rs(&db);
> rs.Open();
> BOOL bUpdatable = rs.CanUpdate();
> BOOL bAppendable = rs.CanAppend();
> rs.AddNew();
> rs.m_nDesignId = 5;
> rs.m_sDesignName = _T("Hello");
> rs.Update();
>
> However, during the call to CRecordset::Open(), the record set is going into
> read-only mode.  The following is output in the debugger window:
>
> DBMS: Microsoft SQL Server
> Version: 09.00.3077
> ODBC Driver Manager Version: 03.80.0000
> Optional feature not implemented
> State:S1C00,Native:0,Origin:[Microsoft][ODBC SQL Server Driver]
>
> Warning: Driver does not support requested concurrency.
> Optional feature not implemented
> State:S1C00,Native:0,Origin:[Microsoft][ODBC SQL Server Driver]
>
> Warning: Driver does not support requested concurrency.
> Warning: Setting recordset read only.
>
> It seems that the preparation of the SELECT call is failing during Open()..
>
> And any efforts to update my recordset fail.  bUpdatable ends up being
> false.
>
> I've read that lack of a primary key may be the issue, however, my table in
> my MDF file has a primary key.
>
> I've tried using a non-MDF (regular SQLExpress database) with similar
> results.
>
> Any ideas?
>
> Thanks,
>
> ...Matt

I've seen this in the past & this message seems to go away when I set
the nOpenType = dynaset. I have no idea why so I'd be interested to
see if anyone has an explanation too.