ADODataset.insert and ADODataset.delete

The underlying table accessed with ADODataset1 is indexed and ADODataset is 
sorted (ascending) on this index.

I have the following loop scanning over the entire dataset:
 for I := 0 to ADODataSet1.RecordCount - 1 do
  begin
   if I = 0
    then
     begin
      ADODataSet1.First;
     end
    else
     begin
      ADODataSet1.Next;
     end;
   // Do_something (update, insert or delete);
  end;

Say that I have some consecutive records with indexes 3, 5, 7, 9

While record 5 is current I decide to delete this record.
Will record 7 automatically become the new current record?

While record 9 is current I decide to insert a new record that is given the 
index 8
Will ADODataset1.Next now make record 9 the current record again?

Will the for loop constants be updated so that I shall still correctly 
process every record in the dataset once? (Of course with the necessary 
precaution after an insert).

If the answer to any of these questions is "no" then I would appreciate some 
suggestion as to how I can process this dataset the way I intend.

regards Sven
0
Sven
12/16/2008 1:47:04 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

8 Replies
1767 Views

Similar Articles

[PageSpeed] 59

Hi Sven,

You should use this approach to loop over the result set.

while not ADODataset1.EOF do
   begin
   Do_Something();
   ADODataset1.Next;
   end;

hth,

Brian Hollister
0
Brian
12/16/2008 2:51:25 PM
Thanks, but what about ADODataset1.First ?

Can I successfully use .Next also to access the first record in the dataset? 
(Not according to documentation?)

And when I insert a new record that inserted record will become current. 
Which seems to imply that this inserted record is indexed immediately before 
the current record the "next" record after the insertion will (again) be the 
same as was current just before the insert?

regards Sven

"Brian Hollister" <bbop1322=AT=hotmail=DOT=com> wrote in message 
news:55811@forums.codegear.com...
> Hi Sven,
>
> You should use this approach to loop over the result set.
>
> while not ADODataset1.EOF do
>   begin
>   Do_Something();
>   ADODataset1.Next;
>   end;
>
> hth,
>
> Brian Hollister
0
Sven
12/17/2008 12:40:36 AM
> Thanks, but what about ADODataset1.First ?
> Can I successfully use .Next also to access the first record in the 
> dataset?
> (Not according to documentation?)

Right after the call to Open or setting the Active property to true the 
current record is supposed to be the first one. To make sure go ahead and 
call First.


> And when I insert a new record that inserted record will become current.
> Which seems to imply that this inserted record is indexed immediately 
> before
> the current record the "next" record after the insertion will (again) be 
> the
> same as was current just before the insert?


WHat is it that you are trying to accomplish? I try not to loop over a 
dataset in a row by row fashion as much as possible. Is it possible for you 
to just issue sql statements to accomplish what you want?


Brian
0
Brian
12/17/2008 1:31:31 PM
"Brian Hollister" <bbop1322=AT=hotmail=DOT=com> wrote in message 
news:56296@forums.codegear.com...
>> Thanks, but what about ADODataset1.First ?
>> Can I successfully use .Next also to access the first record in the 
>> dataset?
>> (Not according to documentation?)
>
> Right after the call to Open or setting the Active property to true the 
> current record is supposed to be the first one. To make sure go ahead and 
> call First.
>
>
>> And when I insert a new record that inserted record will become current.
>> Which seems to imply that this inserted record is indexed immediately 
>> before
>> the current record the "next" record after the insertion will (again) be 
>> the
>> same as was current just before the insert?
>
>
> WHat is it that you are trying to accomplish? I try not to loop over a 
> dataset in a row by row fashion as much as possible. Is it possible for 
> you to just issue sql statements to accomplish what you want?

Yes, I discovered the technique of calling First before entering the loop.

I did some experiments today and found that:

1: The current record is the first in the dataset with or without "First" 
being called. I shall call "first" just to comply with documentation.

2: Incidentally: I found that calling "first" seems to have no effect, not 
even if I toggle the "Active" property through "false" and back to "true" 
(executing the same SELECT command). The current record and the EOF state 
remained unchanged when calling "first". This is no big issue to me.

3: After a "Delete" the next record automatically became current.

4. After an "Insert" the inserted record became current (as documented), and 
the EOF property state became true with this "insert" action. (I can't 
remember seeing that in the documentation?)

What I want to accomplish is to update an access table as follows:

Delete obsolete rows.
Insert missing rows.
Update rows containing incorrect data.

I have found that deleting and updating pose no problem, but I have to delay 
inserting rows till after the scan is completed. Consequently I shall build 
a separate list of rows to be inserted and then insert them all as the last 
activity.

regards Sven
0
Sven
12/17/2008 4:49:38 PM
When I'm looping through records to perform Deletes, I always loop backwards.  That is, I start at the last record and use .Prior until I reach BOF.  This simplifies the navigation logic because you don't have to avoid navigation in cases in which you do delete the current record.  In other words, if you navigate forward (as you do) and you delete a record, then next record becomes the current record.  If you then do a .Next, you will move off of it even though it might also need to be deleted or processe
d in some other way.  But when you loop backwards, you can always do a .Prior until BOF without such concerns.

If your TADODataset only refers to records to be deleted, then you can loop like this

ds.Last;
while not ds.BOF
   ds.Delete;

Note that no Next or Prior are used.

> {quote:title=Sven Pran wrote:}{quote}
> "Brian Hollister" <bbop1322=AT=hotmail=DOT=com> wrote in message 
> news:56296@forums.codegear.com...
> >> Thanks, but what about ADODataset1.First ?
> >> Can I successfully use .Next also to access the first record in the 
> >> dataset?
> >> (Not according to documentation?)
> >
> > Right after the call to Open or setting the Active property to true the 
> > current record is supposed to be the first one. To make sure go ahead and 
> > call First.
> >
> >
> >> And when I insert a new record that inserted record will become current.
> >> Which seems to imply that this inserted record is indexed immediately 
> >> before
> >> the current record the "next" record after the insertion will (again) be 
> >> the
> >> same as was current just before the insert?
> >
> >
> > WHat is it that you are trying to accomplish? I try not to loop over a 
> > dataset in a row by row fashion as much as possible. Is it possible for 
> > you to just issue sql statements to accomplish what you want?
> 
> Yes, I discovered the technique of calling First before entering the loop.
> 
> I did some experiments today and found that:
> 
> 1: The current record is the first in the dataset with or without "First" 
> being called. I shall call "first" just to comply with documentation.
> 
> 2: Incidentally: I found that calling "first" seems to have no effect, not 
> even if I toggle the "Active" property through "false" and back to "true" 
> (executing the same SELECT command). The current record and the EOF state 
> remained unchanged when calling "first". This is no big issue to me.
> 
> 3: After a "Delete" the next record automatically became current.
> 
> 4. After an "Insert" the inserted record became current (as documented), and 
> the EOF property state became true with this "insert" action. (I can't 
> remember seeing that in the documentation?)
> 
> What I want to accomplish is to update an access table as follows:
> 
> Delete obsolete rows.
> Insert missing rows.
> Update rows containing incorrect data.
> 
> I have found that deleting and updating pose no problem, but I have to delay 
> inserting rows till after the scan is completed. Consequently I shall build 
> a separate list of rows to be inserted and then insert them all as the last 
> activity.
> 
> regards Sven
0
Michael
12/24/2008 3:47:42 PM
Good idea, I shall keep that one in mind.
Deleting records through ADO hasn't been much pf a problem though because i 
never physically delete records this way, I only mark them with a boolean 
"extint" field (or similar) set to "true". Inserting new records did indeed 
pose a problem which I solved by adding them to a (temporary) TList during 
the scan and then actually adding them to the dataset after the scan is 
completed.

And rather than physically deleting records through an ADODataset recordset 
I believe it is much more efficient to use a DELETEROWS SQL statement 
instead of a SELECT statement. (I believe DELETEROWS was the SQL command I 
found, I haven't used it yet.)

regards Sven

"Michael Verhagen" wrote in message news:59154@forums.codegear.com...
> When I'm looping through records to perform Deletes, I always loop 
> backwards.  That is, I start at the last record and use .Prior until I 
> reach BOF.  This simplifies the navigation logic because you don't have to 
> avoid navigation in cases in which you do delete the current record.  In 
> other words, if you navigate forward (as you do) and you delete a record, 
> then next record becomes the current record.  If you then do a .Next, you 
> will move off of it even though it might also need to be deleted or 
> processe
> d in some other way.  But when you loop backwards, you can always do a 
> .Prior until BOF without such concerns.
>
> If your TADODataset only refers to records to be deleted, then you can 
> loop like this
>
> ds.Last;
> while not ds.BOF
>   ds.Delete;
>
> Note that no Next or Prior are used.
>
>> {quote:title=Sven Pran wrote:}{quote}
>> "Brian Hollister" <bbop1322=AT=hotmail=DOT=com> wrote in message
>> news:56296@forums.codegear.com...
>> >> Thanks, but what about ADODataset1.First ?
>> >> Can I successfully use .Next also to access the first record in the
>> >> dataset?
>> >> (Not according to documentation?)
>> >
>> > Right after the call to Open or setting the Active property to true the
>> > current record is supposed to be the first one. To make sure go ahead 
>> > and
>> > call First.
>> >
>> >
>> >> And when I insert a new record that inserted record will become 
>> >> current.
>> >> Which seems to imply that this inserted record is indexed immediately
>> >> before
>> >> the current record the "next" record after the insertion will (again) 
>> >> be
>> >> the
>> >> same as was current just before the insert?
>> >
>> >
>> > WHat is it that you are trying to accomplish? I try not to loop over a
>> > dataset in a row by row fashion as much as possible. Is it possible for
>> > you to just issue sql statements to accomplish what you want?
>>
>> Yes, I discovered the technique of calling First before entering the 
>> loop.
>>
>> I did some experiments today and found that:
>>
>> 1: The current record is the first in the dataset with or without "First"
>> being called. I shall call "first" just to comply with documentation.
>>
>> 2: Incidentally: I found that calling "first" seems to have no effect, 
>> not
>> even if I toggle the "Active" property through "false" and back to "true"
>> (executing the same SELECT command). The current record and the EOF state
>> remained unchanged when calling "first". This is no big issue to me.
>>
>> 3: After a "Delete" the next record automatically became current.
>>
>> 4. After an "Insert" the inserted record became current (as documented), 
>> and
>> the EOF property state became true with this "insert" action. (I can't
>> remember seeing that in the documentation?)
>>
>> What I want to accomplish is to update an access table as follows:
>>
>> Delete obsolete rows.
>> Insert missing rows.
>> Update rows containing incorrect data.
>>
>> I have found that deleting and updating pose no problem, but I have to 
>> delay
>> inserting rows till after the scan is completed. Consequently I shall 
>> build
>> a separate list of rows to be inserted and then insert them all as the 
>> last
>> activity.
>>
>> regards Sven
0
Sven
12/24/2008 9:37:30 PM
For sure, if you are using a "recycling scheme" instead of real deletions, then my suggestion doesn't apply.

And I also would typically use a DELETE in TADOCommand when I want to delete selected records.  However, sometimes I've already got a TADODataSet with exactly the records that I need to delete, so it is just very easy to walk that entire result set and delete them.  This would usually be 1 to 5 and never more than a few dozen records in that scenario.

> {quote:title=Sven Pran wrote:}{quote}
> Good idea, I shall keep that one in mind.
> Deleting records through ADO hasn't been much pf a problem though because i 
> never physically delete records this way, I only mark them with a boolean 
> "extint" field (or similar) set to "true". Inserting new records did indeed 
> pose a problem which I solved by adding them to a (temporary) TList during 
> the scan and then actually adding them to the dataset after the scan is 
> completed.
> 
> And rather than physically deleting records through an ADODataset recordset 
> I believe it is much more efficient to use a DELETEROWS SQL statement 
> instead of a SELECT statement. (I believe DELETEROWS was the SQL command I 
> found, I haven't used it yet.)
> 
> regards Sven
> 
> "Michael Verhagen" wrote in message news:59154@forums.codegear.com...
> > When I'm looping through records to perform Deletes, I always loop 
> > backwards.  That is, I start at the last record and use .Prior until I 
> > reach BOF.  This simplifies the navigation logic because you don't have to 
> > avoid navigation in cases in which you do delete the current record.  In 
> > other words, if you navigate forward (as you do) and you delete a record, 
> > then next record becomes the current record.  If you then do a .Next, you 
> > will move off of it even though it might also need to be deleted or 
> > processe
> > d in some other way.  But when you loop backwards, you can always do a 
> > .Prior until BOF without such concerns.
> >
> > If your TADODataset only refers to records to be deleted, then you can 
> > loop like this
> >
> > ds.Last;
> > while not ds.BOF
> >   ds.Delete;
> >
> > Note that no Next or Prior are used.
> >
> >> {quote:title=Sven Pran wrote:}{quote}
> >> "Brian Hollister" <bbop1322=AT=hotmail=DOT=com> wrote in message
> >> news:56296@forums.codegear.com...
> >> >> Thanks, but what about ADODataset1.First ?
> >> >> Can I successfully use .Next also to access the first record in the
> >> >> dataset?
> >> >> (Not according to documentation?)
> >> >
> >> > Right after the call to Open or setting the Active property to true the
> >> > current record is supposed to be the first one. To make sure go ahead 
> >> > and
> >> > call First.
> >> >
> >> >
> >> >> And when I insert a new record that inserted record will become 
> >> >> current.
> >> >> Which seems to imply that this inserted record is indexed immediately
> >> >> before
> >> >> the current record the "next" record after the insertion will (again) 
> >> >> be
> >> >> the
> >> >> same as was current just before the insert?
> >> >
> >> >
> >> > WHat is it that you are trying to accomplish? I try not to loop over a
> >> > dataset in a row by row fashion as much as possible. Is it possible for
> >> > you to just issue sql statements to accomplish what you want?
> >>
> >> Yes, I discovered the technique of calling First before entering the 
> >> loop.
> >>
> >> I did some experiments today and found that:
> >>
> >> 1: The current record is the first in the dataset with or without "First"
> >> being called. I shall call "first" just to comply with documentation.
> >>
> >> 2: Incidentally: I found that calling "first" seems to have no effect, 
> >> not
> >> even if I toggle the "Active" property through "false" and back to "true"
> >> (executing the same SELECT command). The current record and the EOF state
> >> remained unchanged when calling "first". This is no big issue to me.
> >>
> >> 3: After a "Delete" the next record automatically became current.
> >>
> >> 4. After an "Insert" the inserted record became current (as documented), 
> >> and
> >> the EOF property state became true with this "insert" action. (I can't
> >> remember seeing that in the documentation?)
> >>
> >> What I want to accomplish is to update an access table as follows:
> >>
> >> Delete obsolete rows.
> >> Insert missing rows.
> >> Update rows containing incorrect data.
> >>
> >> I have found that deleting and updating pose no problem, but I have to 
> >> delay
> >> inserting rows till after the scan is completed. Consequently I shall 
> >> build
> >> a separate list of rows to be inserted and then insert them all as the 
> >> last
> >> activity.
> >>
> >> regards Sven
0
Michael
12/24/2008 10:11:45 PM
The dataset that caused me to present the questions in my original post 
contains license information on individuals for whom some kind of annual 
license is issued. A license issued in November or December is valid through 
the following year.

It frequently happens that a license is issued in error and is revoked until 
the situation is resolved so I cannot just physically delete such records 
from the database, these are instead flagged as NOT OK.

Each year (in January) I physically 'DELETE' all records that have been 
issued for the previous year; this is most efficiently done directly in 
Access not involving ADO at all. (And even with ADO I should "DELETE ... 
WHERE YEAR < CURRENTYEAR'

Regards Sven


"Michael Verhagen" wrote in message news:59262@forums.codegear.com...
> For sure, if you are using a "recycling scheme" instead of real deletions, 
> then my suggestion doesn't apply.
>
> And I also would typically use a DELETE in TADOCommand when I want to 
> delete selected records.  However, sometimes I've already got a 
> TADODataSet with exactly the records that I need to delete, so it is just 
> very easy to walk that entire result set and delete them.  This would 
> usually be 1 to 5 and never more than a few dozen records in that 
> scenario.
>
>> {quote:title=Sven Pran wrote:}{quote}
>> Good idea, I shall keep that one in mind.
>> Deleting records through ADO hasn't been much pf a problem though because 
>> i
>> never physically delete records this way, I only mark them with a boolean
>> "extint" field (or similar) set to "true". Inserting new records did 
>> indeed
>> pose a problem which I solved by adding them to a (temporary) TList 
>> during
>> the scan and then actually adding them to the dataset after the scan is
>> completed.
>>
>> And rather than physically deleting records through an ADODataset 
>> recordset
>> I believe it is much more efficient to use a DELETEROWS SQL statement
>> instead of a SELECT statement. (I believe DELETEROWS was the SQL command 
>> I
>> found, I haven't used it yet.)
>>
>> regards Sven
>>
>> "Michael Verhagen" wrote in message news:59154@forums.codegear.com...
>> > When I'm looping through records to perform Deletes, I always loop
>> > backwards.  That is, I start at the last record and use .Prior until I
>> > reach BOF.  This simplifies the navigation logic because you don't have 
>> > to
>> > avoid navigation in cases in which you do delete the current record. 
>> > In
>> > other words, if you navigate forward (as you do) and you delete a 
>> > record,
>> > then next record becomes the current record.  If you then do a .Next, 
>> > you
>> > will move off of it even though it might also need to be deleted or
>> > processe
>> > d in some other way.  But when you loop backwards, you can always do a
>> > .Prior until BOF without such concerns.
>> >
>> > If your TADODataset only refers to records to be deleted, then you can
>> > loop like this
>> >
>> > ds.Last;
>> > while not ds.BOF
>> >   ds.Delete;
>> >
>> > Note that no Next or Prior are used.
>> >
>> >> {quote:title=Sven Pran wrote:}{quote}
>> >> "Brian Hollister" <bbop1322=AT=hotmail=DOT=com> wrote in message
>> >> news:56296@forums.codegear.com...
>> >> >> Thanks, but what about ADODataset1.First ?
>> >> >> Can I successfully use .Next also to access the first record in the
>> >> >> dataset?
>> >> >> (Not according to documentation?)
>> >> >
>> >> > Right after the call to Open or setting the Active property to true 
>> >> > the
>> >> > current record is supposed to be the first one. To make sure go 
>> >> > ahead
>> >> > and
>> >> > call First.
>> >> >
>> >> >
>> >> >> And when I insert a new record that inserted record will become
>> >> >> current.
>> >> >> Which seems to imply that this inserted record is indexed 
>> >> >> immediately
>> >> >> before
>> >> >> the current record the "next" record after the insertion will 
>> >> >> (again)
>> >> >> be
>> >> >> the
>> >> >> same as was current just before the insert?
>> >> >
>> >> >
>> >> > WHat is it that you are trying to accomplish? I try not to loop over 
>> >> > a
>> >> > dataset in a row by row fashion as much as possible. Is it possible 
>> >> > for
>> >> > you to just issue sql statements to accomplish what you want?
>> >>
>> >> Yes, I discovered the technique of calling First before entering the
>> >> loop.
>> >>
>> >> I did some experiments today and found that:
>> >>
>> >> 1: The current record is the first in the dataset with or without 
>> >> "First"
>> >> being called. I shall call "first" just to comply with documentation.
>> >>
>> >> 2: Incidentally: I found that calling "first" seems to have no effect,
>> >> not
>> >> even if I toggle the "Active" property through "false" and back to 
>> >> "true"
>> >> (executing the same SELECT command). The current record and the EOF 
>> >> state
>> >> remained unchanged when calling "first". This is no big issue to me.
>> >>
>> >> 3: After a "Delete" the next record automatically became current.
>> >>
>> >> 4. After an "Insert" the inserted record became current (as 
>> >> documented),
>> >> and
>> >> the EOF property state became true with this "insert" action. (I can't
>> >> remember seeing that in the documentation?)
>> >>
>> >> What I want to accomplish is to update an access table as follows:
>> >>
>> >> Delete obsolete rows.
>> >> Insert missing rows.
>> >> Update rows containing incorrect data.
>> >>
>> >> I have found that deleting and updating pose no problem, but I have to
>> >> delay
>> >> inserting rows till after the scan is completed. Consequently I shall
>> >> build
>> >> a separate list of rows to be inserted and then insert them all as the
>> >> last
>> >> activity.
>> >>
>> >> regards Sven
0
Sven
12/25/2008 1:50:52 AM
Reply:

Similar Artilces:

Local delete with ADODataSet
Hi all, There´s a disconnected ADODataSet with local fields. A ADOStoredProc gets the recordset and assign it to the ADODataSet: .... ADODataSet.CreateDataSet; ADODataSet.Recordset := ADPStoredProc.Recorset; ADODataSet.Connection := nil; .... Them problem is that when call ADODataSet.Delete the delete command is sent to the database and the records are deleted. I need to delete this records only in the recordset to be possible to cancel this changes. I guess the "ghost connection" is comming to the ADODataSet by the second line ADODataSet.Recordset := ADPSto...

ADODataSet
Hi there, I need to access the field's data of deleted rows in an ADODataSet but they get hide when in this status. Is there some way to access this data? Thanks, Luciano Rodrigues Luciano Rodrigues skrev: > Hi there, > > I need to access the field's data of deleted rows in an ADODataSet but they get hide when in this status. > Is there some way to access this data? > > Thanks, > > Luciano Rodrigues Hi! Set FilterGroup property to fgPendingRecords and set Filtered property to True. You can use UpdateStatus property to check if t...

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

Insert/Delete/Delete all rows
Hi Neither in data window painter nor in data base painter I can Insert, Delete and Delete all Rows for a table. These Items are in both painters gray and can,t been selected. Is something wrong on my installation of PB? PB 7.02 (Build 8030) Can someone help me? Thanks Taghi Pouradjam Does your table have a primary key defined? -- <hopethishelps /> Roy Kiesler [TeamSybase] mySybase -- http://my.sybase.com "Taghi Pouradjam" <pouradjam@oasys.de> wrote in message news:OzIH97fiAHA.128@forums.sybase.com... > Hi > > Neither in data wi...

Delphi program with ADOQUERY and ADODATASET
I wrote a Delphi program that uses ADO to access Oracle, and it has 2 dbgrids, one with a datasource that points to ADOQUERY1 and the other dbgrid and datasource point to ADODataset1. Both grids show data.. As expected, the ADOQUERY has its connection property set to the ADOCONNECTION. When I leave the adoconnection inactive and never activate it in code, the DBGRID shows no data, as the query no longer has an active connection, but to my surprise the ADODATASET continues to display data. I can see that, there is a connection string that includes text that says "provider=msdaora&q...

VS2005 - using detailsview to update, insert and delete rows from SQL 2005 database. Delete and insert work but update does not
  Using VS 2005 DetailsView to insert, delete, and update rows in SQL 2005 database.  insert and delete work but update does not.  I recieve no errors and the detailsView comes back unchanged (as well as table row is unchanged).   I am trying to use as little code behind as possible. However I do have ItemUpdating routines that seem to work (i.e Checking table for new login duplicates and encrypting passwords).  The following is the source code generated by VS2005:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="frmDbRegionMgr...

Delphi 6 to Delphi 2010 upgrade and ADO
We have an application written in Delphi 6 Professional that uses ADO to access databases servers that may be on other PCs in our network. We want to move to Delphi 2010 but can't decide if we need Professional or Enterprise. 2010 Pro has dbGO - will this give us the same functionality as the ADO components we use in Delphi 6 Pro? Thanks, Keith > 2010 Pro has dbGO - will this give us the same functionality as the > ADO components we use in Delphi 6 Pro? Yes. > {quote:title=Joachim Uersfeld wrote:}{quote} > > 2010 Pro has dbGO - will this give us the same func...

ASA7 ADO & Delphi ADO ?? Anyone is using it?
Any comments? Is it working? Any Problems? Thanks Hi, PR <noemail@no.com> schrieb in im Newsbeitrag: BoTThJaq$GA.89@forums.sybase.com... > Any comments? Is it working? Any Problems? I tried to connect to ASA7 via the new OLE DB - Provider and ADOExpress from Delphi 5.01. No chance. Only the error message 'Invalid Enum Value'. About the new provider I haven't heard anything good until now... Regards Frank Frank, I've experienced the same problem with the ASA 7 OLEDB Provider. I'm not sure if this is a bug in the AsaProvider or Delp...

delete then insert
hello all! I am using PB7.03 and ASA6.0. In a dw with "delete then insert" update property, after i set one row's key column to be equal to another row's and clicked on the update button.DBerror event triggered and informed me about key column duplication.Till now everything is right, but if i don't fix the value and click the update button again, dberror triggered again and saying that row changed between retrieve and update! Immediate i went to the db and finding that the original row is deleted! I think the row shouldn't be deleted at all because th...

Deletes are not being deleted.
Using ASA 7.03 I am having a problem in deleting field service orders that have been completed. Just getting started with sync so I am probably making a dumb mistake or just leaving out a step. The download_delete_cursor script is: Select ordernumber from ServiceOrderEntryMaster where Tech = ? and Order_Complete = 'Y' This based on the verbose reply from the MobiLink Synchronization server is picking the correct work order ( number 326 ) and showing a Delete Row line in the log. But the work order is not being deleted on the remote side. What could I be doing wron...

Insert not Inserting?
Hi guys, i've spent days trying to fig this out but it's passed me. i've basically got down to basics and I can't get information inserted into the db. I have a page with an accessdatasource with an insert command of : INSERT INTO [tblName] ([Name]) VALUES (?) I then have a button on the form with : protected void Button1_Click(object sender, EventArgs e) { AccessDataSource1.InsertParameters.Add("name","test"); Response.Write(AccessDataSource1.Insert().ToString()); }  the insert statement brings back 1 but when I goto the db it has the autogen...

Delete/Insert
Edited by SomeNewKid. Please post code between <code> and </code> tags. i'm trying to delete a record and then add a new one when i press edit button visual basic code: -------------------------------------------------------------------------------- Private Sub BtnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEdit.Click Dim cmdDelete As New SqlCommand("Delete from Staff where Staff_ID= '" & Trim(txtstfID.Text) & "'", connection) cmdDelete.ExecuteNonQuery() Dim cmdInsert As New Sql...

Displaying "Insert, Delete, Update" Messages when data inserted in the database
Hi, Whenever we insert/delete/update data in the database after the operation we display the message to the user that operation was successfull or not. Some of us do something like this: public bool InsertData(int personID, string name) { try { // Insert data return true; } catch(Exception ex) { // logg the exception return false; } } The caller program will look something like this: isInserted = InsertData(personId,Name); if(isInserted) { lblMessage.Text = "data inserted"; } else ...

formview: insert/delete a success but doesnt fire inserted/delelted events -- help!
 I have a formview which retrieves data from a SQL connection. when the forrmview is either deleted or inserted, the data goes into the database...but the page just freezes! (i have an AJAX update panel the "loading" image i have just continues to play...) I have looked into the database and all of the data is inserted/deleted correctly, but the inserted/deleted events wont fire. what can cause this? help is needed badly! Hi:   I'm not sure what do you mean by "the page just freezes". Troubleshooting: 1. The FormView's insert/delete wil...

Web resources about - ADODataset.insert and ADODataset.delete - embarcadero.delphi.ado

Resources last updated: 1/18/2016 2:47:49 AM