Professional Documents
Culture Documents
SmartSQL is a class created by FreeVBCode.com. We've found this class extremely useful in Visual Basic so we decided to port it to REALbasic. Overview The SmartSQL class is designed to simplify the generation of SQL statements. In projects that require the use of complex SQL statements, developers sometimes have to use (often convoluted) if-then or select logic to concatenate and generate the statement. The SmartSQL class eases this process by allowing the developer to use properties and functions to set up the statement, instead of keeping track of a long string.
The class offers flexibility in terms of how to generate the statement. For example, the field list of a select statement can be specified by repeatedly calling the AddField method or by passing a list of field names as a paramarray or array to the AddFields method.
The class offers the ability to easily re-use aspects of a previously generated statement. For instance, the class allows a developer to easily modify the where clause of a previously generated SQL statement, while maintaining the table list, field list, join clause and/or order clause.
A Simple Example:
1/4
REALbasic Stuff
MsgBox oSQL.SQL
The message box in the above example will display the following:
SELECT Customers.Name,Customers.Phone,Orders.ID,Orders.ShippingAddress
2/4
REALbasic Stuff
MsgBox oSQL.SQL
ATTENTION! These tutorials are now being hosted by the Association of REALbasic Professionals Members-Only source code repository. Access to ARBP Members-Only site requires registration (which is free).
The terms of use from FreeVBCode.com require us to include the original documentation and VB class and dll.
3/4
REALbasic Stuff
The REALbasic code is provided "As-Is." You can freely use and modify the code as you see fit provided you adhere to the original terms set forth in the FreeVBCode documentation. If you find any bugs or ways to enhance the functionality in REALbasic, please email us any changes at support@bkeeney.com.
4/4