Converting TIBTable to TIBdataset

I'm upgrading an older application and wanting to move away from TIBTable and to the more efficient TIBdataset. I'm sure I'm missing something very simple. When I execute the following using TIBTable, the record successfully updates but when using TIBDataset the record is not updated. When I created the TIBDataset I used the dataset editor to generate the default SQL. I even tried adding a commit after the post but still dosen't work.
this works:
try
 taTable.Edit;
 taTable.FieldByName('field1').AsInteger := value1;
 taTable.FieldByName('field2').AsDateTime := value2;
 taTable.Post;
except
 MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
 taTable.Cancel;
end


this does not work:
try
 IBDdateset.Edit;
 IBDdateset.FieldByName('field1').AsInteger := value1;
 IBDdateset.FieldByName('field2').AsDateTime := value2;
 IBDdateset.Post;
except
 MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
 IBDdateset.Cancel;
end

Any help greatly appreciated
0
Jay
7/6/2015 10:47:44 PM
embarcadero.interbase.general 923 articles. 0 followers. Follow

7 Replies
502 Views

Similar Articles

[PageSpeed] 31
Get it on Google Play
Get it on Apple App Store

Jay Eisenstock wrote:
> I even tried adding a commit after the post but still dosen't work.

Can you fully describe what "doesn't work" means? Do you get an error? 
Does the update just not happen? If the later, if you tried 
disconnecting and reconnecting to see if you see the update?
0
quinn
7/6/2015 11:13:03 PM
> {quote:title=Jay Eisenstock wrote:}{quote}
> I'm upgrading an older application and wanting to move away from TIBTable and to the more efficient TIBdataset. I'm sure I'm missing something very simple. When I execute the following using TIBTable, the record successfully updates but when using TIBDataset the record is not updated. When I created the TIBDataset I used the dataset editor to generate the default SQL. I even tried adding a commit after the post but still dosen't work.
> this works:
> try
>  taTable.Edit;
>  taTable.FieldByName('field1').AsInteger := value1;
>  taTable.FieldByName('field2').AsDateTime := value2;
>  taTable.Post;
> except
>  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
>  taTable.Cancel;
> end
> 
> 
> this does not work:
> try
>  IBDdateset.Edit;
>  IBDdateset.FieldByName('field1').AsInteger := value1;
>  IBDdateset.FieldByName('field2').AsDateTime := value2;
>  IBDdateset.Post;
> except
>  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
>  IBDdateset.Cancel;
> end
> 
> Any help greatly appreciated

No error is reported the update just doesn't occur. If I reconnect the update is not there.
0
Jay
7/6/2015 11:33:56 PM
I'd start by using the TIBSQLMonitor and see if you see the expected SQL 
being generated.

>
> No error is reported the update just doesn't occur. If I reconnect the update is not there.
>
0
quinn
7/7/2015 10:11:39 PM
Jay Eisenstock wrote:
> I'm upgrading an older application and wanting to move away from TIBTable and to the more efficient TIBdataset. I'm sure I'm missing something very simple. When I execute the following using TIBTable, the record successfully updates but when using TIBDataset the record is not updated. When I created the TIBDataset I used the dataset editor to generate the default SQL. I even tried adding a commit after the post but still dosen't work.
> this works:
> try
>  taTable.Edit;
>  taTable.FieldByName('field1').AsInteger := value1;
>  taTable.FieldByName('field2').AsDateTime := value2;
>  taTable.Post;
> except
>  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
>  taTable.Cancel;
> end
> 
> 
> this does not work:
> try
>  IBDdateset.Edit;
>  IBDdateset.FieldByName('field1').AsInteger := value1;
>  IBDdateset.FieldByName('field2').AsDateTime := value2;
>  IBDdateset.Post;
> except
>  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
>  IBDdateset.Cancel;
> end
> 
> Any help greatly appreciated

You can check RowsAffected after the Post.

What does your ModifySQL look like?  Usually this will be because your where 
clause if wrong.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
7/7/2015 10:38:54 PM
> {quote:title=Jeff Overcash (TeamB) wrote:}{quote}
> Jay Eisenstock wrote:
> > I'm upgrading an older application and wanting to move away from TIBTable and to the more efficient TIBdataset. I'm sure I'm missing something very simple. When I execute the following using TIBTable, the record successfully updates but when using TIBDataset the record is not updated. When I created the TIBDataset I used the dataset editor to generate the default SQL. I even tried adding a commit after the post but still dosen't work.
> > this works:
> > try
> >  taTable.Edit;
> >  taTable.FieldByName('field1').AsInteger := value1;
> >  taTable.FieldByName('field2').AsDateTime := value2;
> >  taTable.Post;
> > except
> >  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
> >  taTable.Cancel;
> > end
> > 
> > 
> > this does not work:
> > try
> >  IBDdateset.Edit;
> >  IBDdateset.FieldByName('field1').AsInteger := value1;
> >  IBDdateset.FieldByName('field2').AsDateTime := value2;
> >  IBDdateset.Post;
> > except
> >  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
> >  IBDdateset.Cancel;
> > end
> > 
> > Any help greatly appreciated
> 
> You can check RowsAffected after the Post.
> 
> What does your ModifySQL look like?  Usually this will be because your where 
> clause if wrong.
> 
> -- 
> Jeff Overcash (TeamB)
>        (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpeted  corridors of Whitehall.
>               (Fish)

Ok...I think I need to work on the ModifySQL. I tried using TIBSQL and it worked fine. Is there an advantage or disadvantage to just using the TIBSQL or better to get the ModifySQL code to work in TIBdataset?
0
Jay
7/7/2015 11:50:33 PM
> {quote:title=Jeff Overcash (TeamB) wrote:}{quote}
> Jay Eisenstock wrote:
> > I'm upgrading an older application and wanting to move away from TIBTable and to the more efficient TIBdataset. I'm sure I'm missing something very simple. When I execute the following using TIBTable, the record successfully updates but when using TIBDataset the record is not updated. When I created the TIBDataset I used the dataset editor to generate the default SQL. I even tried adding a commit after the post but still dosen't work.
> > this works:
> > try
> >  taTable.Edit;
> >  taTable.FieldByName('field1').AsInteger := value1;
> >  taTable.FieldByName('field2').AsDateTime := value2;
> >  taTable.Post;
> > except
> >  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
> >  taTable.Cancel;
> > end
> > 
> > 
> > this does not work:
> > try
> >  IBDdateset.Edit;
> >  IBDdateset.FieldByName('field1').AsInteger := value1;
> >  IBDdateset.FieldByName('field2').AsDateTime := value2;
> >  IBDdateset.Post;
> > except
> >  MessageDlg('Error Updating',TMsgDlgType.mtError,[TMsgDlgBtn.mbok],0);
> >  IBDdateset.Cancel;
> > end
> > 
> > Any help greatly appreciated
> 
> You can check RowsAffected after the Post.
> 
> What does your ModifySQL look like?  Usually this will be because your where 
> clause if wrong.
> 
> -- 
> Jeff Overcash (TeamB)
>        (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpeted  corridors of Whitehall.
>               (Fish)

Ok...I think I need to work on the ModifySQL. I tried using TIBSQL and it worked fine. Is there an advantage or disadvantage to just using the TIBSQL or better to get the ModifySQL code to work in TIBdataset?
0
Jay
7/7/2015 11:53:03 PM
Jay Eisenstock wrote:
> 
> Ok...I think I need to work on the ModifySQL. I tried using TIBSQL and it worked fine. Is there an advantage or disadvantage to just using the TIBSQL or better to get the ModifySQL code to work in TIBdataset?


All SQL statements are ultimately run through a TIBSQL.  So there is no 
advantage.  IBDataset works just fine with the correct SQL.  Like I said you 
should post it so we can see if it looks right.

for instance an update statement for the employee table would look like


update EMPLOYEE
set
   EMP_NO = :EMP_NO,
   FIRST_NAME = :FIRST_NAME,
   LAST_NAME = :LAST_NAME,
   PHONE_EXT = :PHONE_EXT,
   HIRE_DATE = :HIRE_DATE,
   DEPT_NO = :DEPT_NO,
   JOB_CODE = :JOB_CODE,
   JOB_GRADE = :JOB_GRADE,
   JOB_COUNTRY = :JOB_COUNTRY,
   SALARY = :SALARY
where
   EMP_NO = :OLD_EMP_NO

Notice the where clause has OLD_EMP_NO.  The OLD_ prefix is an internal thing to 
indicate you want the original value and how update statements should be.  The 
Dataset editor (right click on the component to get to it) builds all 4 
statements for you with no typing needed usually.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
7/8/2015 3:17:44 AM
Reply:

Similar Artilces:

Interbase General Script examples different speed between Interbase and Firebird
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_3b42b.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Hello this are the scripts of the captured screens --JivePart=_3b42b.zeB8CwDOH5aMJzMl Content-Type: application/octet-stream; name="Actualizaciones.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Actualizaciones.zip" UEsDBBQAAAAIAKuopDxrVeqcLjIAAFU0AQAVAAAAQWN0dWFsaXphY2lvbjA4NjYuc3Fs7X3bkhs3 kui7Iv...

What generals generally do
Reading a McChrystal thread elsewhere, I came across someone quoting a US general http://en.wikipedia.org/wiki/Smedley_Butler > I spent 33 years and four months in active military service and > during that period I spent most of my time as a high class thug for > Big Business, for Wall Street and the bankers. In short, I was a > racketeer, a gangster for capitalism. I helped make Mexico and > especially Tampico safe for American oil interests in 1914. I helped > make Haiti and Cuba a decent place for the National City Bank boys to > collect revenues in. I ...

Converting from Interbase to SQL Server
Hi, We're trying to convert a database from Interbase to SQL Server. We've extracted the metadata with the hope of using MS Query Analzyer to build the SQL Server version. The problem is that SQL commands that work in Interbase, do not work in SQL Server. Silly me,..thought SQL was standard. :-) So i'm wondering if there's some tool out there that will do the conversion? Any ideas or comments would be appreciated. Thanks, Chris Have you tried Sybase PowerDesigner? Version 6 can reverse engineer InterBase 4.0. -- Jim Egan [TeamSybase] Houston, ...

[InterBase] How connect by InterBase?
I want to connect to InterBase(DB) with PowerBuilder 6.5 .. Is that possible? but How connect ? If you have PB Desktop, you can't. Else, all you need is an ODBC driver. Using google I quickly located one: http://www.geocities.com/ibdatabase/index.html -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. MySybase http://my.sybase.com/mysybase Search Deja: http://www.pfcguide.com/_newsgroups/search.asp "Yun Ji Nam" <yunji.nam@technopia.net> wrote in message news:qBqt0TaIBHA.252@forums.sybase.com... > I want to connec...

Convert SQL Stored Procedure to InterBase
Hi Is there any possible way to convert SQL Stored Procedure to Interbase Stored Procedures by executing a SQL comand Thanks Maju "Maju Poulose" wrote in message news:16323@forums.codegear.com... > > Is there any possible way to convert SQL Stored Procedure to Interbase > Stored Procedures by executing a SQL comand No, the semantics used in MS SQL and Interbase for procs and triggers is totally different. There's very little that could be successfully automated. -- Wayne Niddery - TeamB (www.teamb.com) Tips to Get Published: http://dn.codegear...

general SQL syntax converter from sqlany to transact ?
Maintaing a SYBASE (11) database, consolidated from a few (<=10) SQLANY db's, we often convert sql from one syntax to the other. Is there a general syntax converter ? Using Transact-SQL to access Anywhere works slower than it's native syntax. >Maintaing a SYBASE (11) database, consolidated from a few (<=10) SQLANY >db's, we often convert sql from one syntax to the other. >Is there a general syntax converter ? >Using Transact-SQL to access Anywhere works slower than it's native syntax. If you put the sql in a stored procedure, using sybase central yo...

Newbie: How to easily convert MSSQL stored procedures to InterBase?
Hi I am trying to write a VB.NET application to periodically extract data from an existing client's Interbase. Since I already have the application working for extracting data out of a MS SQL database, I thought I could simply convert the MS SQL stored procedures to Interbase SQL then run those against the Interbase database in question. However rather than storing the stored procedures on the Interbase database I prefer to just use an ADO.NET command object with the command type set to "Text" rather than "Stored Procedure". Is there an easy way for me to conv...

Interbase XE3 and Interbase XE
On Embarcadero online shop I see there is the *Interbase XE3 server* and the *Interbase XE server*. What's the difference? Maybe one is 64 bit and the other 32 bit? Thank yow. Roberto Colpani wrote: > On Embarcadero online shop I see there is the *Interbase XE3 server* and the *Interbase XE server*. What's the difference? Maybe one is 64 bit and the other 32 bit? > Thank yow. XE3 is the latest version, XE is the version before it. Both come in both 32 and 64 bit. -- Jeff Overcash (TeamB) (Please do not email me directly unless asked. Thank You) And so I ...

Converting Excel "general" date into DateTime(Sql)
Hi,  I have an odd request.... I am importing data from an excel spreadsheet to a sql db. Inside the excel spreadsheet, I have a column with dates in it, I need these dates to be imported as text to the sql DB field(which is a varchar datatype).   The problem is, at the moment, if I insert a date 2006/08/30 it displays it like this in the sql DB: 38959 Is there a way this can be converted back to the date? even possibly before it is stored in the sql DB ? I am currently bulk copying the excel data to sql DB. The code im using is below: Thank you for any help/assistance Dim e...

How to convert Mod/Tod Video to general video for portable d
MOD and TOD are informal names of tapeless video formats used by JVC (MOD and TOD), Panasonic (MOD only) and Canon (MOD only) in some models of digital camcorders. It can�t be accepted by most portable devices. If people want to enjoy Mod/Tod video on PC or portable media player they should first convert their Mod/Tod Video to general video. '********* MOD CONVERTER' (HTTP://WWW.MAC-DVD-RIPPER-SOFT.COM/MOD-VIDEO-CONVERTER-AI.HTML)[/B]------A POWERFUL MOD CONVERTER SOFTWARE WHICH CAN CONVERT MOD VIDEO, TOD FILES TO ALL POPULAR VIDEO AND AUDIO FORMATS WITH FAST CONVERSION SPE...

DBD::Interbase and Interbase Events
Hi all I am trying to implement Interbase synchronous events. From the little documentation that there is on the DBD::Interbase implimentation of IB events I have seen that it is very similar to Delphi. (1) Register your interest and obtain a ref to an event handle. (2) Call ib_wait_event to wait for a synchronous event fired from the database. The problem I am having is when I call $dbh->func($evh, 'ib_wait_event'); it is not waiting and continues through the script. Am I missing something important or is there problems with DBD::Interbase-0.43 and events Regar...

General Guidelines for converting DNN 2.1.2 modules to DNN3...
Hello! Does anyone have some general guidelines for converting modules to DNN3? I spent about 4 hours last night getting started on one of my custom mods, winding my way through the "labyrinth" of the new namespaces. Now I don't mind doing my due diligence, but if anyone has a list of common pitfalls that they have encountered I'm sure it would be appreciated by everyone who will be tackling this task! A few of the major changes I unearthed: - DotNetNuke.Globals has become DotNetNuke.Common.Globals - Inherits DotNetNuke.PortalModuleControl has be...

convert
Can anyone tell me how to convert a char field, say 100.55 into 00000010055. I can't put the data into a numeric field becasue it will only accept implied decimals to be loaded by a mainframe. In a datawindow or powerscript? Chris Branham wrote: > Can anyone tell me how to convert a char field, say 100.55 into > 00000010055. I can't put the data into a numeric field becasue it will > only accept implied decimals to be loaded by a mainframe. I'm trying the conversion from powerscript using case statements.. case "acq_cost" dw_1.Modi...

General
Name: Nick Product: Firefox Release Candidate Summary: General Comments: Amazing. Just needs more compatible addons and it will be wonderful. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Web resources about - Converting TIBTable to TIBdataset - embarcadero.interbase.general

Facebook Begins Converting Users To HTTPS
Are you willing to sacrifice a little bit of speed for a lot more safety? Facebook is asking that very question with its announcement that it ...

Facebook No Longer Converting Groups Into Pages
Back when Facebook first launched Facebook Pages, many businesses and brands who had built up substantial audiences in their Facebook Groups ...

Vert - simply converting for iPhone, iPad, and iPod touch on the iTunes App Store
Get Vert - simply converting on the App Store. See screenshots and ratings, and read customer reviews.

Converting SIM Card to Micro SIM Card - Flickr - Photo Sharing!
Place new Micro SIM into the iPhone SIM card tray

Ayaan Hirsi Ali on Converting Muslims to Christianity - YouTube
Complete video at: http://fora.tv/2010/07/29/Nomad_From_Islam_to_America_with_Ayaan_Hirsi_Ali Ayaan Hirsi Ali explains her support of missionary ...

Click go fears of converting print files
Is there a way to convert a print queue item to a .RTF or .PDF file? I like to save or email them. - The Sydney Morning Herald

Sudanese woman ordered to hang under sharia law for converting to Christianity gives birth
Khartoum, Sudan: A Christian Sudanese woman sentenced to hang for apostasy has given birth in jail, a Western diplomat said on Tuesday.

Imams warn against radicalism to Aboriginal inmates converting to Islam
The prison system has enlisted the help of ASIO to crack down on radicalisation behind bars amid revelations that Aboriginals are converting ...

Converting the world's companies one by one - The Science Show - ABC Radio National (Australian Broadcasting ...
Image: Trucks carrying logs make their way up a road in Jambi, Indonesia. A vast area of the Sumatran forest, and orangutan habitat, is being ...

Rothesay building new arena, converting existing rink to fieldhouse
The Town of Rothesay plans to build a new arena and convert the existing one into a fieldhouse.

Resources last updated: 1/11/2016 10:10:39 PM