ASTA Home

Support:
Mailing List
Knowledge Base
Help File
FAQs
Servers
Tools
Examples
Hosting
User Contrib.
Email Support
Training
Consulting

Manual:
Users Guide
Evaluator's Guide
Installation Guide
SQL-Optional
Conversion Wizard
Threading Models
Tutorial
Quick Start

 

 

 

 

SQL Optional Step by Step

Welcome to the SQL Optional Step-by-Step page! We have worked very hard to make ASTA a simple, powerful, and intuitive tool and this page will demonstrate its ease-of-use.

The point of the tutorial is that SQL is Optional in the ASTA world. If you are an SQL guru then ASTA will reward you for that skill set and our flexibility will allow you to exercise as many SQL muscles as you please. But if you are a developer coming from the traditional "file server" world (Paradox, dBase, etc) then you might not have a working knowledge of SQL. That's okay, ASTA will allow you to succeed without requiring you to write SQL. If you set a few simple properties, ASTA can generate it for you. This will speed your development time and also help you to add this critical skill to your working skill set.

Please feel free to edit the Demo. If your country is not on the list, please add it. If your country is on the list, feel free overwrite the existing comment with one of your own.

This is how we made this page:

1. Drop a DBNavigator
2.
Drop a DataSource
3.
Drop an AstaClientDataSe
4.
Drop a DBGrid
5.
Drop four DBEdits
6.
Drop a DBMemo



7. Set the DataSource.DataSet property to the ASTAClientDataSet
8. Set the DBGrid and the DBNavigator's DataSource property to the DataSource (not pictured).
9. Set the AstaClientDataSet.TableName property to Countries.
10. Set the AstaClientDataSet.Active property to True (not pictured). The grid will populate.


11. Set DBEdit's DataSource and DataField properties

12. Set all the remaining DBEdits (not pictured).
13. Add labels.

This is what the page looks like at this point:

14. BLOB fields, such as a memo or a graphic, require special attention when used in a Client/Server environment, especially when bandwidth is limited. If you have a table with 10,000 images, you do NOT want to transmit all of them. In that case you probably want to put a "Get Detail" button that allows the user to get the memo or the graphic only if they need it.

The "Comments" field is a MEMO field, nornally I would retrieve it on a request basis only, but for the sake of this demo we are going to send it back automatically, simply to allow you to see how simple it is to do that. To handle MEMOs or BLOBs automatically, you need to set AstaClientDataSet.SQLOptions property.

15. Now it is time for the MOST IMPORTANT STEP!!! By default, the AstaClientDataSet is ReadOnly. The AstaClientDataSet.EditMode property. Click the EditMode property and the following property editor appears. Select your Update Method, the Primary Key (or Keys), and the Table. The status will become "DataSet is Editable."

As you can see, the AstaClientDataSet.EditMode property is now set to "AfterPost".


That's it. Period. Done. So where's the SQL that you didn't write? Here it is below. This is a screen shot of the AstaServer. I added the highlights.


This is the transcript copied from the server's memo field:

AstaDataBase->SELECT * From Countries

Exec ParamList Call: DELETE FROM Countries Where Countries.Country='Argentina'

Exec ParamList Call: Insert Into Countries (Countries.Country,Countries.Capital,Countries.Language,Countries.MonetaryUnit,Countries.Comments)
Values ('Argentina','Buenos Aires','Spanish','Austral',:MemoComments)

Param 0->MemoComments If you are from Argentina, feel free to edit this comment. If you are not from Argentina, please add your country if it is not listed or edit the comment if it is listed.


Copyright @ 2000, ASTA Technology Group. For more information, contact info@astatech.com