Re: Weired Problems with Dataset and Dataviews
From: One Handed Man \( OHM#\) ("One)
Date: 06/12/04
- Next message: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Previous message: Lars Netzel: "Re: program shut down when looping datagrid.."
- In reply to: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Next in thread: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Reply: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 12 Jun 2004 11:24:57 +0100
Actually, you should start with -1 and count down
OHM
"Lars Netzel" <nospam@no.no> wrote in message
news:uuuK0WGUEHA.3780@TK2MSFTNGP10.phx.gbl...
> Okay I understand what you mean and that actually solved another probelm..
> but not the problem I asked about in this thread.
>
> The problem is that if I use a DataView that has no records the
> Autoincrement starts on 0 whereas the Access Tables (that the DataView is
> based on) always start on 1... which is a bit of a problem. So when I add
a
> new row I see the ID field auto fills in a 0 but When I save, it becomes 1
> in the database... and then all the other information in the application
> based on that ID (which is 0 i runtime before I have saved) will be all
> messed up. Cause their ParentID is then 0 which does'nt exist.
>
> Maybe you misunderstood me OR maybe you actually answered me but I
> misunderstod you?
>
> I guess What I want is someway of telling the Dataview to start the
> Autoincrement on 1 and not 0....
>
> /Lars
>
>
>
>
>
> "Cor Ligthert" <notfirstname@planet.nl> skrev i meddelandet
> news:%23m4lk5FUEHA.808@tk2msftngp13.phx.gbl...
> > Hi Lars,
> >
> > Because the dataset is disconnected.
> > When you use autoincrement you would have to do always this
> >
> > ds.update(xx)
> > ds.fill(xx) 'with this it gets the assigned numbers
> >
> > After this it takes the last assigned number, even if another user has
> added
> > something between that in between.
> >
> > Therefore the next added number on your grid is not sure the correct
> number
> > when it is not updated, because again another user can have added a row
in
> > the table.
> >
> > I hope this gives the idea?
> >
> > Cor
> >
> > > myDataSet that is fillled from an Access 2000 db and includes ONE
table
> > >
> > > From that Table in myDataSet I create myDataView and use a Rowfilter
to
> > get
> > > a few rows that i work with (i need a DataView cause I do a lot of
> > > filtering)
> > >
> > > The problem is the primary key field (a unique counter), let's call it
> > > "TBL_ID".
> > >
> > > If I, after using the Rowfilter, end up with a DataView that has Zero
> > > records and I start adding a record (thru a datagrid) the TBL_ID field
> in
> > > the DataView will always start on 0... and then count upwards .. 1,
then
> > 2,
> > > then 3.. etc.
> > >
> > > BUT... If I, after using the Rowfilter, end up with a DataView that
has
> > more
> > > than one record, the TBL_ID field in the rows will be the right number
> > from
> > > the Table in the Access Database. If I get only one record and the
> TBL_ID
> > is
> > > 54... the next new record I create will be 55 and etc.... This is how
I
> > want
> > > it to act of course.
> > >
> > > Why will myDataView start on 0 when it has no rows? It's created from
> the
> > > Dataset that might have MANY records with ids...
> >
> >
>
>
- Next message: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Previous message: Lars Netzel: "Re: program shut down when looping datagrid.."
- In reply to: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Next in thread: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Reply: Lars Netzel: "Re: Weired Problems with Dataset and Dataviews"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|