Board index » delphi » Insert doesn't work correctly on Acces 97 with ADO

Insert doesn't work correctly on Acces 97 with ADO

my application connects to an Access97 mdb-file. the insert doesn't work
correctly .. autocount-fields are set to Null (after Post to 0) and
DefaultValues are not set.
Does anybody know how to fix it??

thanx

 

Re:Insert doesn't work correctly on Acces 97 with ADO


some additional information.
it's only the update that doesn't work .. closing the table and opening it
again shows that the post itself is working fine.

i tried updating the mdac to 2.7 ... no difference

the problem can be seen using the /demos/ado/adotest - sample

Dirk

Quote
"D. Riemer" <Dirk.Rie...@cgey.com> wrote in message

news:3d2b05a2$1_2@dnews...
Quote
> my application connects to an Access97 mdb-file. the insert doesn't work
> correctly .. autocount-fields are set to Null (after Post to 0) and
> DefaultValues are not set.
> Does anybody know how to fix it??

> thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


You might check the dynamic property "Update Criteria". I know you can set
this to
retrieve the autonumber and defaults after an insert or update.

Jeff Langston
Cashless Systems Inc.
JeffLangs...@CashlessSystems.com

Quote
"D. Riemer" <Dirk.Rie...@cgey.com> wrote in message

news:3d2b05a2$1_2@dnews...
Quote
> my application connects to an Access97 mdb-file. the insert doesn't work
> correctly .. autocount-fields are set to Null (after Post to 0) and
> DefaultValues are not set.
> Does anybody know how to fix it??

> thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


This is the correct statement. You can issue this statement in the event
OnRecorsetCreate.

ADODataSet1.Recordset.Properties['Update Resync'].Value :=
    adResyncAutoIncrement + adResyncUpdates + adResyncInserts;

Jeff Langston
Cashless Systems Inc.
JeffLangs...@CashlessSystems.com

Quote
"Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message

news:3d2b1bc0$1_2@dnews...
Quote
> You might check the dynamic property "Update Criteria". I know you can set
> this to
> retrieve the autonumber and defaults after an insert or update.

> Jeff Langston
> Cashless Systems Inc.
> JeffLangs...@CashlessSystems.com

> "D. Riemer" <Dirk.Rie...@cgey.com> wrote in message
> news:3d2b05a2$1_2@dnews...
> > my application connects to an Access97 mdb-file. the insert doesn't work
> > correctly .. autocount-fields are set to Null (after Post to 0) and
> > DefaultValues are not set.
> > Does anybody know how to fix it??

> > thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


Thank U .. could U tell me which Unit I need for the ad.. constants?
Quote
"Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message

news:3d2b1cf6_1@dnews...
Quote
> This is the correct statement. You can issue this statement in the event
> OnRecorsetCreate.

> ADODataSet1.Recordset.Properties['Update Resync'].Value :=
>     adResyncAutoIncrement + adResyncUpdates + adResyncInserts;

> Jeff Langston
> Cashless Systems Inc.
> JeffLangs...@CashlessSystems.com

> "Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message
> news:3d2b1bc0$1_2@dnews...
> > You might check the dynamic property "Update Criteria". I know you can
set
> > this to
> > retrieve the autonumber and defaults after an insert or update.

> > Jeff Langston
> > Cashless Systems Inc.
> > JeffLangs...@CashlessSystems.com

> > "D. Riemer" <Dirk.Rie...@cgey.com> wrote in message
> > news:3d2b05a2$1_2@dnews...
> > > my application connects to an Access97 mdb-file. the insert doesn't
work
> > > correctly .. autocount-fields are set to Null (after Post to 0) and
> > > DefaultValues are not set.
> > > Does anybody know how to fix it??

> > > thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


I found out .. ADOInt contains the constants

doesn't seem to work .. i get an EOLEException (Row handle referred to a
deleted row or row marked for deletion) .. i have got no special code around
just a table, a dbnav and a dbgrid plus the code as U proposed.

thanks anyway
greetz Dirk

Quote
"Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message

news:3d2b1bc0$1_2@dnews...
Quote
> You might check the dynamic property "Update Criteria". I know you can set
> this to
> retrieve the autonumber and defaults after an insert or update.

> Jeff Langston
> Cashless Systems Inc.
> JeffLangs...@CashlessSystems.com

> "D. Riemer" <Dirk.Rie...@cgey.com> wrote in message
> news:3d2b05a2$1_2@dnews...
> > my application connects to an Access97 mdb-file. the insert doesn't work
> > correctly .. autocount-fields are set to Null (after Post to 0) and
> > DefaultValues are not set.
> > Does anybody know how to fix it??

> > thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


Sorry it is in ADOInt.pas

Jeff Langston
Cashless Systems Inc.
JeffLangs...@CashlessSystems.com

Quote
"Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message

news:3d2b211e_1@dnews...
Quote
> I think:

> uses
>     ADODB;

> Jeff Langston
> Cashless Systems Inc.
> JeffLangs...@CashlessSystems.com

> "D. Riemer" <Dirk.Rie...@cgey.com> wrote in message
> news:3d2b209d$1_2@dnews...
> > Thank U .. could U tell me which Unit I need for the ad.. constants?
> > "Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message
> > news:3d2b1cf6_1@dnews...
> > > This is the correct statement. You can issue this statement in the
event
> > > OnRecorsetCreate.

> > > ADODataSet1.Recordset.Properties['Update Resync'].Value :=
> > >     adResyncAutoIncrement + adResyncUpdates + adResyncInserts;

> > > Jeff Langston
> > > Cashless Systems Inc.
> > > JeffLangs...@CashlessSystems.com

> > > "Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message
> > > news:3d2b1bc0$1_2@dnews...
> > > > You might check the dynamic property "Update Criteria". I know you
can
> > set
> > > > this to
> > > > retrieve the autonumber and defaults after an insert or update.

> > > > Jeff Langston
> > > > Cashless Systems Inc.
> > > > JeffLangs...@CashlessSystems.com

> > > > "D. Riemer" <Dirk.Rie...@cgey.com> wrote in message
> > > > news:3d2b05a2$1_2@dnews...
> > > > > my application connects to an Access97 mdb-file. the insert
doesn't
> > work
> > > > > correctly .. autocount-fields are set to Null (after Post to 0)
and
> > > > > DefaultValues are not set.
> > > > > Does anybody know how to fix it??

> > > > > thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


I think:

uses
    ADODB;

Jeff Langston
Cashless Systems Inc.
JeffLangs...@CashlessSystems.com

Quote
"D. Riemer" <Dirk.Rie...@cgey.com> wrote in message

news:3d2b209d$1_2@dnews...
Quote
> Thank U .. could U tell me which Unit I need for the ad.. constants?
> "Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message
> news:3d2b1cf6_1@dnews...
> > This is the correct statement. You can issue this statement in the event
> > OnRecorsetCreate.

> > ADODataSet1.Recordset.Properties['Update Resync'].Value :=
> >     adResyncAutoIncrement + adResyncUpdates + adResyncInserts;

> > Jeff Langston
> > Cashless Systems Inc.
> > JeffLangs...@CashlessSystems.com

> > "Jeff Langston" <JeffLangs...@CashlessSystems.com> wrote in message
> > news:3d2b1bc0$1_2@dnews...
> > > You might check the dynamic property "Update Criteria". I know you can
> set
> > > this to
> > > retrieve the autonumber and defaults after an insert or update.

> > > Jeff Langston
> > > Cashless Systems Inc.
> > > JeffLangs...@CashlessSystems.com

> > > "D. Riemer" <Dirk.Rie...@cgey.com> wrote in message
> > > news:3d2b05a2$1_2@dnews...
> > > > my application connects to an Access97 mdb-file. the insert doesn't
> work
> > > > correctly .. autocount-fields are set to Null (after Post to 0) and
> > > > DefaultValues are not set.
> > > > Does anybody know how to fix it??

> > > > thanx

Re:Insert doesn't work correctly on Acces 97 with ADO


Quote
>my application connects to an Access97 mdb-file. the insert doesn't work
>correctly .. autocount-fields are set to Null (after Post to 0)
>Does anybody know how to fix it??

You need to use Jet 4.0 provider to get this capability
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Insert doesn't work correctly on Acces 97 with ADO


I do use Jet 4.0 as far as I can see
here are the corresponding TADOConnection values

connection string :
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=[...].mdb;Mode=Share Deny None;Extended Properties="";Jet
OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database
Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet
OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet
OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet
OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet
OLEDB:SFP=False

provider
Microsoft.Jet.OLEDB.4.0

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:4m8niu8jke1utarngbrjdg5n5u71m1a6nk@4ax.com...

Quote

> >my application connects to an Access97 mdb-file. the insert doesn't work
> >correctly .. autocount-fields are set to Null (after Post to 0)
> >Does anybody know how to fix it??
> You need to use Jet 4.0 provider to get this capability
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:Insert doesn't work correctly on Acces 97 with ADO


Quote
>I do use Jet 4.0 as far as I can see
>here are the corresponding TADOConnection values

I believe you will also have to change the database to Access 2000 format if you
want autoincrement values returned.

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

Other Threads