1 / 19

E-DATA The Datasession

E-DATA The Datasession. Venelina Jordanova Venelina@VandU.eu. What about Venelina & Uwe?. New company: V&U Ltd. www.VandU.eu Info@VandU.eu Managers: Venelina & Uwe Software projects with VFP Visual Extend High Quality for low prices Development in Varna, Bulgaria. Overview.

aquene
Download Presentation

E-DATA The Datasession

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. E-DATAThe Datasession Venelina Jordanova Venelina@VandU.eu

  2. What aboutVenelina & Uwe? • New company: V&U Ltd. • www.VandU.eu • Info@VandU.eu • Managers: Venelina & Uwe • Software projects with VFP • Visual Extend • High Quality for low prices • Development in Varna, Bulgaria

  3. Overview Data retrieval control Using parameters Overcoming VFP limits The place of CursorAdapter class in the application architecture.

  4. Accessing data • How to reach the data • Do not use VFP CA Builder • Where do you want to connect today? • http://connectionstrings.com/

  5. ODBC or ADO? • ODBC SQLSTRINGCONNECT() or SQLCONNECT() • ADODB loConnDataSource = CREATEOBJECT('ADODB.Connection') loConnDataSource.ConnectionString = [Provider=SQLOLEDB.1...] loConnDataSource.Open() This.DataSource = CREATEOBJECT('ADODB.RecordSet') This.DataSource.ActiveConnection = loConnDataSource

  6. Accessing data • Controlling data retrieval • CursorFill() and CursorRefresh() methods • BeforeCursorFill() and BeforeCursorRefresh()events • Make sure to pass all the editable parameters by reference • UseCursorSchema and NoDataOnLoad properties

  7. Handling data access errors By default CursorAdapter class does not raise error events Why does VFP browse the cursor after select? Considering remote data engine specifics ANSI SQL functions Accessing data

  8. The power of parameters • Reducing the traffic • Using parameterized select command • make sure all the parameters exist and have correct value at the time when object initializes and every time when CursorFill or CursorRefresh is executed • Prefix parameter variables with “?” when working with ODBC provider • ADOCommand parameters when using ADODB provider

  9. The power of parameters • Complicated parameterized select command

  10. The power of parameters • Data security • Narrow data range • User access rights • Record level security

  11. Dancingdata • Working with a large table • Split table into two (or more) cursors • Use one of the cursors as main alias • Manage relation between cursors • Save data from all the cursors • Update using same ID • Saving new record • Insert only once • Deleting a record • Ensure data consistency • Use transactions

  12. Dancingdata • Error: Statement too long. • SYS(3055) • = SYS(3055, 8 * MIN(40, FCOUNT( ))) • WhereType property • 4 or DB_KEYANDTIMESTAMP (from FOXPRO.H) • Why not using it always? • Lost update conflicts management

  13. Dancingdata • Joined tables • Properties • Tables • UpdateNameList • UpdatableFieldList • Delete a record is deleting in all the joined tables • DELETE commands are generated for all the tables that CursorAdapter object updates

  14. CursorAdapter in N-Tier architecture • Data layer? • Data transformations • Keeping data integrity • Handling retrieve and update errors • Business rules layer? • Record level validation • BeforeCursorUpdate(), BeforeInsert(), BeforeUpdate(), and BeforeDelete() events

  15. Auto-generated ID field values • VFP • GETAUTOINCVALUE() Function • SQL • @@IDENTITY system variable • MS SQL functions SCOPE_IDENTITY() and IDENT_CURRENT( 'table_name' )

  16. Keeping data integrity • Transactions • UseTransactions property • Data engine feedback • properties InsertCmdRefreshKeyFieldList InsertCmdRefreshFieldListInsertCmdRefreshCmd • Only when BatchUpdateCount = 1

  17. Close data all • Data access • Optimized • Error free • Stable • Detailed control • Data retrieval • Saving data

  18. Questions

  19. Thank you! Please remember to fill out your evaluation.

More Related