Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Final Paradigm shift from BDE - posting to database



Permlink Replies: 7 - Last Post: Nov 6, 2016 7:14 AM Last Post By: John MacDonald Threads: [ Previous | Next ]
John MacDonald

Posts: 179
Registered: 3/22/98
Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2016 1:51 PM
I have moved our main erp system to Interbase from the BDE and DBASE.
We are using C++, I'm in the middle of making changes to the database and there seems to be something big I'm missing....

In the past we would,

add a query and datasource to a datamodule
set the sql statement to "select * from .... "
then we could open a form and display one record at a time, edit add new records, etc....

The paradigm shift seems to be to a multilevel application. ( not sure since we have moved many things at once )

The new platform is Interbase XE3 ( for the moment ) and we are using FireDac.

We are not using a grid. ( most examples have a grid )
Please point us in the right direction to learn the proper way(s) to create a record edit it and post the results.

I am aware that Blob "memo" fields have been extended since DBASE.
We are using a memo or blob field for misc notes for the record.

There are many things that work very easily as a result of our change, but, posting to a database seems to be overlooked in the demo's I've reviewed. Do we setup two queries - one that allows the browsing from record to record and another to post an inserted record?
--
JMAC out
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 31, 2016 12:48 AM   in response to: John MacDonald in response to: John MacDonald
John MacDonald wrote:
I have moved our main erp system to Interbase from the BDE and DBASE.
We are using C++, I'm in the middle of making changes to the database and there seems to be something big I'm missing....

In the past we would,

add a query and datasource to a datamodule
set the sql statement to "select * from .... "
then we could open a form and display one record at a time, edit add new records, etc....

The paradigm shift seems to be to a multilevel application. ( not sure since we have moved many things at once )

The new platform is Interbase XE3 ( for the moment ) and we are using FireDac.

We are not using a grid. ( most examples have a grid )
Please point us in the right direction to learn the proper way(s) to create a record edit it and post the results.

I am aware that Blob "memo" fields have been extended since DBASE.
We are using a memo or blob field for misc notes for the record.

There are many things that work very easily as a result of our change, but, posting to a database seems to be overlooked in the demo's I've reviewed. Do we setup two queries - one that allows the browsing from record to record and another to post an inserted record?
--
JMAC out

Is this through FireDAC, or directly?

I've done this through FireDAC (using Postgress) and what you describe is not more difficult than calling Append on a TFDTable component, assign the fields and call Post to commit the new record.
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 31, 2016 1:37 PM   in response to: Jan Dijkstra in response to: Jan Dijkstra
Hello Jan:

I agree that it should be that easy, but, it does not seem to be. I hope I'm not making this more complicated than it needs to be.

I am using FireDac to get access to Interbase.
The main database is being provided on a server setup on one of the other machines in the office.

When I append():
I'm using a query that has select * from build - I've been directed to limit the amount of records somehow.
Since I am creating a new record, I'm not sure how to do a select that picks only one record to create.
Then I have created a form to access this new record. The edit goes fine until I post().

That's when the big job of putting this record into the right place happens.

I have been directed to use transactions and avoid the memo fields ( blobs ) because they can pull the system down.

The net effect is that the post takes over 30 seconds to happen and sometimes it even crashes.

Thanks for your interest and help.

I've been trying to find actual examples that use a form that does NOT have a grid. I am trying to expose the user to a specific amount of information from a single record at a time.

John

Jan Dijkstra wrote:
John MacDonald wrote:
I have moved our main erp system to Interbase from the BDE and DBASE.
We are using C++, I'm in the middle of making changes to the database and there seems to be something big I'm missing....

In the past we would,

add a query and datasource to a datamodule
set the sql statement to "select * from .... "
then we could open a form and display one record at a time, edit add new records, etc....

The paradigm shift seems to be to a multilevel application. ( not sure since we have moved many things at once )

The new platform is Interbase XE3 ( for the moment ) and we are using FireDac.

We are not using a grid. ( most examples have a grid )
Please point us in the right direction to learn the proper way(s) to create a record edit it and post the results.

I am aware that Blob "memo" fields have been extended since DBASE.
We are using a memo or blob field for misc notes for the record.

There are many things that work very easily as a result of our change, but, posting to a database seems to be overlooked in the demo's I've reviewed. Do we setup two queries - one that allows the browsing from record to record and another to post an inserted record?
--
JMAC out

Is this through FireDAC, or directly?

I've done this through FireDAC (using Postgress) and what you describe is not more difficult than calling Append on a TFDTable component, assign the fields and call Post to commit the new record.

--
JMAC out
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2016 1:55 AM   in response to: John MacDonald in response to: John MacDonald
John MacDonald wrote:
Hello Jan:

I agree that it should be that easy, but, it does not seem to be. I hope I'm not making this more complicated than it needs to be.

I am using FireDac to get access to Interbase.
The main database is being provided on a server setup on one of the other machines in the office.

When I append():
I'm using a query that has select * from build - I've been directed to limit the amount of records somehow.
Since I am creating a new record, I'm not sure how to do a select that picks only one record to create.
Then I have created a form to access this new record. The edit goes fine until I post().

That's when the big job of putting this record into the right place happens.

I have been directed to use transactions and avoid the memo fields ( blobs ) because they can pull the system down.

The net effect is that the post takes over 30 seconds to happen and sometimes it even crashes.

Thanks for your interest and help.

I've been trying to find actual examples that use a form that does NOT have a grid. I am trying to expose the user to a specific amount of information from a single record at a time.

John

Jan Dijkstra wrote:
John MacDonald wrote:
I have moved our main erp system to Interbase from the BDE and DBASE.
We are using C++, I'm in the middle of making changes to the database and there seems to be something big I'm missing....

In the past we would,

add a query and datasource to a datamodule
set the sql statement to "select * from .... "
then we could open a form and display one record at a time, edit add new records, etc....

The paradigm shift seems to be to a multilevel application. ( not sure since we have moved many things at once )

The new platform is Interbase XE3 ( for the moment ) and we are using FireDac.

We are not using a grid. ( most examples have a grid )
Please point us in the right direction to learn the proper way(s) to create a record edit it and post the results.

I am aware that Blob "memo" fields have been extended since DBASE.
We are using a memo or blob field for misc notes for the record.

There are many things that work very easily as a result of our change, but, posting to a database seems to be overlooked in the demo's I've reviewed. Do we setup two queries - one that allows the browsing from record to record and another to post an inserted record?
--
JMAC out

Is this through FireDAC, or directly?

I've done this through FireDAC (using Postgress) and what you describe is not more difficult than calling Append on a TFDTable component, assign the fields and call Post to commit the new record.

--
JMAC out

I have used

  BdeTable->Active = true;
  FDTable->Active  = true;
 
  if (CheckBox1->Checked)
  {
    BdeTable->DisableControls ();
    FDTable->DisableControls ();
  }
 
  BdeTable->First ();
 
  ebTo->Text = IntToStr (BdeTable->RecordCount);
 
  ProcessPaintMessages (Handle);
 
  while (! BdeTable->Eof)
  {
    ebFrom->Text = IntToStr (BdeTable->RecNo);
 
    ProcessPaintMessages (Handle);
 
    FDTable->Append ();
 
    int index = 0;
    int count = BdeTable->FieldCount;
 
    while (index < count)
    {
      TField *source = BdeTable->Fields->Fields [index];
      TField *target = NULL;
 
      int fIndex = 0;
      int fCount = FDTable->FieldCount;
 
      while (fIndex < fCount)
      {
        target = FDTable->Fields->Fields [fIndex];
        if (StrCompare (source->FieldName, target->FieldName, scmAlphaIC) == 0)
        {
          target->AsString = source->AsString;
          fIndex = fCount;
        }
        fIndex++;
      }
 
      index++;
    }
 
    FDTable->Post ();
//    FDTable->ApplyUpdates ();
//    FDTable->Reconcile ();
 
    BdeTable->Next ();
  }
 
  if (CheckBox1->Checked)
  {
    BdeTable->EnableControls ();
    FDTable->EnableControls ();
  }

to copy over roughly a million records from a DBase table (BDE controlled) to a Postgress table on a remote server. Took about 30 minutes to create those million records in the Postgress table.

As you can see, it really is as simple as Append, assign the fields and Post to save the record.
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2016 12:35 PM   in response to: Jan Dijkstra in response to: Jan Dijkstra
Thanks Jan:

I used the data pump to get my data over to Interbase - It was actually simple.

The issue i have to overcome is more to do with the new platform.

We have an interbase server and the original files use blobs to handle our memo fields.

I'm told that I need to limit the number of records in my select with a where statement.

I need to append one record to a database, allow the user to edit and then post the edit.

The post is getting lost in a flurry since the original select picks the whole database and the structure contains the blob.

John

Jan Dijkstra wrote:
John MacDonald wrote:
Hello Jan:

I agree that it should be that easy, but, it does not seem to be. I hope I'm not making this more complicated than it needs to be.

I am using FireDac to get access to Interbase.
The main database is being provided on a server setup on one of the other machines in the office.

When I append():
I'm using a query that has select * from build - I've been directed to limit the amount of records somehow.
Since I am creating a new record, I'm not sure how to do a select that picks only one record to create.
Then I have created a form to access this new record. The edit goes fine until I post().

That's when the big job of putting this record into the right place happens.

I have been directed to use transactions and avoid the memo fields ( blobs ) because they can pull the system down.

The net effect is that the post takes over 30 seconds to happen and sometimes it even crashes.

Thanks for your interest and help.

I've been trying to find actual examples that use a form that does NOT have a grid. I am trying to expose the user to a specific amount of information from a single record at a time.

John

Jan Dijkstra wrote:
John MacDonald wrote:
I have moved our main erp system to Interbase from the BDE and DBASE.
We are using C++, I'm in the middle of making changes to the database and there seems to be something big I'm missing....

In the past we would,

add a query and datasource to a datamodule
set the sql statement to "select * from .... "
then we could open a form and display one record at a time, edit add new records, etc....

The paradigm shift seems to be to a multilevel application. ( not sure since we have moved many things at once )

The new platform is Interbase XE3 ( for the moment ) and we are using FireDac.

We are not using a grid. ( most examples have a grid )
Please point us in the right direction to learn the proper way(s) to create a record edit it and post the results.

I am aware that Blob "memo" fields have been extended since DBASE.
We are using a memo or blob field for misc notes for the record.

There are many things that work very easily as a result of our change, but, posting to a database seems to be overlooked in the demo's I've reviewed. Do we setup two queries - one that allows the browsing from record to record and another to post an inserted record?
--
JMAC out

Is this through FireDAC, or directly?

I've done this through FireDAC (using Postgress) and what you describe is not more difficult than calling Append on a TFDTable component, assign the fields and call Post to commit the new record.

--
JMAC out

I have used

  BdeTable->Active = true;
  FDTable->Active  = true;
 
  if (CheckBox1->Checked)
  {
    BdeTable->DisableControls ();
    FDTable->DisableControls ();
  }
 
  BdeTable->First ();
 
  ebTo->Text = IntToStr (BdeTable->RecordCount);
 
  ProcessPaintMessages (Handle);
 
  while (! BdeTable->Eof)
  {
    ebFrom->Text = IntToStr (BdeTable->RecNo);
 
    ProcessPaintMessages (Handle);
 
    FDTable->Append ();
 
    int index = 0;
    int count = BdeTable->FieldCount;
 
    while (index < count)
    {
      TField *source = BdeTable->Fields->Fields [index];
      TField *target = NULL;
 
      int fIndex = 0;
      int fCount = FDTable->FieldCount;
 
      while (fIndex < fCount)
      {
        target = FDTable->Fields->Fields [fIndex];
        if (StrCompare (source->FieldName, target->FieldName, scmAlphaIC) == 0)
        {
          target->AsString = source->AsString;
          fIndex = fCount;
        }
        fIndex++;
      }
 
      index++;
    }
 
    FDTable->Post ();
//    FDTable->ApplyUpdates ();
//    FDTable->Reconcile ();
 
    BdeTable->Next ();
  }
 
  if (CheckBox1->Checked)
  {
    BdeTable->EnableControls ();
    FDTable->EnableControls ();
  }

to copy over roughly a million records from a DBase table (BDE controlled) to a Postgress table on a remote server. Took about 30 minutes to create those million records in the Postgress table.

As you can see, it really is as simple as Append, assign the fields and Post to save the record.

--
JMAC out
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 2, 2016 12:50 AM   in response to: John MacDonald in response to: John MacDonald
John MacDonald wrote:
Thanks Jan:

I used the data pump to get my data over to Interbase - It was actually simple.

The issue i have to overcome is more to do with the new platform.

We have an interbase server and the original files use blobs to handle our memo fields.

I'm told that I need to limit the number of records in my select with a where statement.

I need to append one record to a database, allow the user to edit and then post the edit.

The post is getting lost in a flurry since the original select picks the whole database and the structure contains the blob.

John

Well, as you can see in my code sample, I'm basically doing the same thing. Append, fill the fields with values (granted, this is in code and not real user interaction, but that should make no difference) and Post it. I'm letting FireDAC's TFDTable figure out on it's own what it needs to do to execute that append + post. But I doubt it will retrieve the entire table with each Append. If it did that, there is no way I could create a million records in less than an hour.

But I grant you this. My table didn't contain DBase memo's. And in those cases where in DBase I did need a memo, I'm switching to varchar fields. Those can be large enough to effectively store what used to be put in a memo field in DBase. In Postgress, varchar fields do not occupy more space than the length of the text you put in them. So there is no real penalty in setting it's size to something like 32K.
Ed Rokosz

Posts: 6
Registered: 2/8/98
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 2, 2016 1:29 PM   in response to: John MacDonald in response to: John MacDonald
Had similar headaches with FireDac 3 years ago so switched to
SQL Server Data Access Components (SDAC) with plans on migrating to SQL server but my customer decided to stop the project.
However I have been using Apollo Embedded Database Engine since mid-90’s when I migrated from Clipper programing language to C++Builder 5 and I’m still using it for my other customers who still have dBase .dbf data files and older DOS clipper compiled code.
Apollo Embedded Database Engine has been reworked for the latest release of RAD 10.1 Berlin:
http://www.apollodb.com/apollo_embedded.asp
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Final Paradigm shift from BDE - posting to database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2016 7:14 AM   in response to: John MacDonald in response to: John MacDonald
This article finally helped with my issues.

[Interbase for Desktop Database |http://edn.embarcadero.com/article/27194]
Bill Todd.

There are definitely some paradigm shifts. The article is written from the perspective of the desktop developer moving to Interbase.
From network optimization to cached updates and transactions.

Thanks to all.

Sorry I did not mark this as a question at the beginning.

We are on our way.

John

John MacDonald wrote:
I have moved our main erp system to Interbase from the BDE and DBASE.
We are using C++, I'm in the middle of making changes to the database and there seems to be something big I'm missing....

In the past we would,

add a query and datasource to a datamodule
set the sql statement to "select * from .... "
then we could open a form and display one record at a time, edit add new records, etc....

The paradigm shift seems to be to a multilevel application. ( not sure since we have moved many things at once )

The new platform is Interbase XE3 ( for the moment ) and we are using FireDac.

We are not using a grid. ( most examples have a grid )
Please point us in the right direction to learn the proper way(s) to create a record edit it and post the results.

I am aware that Blob "memo" fields have been extended since DBASE.
We are using a memo or blob field for misc notes for the record.

There are many things that work very easily as a result of our change, but, posting to a database seems to be overlooked in the demo's I've reviewed. Do we setup two queries - one that allows the browsing from record to record and another to post an inserted record?
--
JMAC out

--
JMAC out
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02