Try OpenEdge Now
skip to main content
Introducing the OpenEdge DataSet : Data-Source object : Defining a static Data-Source : When you would not use a Data-Source at all
When you would not use a Data-Source at all
If you do not attach a Data-Source to a table before filling or updating the ProDataSet, then you must provide an event procedure to fill or update that table. The AVM provides no default fill or update behavior in this case. If the source for the ProDataSet table is in fact one or more database tables, then you will normally want to define a Data-Source and attach it to the ProDataSet buffer to get the default behavior the AVM provides. You can still extend that behavior in event procedures to further qualify which records go into the ProDataSet or to make other changes.
In some cases, however, your actual data source might not be a OpenEdge or Data Server database at all. It could be a flat file that you read data from, an XML or JSON document that you process yourself, or some other source of data. In this case you simply do not define a Data-Source at all. The AVM depends on the event procedure code you write for the fill events for the table, and your own code must do the work of populating that table. If there is no Data-Source for a temp-table and no supporting event procedure to replace it, then no data is loaded into that table, and no error results.
This gives you the flexibility to attach very different sources of data to the same ProDataSet without the ProDataSet definition or its business logic changing at all. At one time, the data might come from a file you read yourself. At another time, it might be moved into a database table. Or in some future OpenEdge release, the AVM might natively support the nonstandard data source you use, and you can define a Data-Source object to handle it. You can do all this without changing anything at all in the ProDataSet itself.