Board index » delphi » D5-ADO-MS ACCESS 97 database-MS Office 97 Access ODBC driver-Autoincrement probs

D5-ADO-MS ACCESS 97 database-MS Office 97 Access ODBC driver-Autoincrement probs

Hello guys,

    I have a small application for which i have used D5 Enterprise, Access
79 database (All my earlier work was in MS SQL Server 7(BDE/ADO)  and
paradox (BDE). I am facing the following problem.

    The connectivity is as under.

1. D5 Enterprise.
2. ADO.
3. Access 97.
4. Access 97 ODBC driver.
    (connection string -
Provider=MSDASQL.1;Persist Security Info=False;Connect Timeout=15;Extended
Properties="DSN=MS Access 97
Database;DBQ=D:\sunil\delphi5\scorer\scorer.mdb;DefaultDir=D:\sunil\delphi5\
scorer;DriverId=281;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;";Locale
Identifier=1033;Initial Catalog=D:\sunil\delphi5\scorer\scorer)

    In the persistent fields editor, i have set the value for the
autoincrement key field as

    Autogeneratevalue=arautoinc
    providerflags=pflnkey

    When a row is added to this table in a grid, the autoincrement field
takes a default value of 0 on post. But the actual value of this inthe table
is something different. Now if i try to refresh this table, it tells me that
the value has been changed at the database level and the grid gets cleared.
If i re-open the table, all the values are shown.

    Server side dynamic cursors are not supported by the ODBC driver.

    Can someone tell me how to get the actual value on post. (i have tried
requery and refresh after post. refresh raises the above error)

    Thanks in advance,

Sunil Furtado
New Mangalore Port Trust

 

Re:D5-ADO-MS ACCESS 97 database-MS Office 97 Access ODBC driver-Autoincrement probs


First , you mention ADO and ODBC. The ADO components connect directly to the
access DB via the jet engine supplied with access/mdac update. Try using ADO
connection builder to connect to the database and then see what you get.

Quote
Sunil Furtado wrote in message <39890f12_1@dnews>...
>Hello guys,

>    I have a small application for which i have used D5 Enterprise, Access
>79 database (All my earlier work was in MS SQL Server 7(BDE/ADO)  and
>paradox (BDE). I am facing the following problem.

>    The connectivity is as under.

>1. D5 Enterprise.
>2. ADO.
>3. Access 97.
>4. Access 97 ODBC driver.
>    (connection string -
>Provider=MSDASQL.1;Persist Security Info=False;Connect Timeout=15;Extended
>Properties="DSN=MS Access 97
>Database;DBQ=D:\sunil\delphi5\scorer\scorer.mdb;DefaultDir=D:\sunil\delphi5
\
>scorer;DriverId=281;FIL=MS
>Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;";Locale
>Identifier=1033;Initial Catalog=D:\sunil\delphi5\scorer\scorer)

>    In the persistent fields editor, i have set the value for the
>autoincrement key field as

>    Autogeneratevalue=arautoinc
>    providerflags=pflnkey

>    When a row is added to this table in a grid, the autoincrement field
>takes a default value of 0 on post. But the actual value of this inthe
table
>is something different. Now if i try to refresh this table, it tells me
that
>the value has been changed at the database level and the grid gets cleared.
>If i re-open the table, all the values are shown.

>    Server side dynamic cursors are not supported by the ODBC driver.

>    Can someone tell me how to get the actual value on post. (i have tried
>requery and refresh after post. refresh raises the above error)

>    Thanks in advance,

>Sunil Furtado
>New Mangalore Port Trust

Re:D5-ADO-MS ACCESS 97 database-MS Office 97 Access ODBC driver-Autoincrement probs


This problem doesn't exist with Access 2000. With Access 97 there's no
solution that I know of other than Requery. It's best to upgrade to 2000.

HTH
--
V. Nazarov
IT Manager, Sofia Cable

Re:D5-ADO-MS ACCESS 97 database-MS Office 97 Access ODBC driver-Autoincrement probs


Quote
>   In the persistent fields editor, i have set the value for the
>autoincrement key field as

>    Autogeneratevalue=arautoinc
>    providerflags=pflnkey

This is only going to work right if you move to Access 2000

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads