I
Ian Benneth
Hi,
I have set up an application for one of my customers, and
Im having troubles managing concurrent accesses to a
database.
Users are working on Windows NT. The database is an
Access 97 database accessed through ODBC.
When I have only one user accessing the database at a
time, everything works fine, so Im guessing it's not a
permissions problem. For this part, locking mode is
optimistic, and I open the db objects like this (I have
possible updates):
CDatabase db;
CETATCMP rst(&db);
rst.SetLockingMode(CRecordset:ptimistic);
db.Open( _T(ODBC_DSN), false, false, _T
( "ODBC;UID=USERNAME" ), false);
rst.Open( CRecordset::dynaset,_T( "Some SQL with a where
clause"), CRecordset::none);
However, when another user (on another NT station) also
accesses this database, the first one gets locking
problems. The strange thing is that this user opens the
database with a recordset that is readOnly, so it
shouldn't affect the first user's operations.
Any help would be appreciated. Maybe there was a bug for
Access 97 / ODBC / Windows NT? I just noticed in my code
that even though my recordset is read only, the database
was opened as read-only so maybe there is something
there. However, from where I work I cannot reproduce this
problem, so it's hard for me to test, but I would still
like to get some info if someone has any...
Tank you very much,
Ian Benneth.
I have set up an application for one of my customers, and
Im having troubles managing concurrent accesses to a
database.
Users are working on Windows NT. The database is an
Access 97 database accessed through ODBC.
When I have only one user accessing the database at a
time, everything works fine, so Im guessing it's not a
permissions problem. For this part, locking mode is
optimistic, and I open the db objects like this (I have
possible updates):
CDatabase db;
CETATCMP rst(&db);
rst.SetLockingMode(CRecordset:ptimistic);
db.Open( _T(ODBC_DSN), false, false, _T
( "ODBC;UID=USERNAME" ), false);
rst.Open( CRecordset::dynaset,_T( "Some SQL with a where
clause"), CRecordset::none);
However, when another user (on another NT station) also
accesses this database, the first one gets locking
problems. The strange thing is that this user opens the
database with a recordset that is readOnly, so it
shouldn't affect the first user's operations.
Any help would be appreciated. Maybe there was a bug for
Access 97 / ODBC / Windows NT? I just noticed in my code
that even though my recordset is read only, the database
was opened as read-only so maybe there is something
there. However, from where I work I cannot reproduce this
problem, so it's hard for me to test, but I would still
like to get some info if someone has any...
Tank you very much,
Ian Benneth.