ADODataSet - Deleted rows data

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
0
Luciano
8/12/2008 11:46:02 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

5 Replies
1088 Views

Similar Articles

[PageSpeed] 15

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 the current record is 
deleted and if you want to access values of the deleted record you have 
to use OldValue property of TField.

ADODataSet1.FilterGroup := fgPendingRecords;
ADODataSet1.Filtered := True;

if ADODataSet1.UpdateStatus = usDeleted then
   ShowMessage(ADODataSet1.FieldByName('FieldName').OldValue);

regards

/Micke
0
Mikael
8/13/2008 7:25:27 AM
Hi Micke, 

It's raising this error when access the field value: (assinging it to a variable or even using  ShowMessage)

Project Imobi.exe raised exception class EOleException with message 'Either BOF or EOF is True,
or current record has been deleted. Requested operation requires a current record'.Process stopped.Use Step or Run to continue. 

Best regards,

Luciano RM

> {quote:title=Mikael Eriksson wrote:}{quote}
> 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 the current record is 
> deleted and if you want to access values of the deleted record you have 
> to use OldValue property of TField.
> 
> ADODataSet1.FilterGroup := fgPendingRecords;
> ADODataSet1.Filtered := True;
> 
> if ADODataSet1.UpdateStatus = usDeleted then
>    ShowMessage(ADODataSet1.FieldByName('FieldName').OldValue);
> 
> regards
> 
> /Micke
0
Luciano
8/13/2008 11:59:04 AM
Luciano Rodrigues skrev:
> Project Imobi.exe raised exception class EOleException with message 'Either BOF or EOF is True,
> or current record has been deleted. Requested operation requires a current record'.Process stopped.Use Step or Run to continue. 


Hi,

I have no idea why you get that error. We are probably not using the 
same setup.

I use a disconnected ADO recordset retrieved from MS SQL Server 2005.
fgPendingRecords filter shows all modifications to that recordset not 
applied back to the server.

regards

/Micke
0
Mikael
8/15/2008 8:53:48 AM
Hi,

Thanks Micke, you got the point, the cause is the DBGrid/DataSource connected to the ADODataSet. It's the only DB control used. For now, I'm going to set the DataSource's DataSet property to nill at runtime until get a better solution.

Best regards,

Luciano RM

> {quote:title=Mikael Eriksson wrote:}{quote}
> Hi,
> 
> I have no idea why you get that error. We are probably not using the 
> same setup.
> 
> I use a disconnected ADO recordset retrieved from MS SQL Server 2005.
> fgPendingRecords filter shows all modifications to that recordset not 
> applied back to the server.
> 
> regards
> 
> /Micke
0
Luciano
8/15/2008 3:18:40 PM
When using ADO components in Delphi and showing data in DBGrids, I have found that I can eliminate a lot of flakiness if I move focus OFF of the grid before doing things like TADODataSet.Insert or Delete.  After pointing this out to others, I've heard back that this worked for them too.  I never did track it down to find out why this works to help avoid the BOF/EOF and other errors that don't seem to be connected to reality.

mIKE

> {quote:title=Luciano Rodrigues wrote:}{quote}
> Hi,
> 
> Thanks Micke, you got the point, the cause is the DBGrid/DataSource connected to the ADODataSet. It's the only DB control used. For now, I'm going to set the DataSource's DataSet property to nill at runtime until get a better solution.
> 
> Best regards,
> 
> Luciano RM
> 
> > {quote:title=Mikael Eriksson wrote:}{quote}
> > Hi,
> > 
> > I have no idea why you get that error. We are probably not using the 
> > same setup.
> > 
> > I use a disconnected ADO recordset retrieved from MS SQL Server 2005.
> > fgPendingRecords filter shows all modifications to that recordset not 
> > applied back to the server.
> > 
> > regards
> > 
> > /Micke
0
Mike
8/22/2008 7:25:14 AM
Reply:

Similar Artilces:

ADO.net problem: i can not view image data for the rest of my table rows except the image for the first row but i can read all the other non image fields for all rows.
Hi i have a table with the following fields imgid............int imgdata........image imgtitle.........varchar(max) imgType........varchar(max) imgLength.....bigint incident_id.....int i have no problem with uploading the image but viewing the uploaded image(s) in a gridview has caused me great pain. The probelm is i have two pages. page1 grabs the image to display and page2 has a gridview that displays the grabed image. I wanted to have an sql statement like SELECT * FROM mytable WHERE incident_id=someValue. IF i have 5 records in this table and i view page2 ...

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 ...

Data Set ---- Data Row ( How to retrieve column data in a array )
Question regarding Dataset in ASP.NET ds = DBFunctions.RunSelect("select * from emp where Userid='" & vUserID & "'") If (ds.Tables(0).Rows.Count > 0) Then Dim dr As DataRow = ds.Tables(0).Rows(0)location= dr("location")  -- this statement only gives me the first locaitonMytable userid          location111              AAA111              BBB111         ...

data, data, data
Hello, I need some advice on the best method to keep a database updated in this scenario. I have a local Solomon SQL Server where we keep our inventory. I want to build an application that will be hosted at a remote hosting location which provides a SQL database. I want to build the application to allow clients to access the inventory items and make requests based on the remote SQL data. The order will be sent to our fulfillment department via email; they will fiill the request and ship.  I'm not sure the method to do this while keeping the data current on the remote and the l...

Data row from a Data Table
Hi All, I have a method which returns all the rows to a DataTable.  So from that Data Table I want a particular Row whose values should be assigned to text boxes on the webpage. Please can any help me out on how to do this ? Thanks for your time..   // assuming that you want the first row DataRow r=dataTable1.Rows[0]; TextBox1.Text=r["Column1"]; TextBox2.Text=r["Column2"];  Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensiv...

Arranging data on multiple rows into a sigle row (converting rows into columns)
Hello, I have a survey (30 questions) application in a SQL server db. The application uses several relational tables. The results are arranged so that each answer is on a seperate row: user1   answer1user1   answer2user1   answer3user2   answer1user2   answer2user2   answer3 For statistical analysis I need to transfer the results to an Excel spreadsheet (for later use in SPSS). In the spreadsheet I need the results to appear so that each user will be on a single row with all of that user's answers on...

Why does it not let me type data in my database fields and gives me error "No row was updated, the data in row 1 was not committed?
Hi, I'm typing example records in my database fields for username, last name, firstname, city, state, etc directly into the database field but when I try to save it it says:  No row was updated. The data in row 1 was not committed.Error Source: .NetSqlClient Data Provider.Error Message: String or binary data would be truncated.The statement has been terminated.Correct the errors and retry or press ESC to cancel the change(s) Basically I'm just typing data into the fields but it won't allow me to save them.    The data types are all saved as...

How to move a row in a data table object to the top of the table? The data table is in a data set. The data is bound to a drop down list box.
I am maintaining some 2003 C#/asp.net code for a web application. In the application a table in a data set is usedto populate a drop down list box.(The drop down list box will display a list of names) Before the data set table is bound to the list box control, blank characters are inserted at the topof the data set table. The purpose of this, is to display a blank line in the drop down list box, when the list box isinitially displayed. This code works fine. (See lines 1-14 below). Now I have been asked to modify the source code so that instead of a blank line being inserted at to top of th...

Oracle NCLOB data getting truncated when using delphi ADO
I am using Delphi2007 and using ADO for data access. When trying to select nclob data from an Oracle database it generally works, but I have one query that is consitantly truncating the data at 12 characters. I have already been in touch with Oracle and they have confirmed that the OLEDB provider that is being used is correctly returning the data. Here is the query select ACT_KEY, COALESCE((SELECT LTX_TEXT FROM TEXT_TABLE WHERE LTX_TABLE='SOURCE_TABLE' AND LTX_TEXT_ID = 'ACT_DESC' AND LTX_TABLE_KEY = CAST(SOURCE_TABLE.ACT_KEY AS NVARCHAR2(10))),TO_NCLOB(ACT_DESC)) as A...

CR Report from ado.net data source always has no rows
 have a working CR report which uses an oracle database for a data source.  I am modifying it to use an ado.net (visual studio 2005/C#) dataset as a data source.  I am following the procedure described in Business Objects "Crystal Reports for Visual Studio .net Reporting Off ADO.Net DataSets" document.  The recordset passed to CR contains 20 records, but the report shows no records.  Neither of the fields contains nulls.Any ideas?string SqlCmd = "select fielda, fieldb from tablec";OleDbDataAdapter OleAdapter = new OleDbDataAdapter(S...

Repeater display row w/ data when Row.count = 0 (i.e. add a row)
Hi, OK, working w/ nested repeaters - outer repeater will always have data but inner repeater may or may not have data - i.e: Record 1 (outer repeater) - Record 1a (inner repeater) - Record 1b - Record 1c Record 2 - no data Record 3 - Record 3a - Record 3b ... What I need to do is for each loop of the inner repeater where there is no data, force the inner repeater to display a single row that will be populated with previously-obtained data. This is a monthly report of active and inactive aircraft and while most will always have records in th...

Populate row by row data in gridview
Hi , How to populate the data row by row in grid view. For example: I wirte this code in .aspx page <asp:TemplateField HeaderText="COC Date of Calibration">                <EditItemTemplate>                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# COC_Date("strDate") %>'></asp:TextBox>       &nbs...

Copying a row of data to another row
I have multiple tables with a lot of columns. The users of the application would like to populate freeform datawindows with the data from a previous row (record). Only 1 table is used in each of the datawindows and I know the primary key values for the rows to copy from and to. What is the most efficient way to have a user click a button or select a menu option to populate the current row with all the values (minus the primary key) from a prior row? The version of PB is 10.2 and the database is MS SQL 2005. Any ideas or suggestions would be much appreciated. Thanks Don This is...

Data of two rows in one row
  Emp-----ID Name1 x1 P2 y2 Q3 WEmp_DataId Name-1 Name-21 x P2 y Q3 wabove is my tables (Emp ),And the I want the Resulting Data in the (Emp_Data) format.is this possible Pls Help........Thanks in advance----- SELECT t.ID,MAX(CASE WHEN t.Seq=1 THEN t.Name ELSE NULL END) AS Name_1,MAX(CASE WHEN t.Seq=2 THEN t.Name ELSE NULL END) AS Name_2FROM (SELECT ROW_NUMBER() OVER(PARTITION BY ID Order BY Name) AS Seq,* FROM Emp)tGROUP BY t.ID Please click "Mark as Answer" if my reply solved your problem.CheersRammohan   Thanx it helped me a lot...

Several rows with the same data into 1 row
There is table where some rows includes the same data (at least UserId, Name but ID - unique) ID, UserID, Name, Money Required, Money Spent, Products 1    234        aaa     2000                    345                Product1 2    234        aaa     300      ...

Web resources about - ADODataSet - Deleted rows data - embarcadero.delphi.ado

Resources last updated: 12/29/2015 2:24:53 AM