ASTA 3 for Delphi Help File
ASTA 3 for Delphi Help File
Table of contents
ASTA 3 ................................................................................................................ 23
ASTA 3 New Features ........................................................................................... 24
ASTA 2.6 to ASTA 3 Migration Issues .....................................................................28
ASTA History ........................................................................................................29
ASTA and .NET .....................................................................................................30
Building Applications with ASTA ............................................................................ 32
ASTA Jump Start Tips ........................................................................................... 32
ASTA Compression ............................................................................................... 33
Registry Keys Used by ASTA ................................................................................. 33
Useful Utility Methods ...........................................................................................34
Integrating ASTA help in the IDE .......................................................................... 34
Client Side SQL vs Coding the Server .....................................................................34
Packet Fetches .....................................................................................................35
Client/Server Manners .......................................................................................... 35
Distributed Database Networks ............................................................................. 36
Suitcase Model .....................................................................................................37
Master Detail Support ...........................................................................................38
Asyncronous Database Access .............................................................................. 39
Multi Table Updates from Joins ............................................................................. 40
SQL Generation ....................................................................................................41
More on SQL Generation .......................................................................................42
Threading ASTA Clients ........................................................................................ 44
ASTA SmartWait .................................................................................................. 45
ASTA State and Stateless Clients .......................................................................... 45
Cached Updates ................................................................................................... 46
Parameterized Queries in a Transaction ................................................................ 48
Refetching Data on Inserts and Updates ................................................................ 49
Streaming Asta Datasets ...................................................................................... 50
ASTA Servers ....................................................................................................... 50
AstaServerFormat ................................................................................................ 51
AstaServerFormat.RemoteAdmin ........................................................................... 52
AstaServerFormat.RemoteControl ......................................................................... 53
AstaServerFormat.CodingTheServer ...................................................................... 54
AstaServerFormat.Messaging ................................................................................ 54
AstaServerFormat.DatabaseSupport ...................................................................... 55
AstaServerFormat.NTService ................................................................................. 55
ASTA Server Named Pooled Sessions .................................................................... 56
ASTA Database Server Support ............................................................................. 58
Verifying Clients connected to an ASTA server. ...................................................... 58
ASTA Middleware Triggers .................................................................................... 59
ASTA Server Admin .............................................................................................. 60
ASTA Server Logging ............................................................................................ 61
ASTA Servers and Multiple DataSources ................................................................ 62
ASTA Servers and Visual Interfaces ....................................................................... 64
Building ASTA Servers .......................................................................................... 65
Coding ASTA Servers ............................................................................................ 66
Command Line Switches .......................................................................................66
2 / 449
ASTA 3 for Delphi
TAstaNestedDataSet.ParentDataSet ....................................................................273
TAstaNestedDataSet.PrimeFields ........................................................................ 273
TAstaNestedDataSet.UpdateTableName .............................................................. 274
Methods ............................................................................................................. 274
Events ............................................................................................................... 276
TAstaUpdateSQL ................................................................................................ 277
Properties .......................................................................................................... 277
TAstaUpdateSQL.DeleteSQL ............................................................................... 277
TAstaUpdateSQL.InsertSQL ................................................................................. 277
TAstaUpdateSQL.ModifySQL ................................................................................ 278
TAstaUpdateSQL.Params .................................................................................... 278
Methods ............................................................................................................. 279
TAstaUpdateSQL.GetSQL .................................................................................... 279
TAstaUpdateSQL.ParseParams ............................................................................ 279
Events ............................................................................................................... 280
TAstaUpdateSQL.AfterSQLBatchInsert ................................................................. 280
TAstaUpdateSQL.AfterSQLItemInsert .................................................................. 280
TAstaUpdateSQL.BeforeSQLBatchInsert ............................................................... 281
TAstaUpdateSQL.BeforeSQLItemInsert ................................................................ 281
TAstaStatusBar .................................................................................................. 281
Remote Directory Components ............................................................................ 282
Server Side ........................................................................................................ 283
TAsta2MetaData ................................................................................................ 283
Properties .......................................................................................................... 286
TAsta2MetaData.MetaData ................................................................................. 286
TAsta2MetaData.MetaDataList ............................................................................ 286
Methods ............................................................................................................. 286
TAsta2MetaData.AdjustAlias ............................................................................... 287
TAsta2MetaData.InitDataSet .............................................................................. 287
TAsta2MetaData.GetMetaData ............................................................................ 287
Events ............................................................................................................... 287
TAsta2MetaData.AfterMetaData ..........................................................................288
TAsta2MetaData.BeforeMetaData ....................................................................... 288
TAsta2MetaData.OnDBMSName .......................................................................... 288
TAsta2MetaData.OnFields ...................................................................................289
TAsta2MetaData.OnForeignKeys ......................................................................... 289
TAsta2MetaData.OnIndexes ............................................................................... 289
TAsta2MetaData.OnOtherMetaData .................................................................... 289
TAsta2MetaData.OnPrimeKeys ............................................................................ 290
TAsta2MetaData.OnStoredProcColumns .............................................................. 290
TAsta2MetaData.OnStoredProcs ..........................................................................290
TAsta2MetaData.OnSystemTables ...................................................................... 291
TAsta2MetaData.OnTables ................................................................................. 291
TAsta2MetaData.OnTriggers ............................................................................... 291
TAsta2MetaData.OnVCLFields ............................................................................. 292
TAsta2MetaData.OnViews .................................................................................. 292
TAstaBDEInfoTable ............................................................................................ 292
Properties .......................................................................................................... 293
TAstaBDEInfoTable.BDEInfo ............................................................................... 293
TAstaBusinessObjectManager ............................................................................. 294
12 / 449
ASTA 3 for Delphi
TUtilInfoType .....................................................................................................449
22 / 449
ASTA 3 for Delphi
ASTA 3
The Internet Second Wave is here and the ASTA Technology Framework provides the
foundation to not only build scalable rich, thin client applications but to add collaborative
tools and full cross platform support beyond the Desktop.
Most ASTA developers are Database Application Developers and start with a database
centric view of the world. ASTA wants to remind you that "There is more to Heaven and
Earth Horatio, than Win32 Database applications". There is an Internet Second wave
coming that will leverage wireless and collaborative technologies and with ASTA you can
provide today what your customers will be asking for tomorrow.
ASTA allows you to build cross platform, thin client, zero admin, secure, scalable
Database applications that can run over the Internet. We want you to concentrate on
coding your application rather than dealing with low level issues like threading or writing
SQL update statements.
Below is a list of general Topics covering ASTA that you can refer to, in order for you to
see what is possible. And ASTA is committed to making what is possible, easy to
implement.
Firewalls Firewalls
Security Encryption
Authentication
Trusted Addresses
23 / 449
ASTA 3 for Delphi
XML XML
Created with the Personal Edition of HelpNDoc: Effortlessly Create Encrypted, Password-Protected PDFs
In Memory DataSets
Index Support All ASTA datasets now have indexes for findkey and
set range support and optimized locate calls to use
indexes where available
Extended XML SupportADO and Midas formats supported using the native
ASTA XML parser or the Microsoft Parser using a
"thunk" layer built into ASTA 3
SQL Generation
Params for SQL Params are now used in all SQL generation
Generation deprecating the requirement to set AstaClientSocket
properties like DateTimeMaskforSQL
24 / 449
ASTA 3 for Delphi
Security
Strong Encryption options currently available to the
US and Canada only. We have submitted the
papework to allow for distribution outside of North
America.
XML
ASTA Native XML Pascal DOM XML parser or thunk layer using the
Parser Microsoft Parser or Delphi 6 components. Thunk layer
available in source code only licenses.
ASTA XML Explorer XML Explorer shows how to use the ASTA DOM
Parser
XML Thunk Layer Allows the ASTA XML parser to be used or the
Microsoft Parser
HTTP Tunneling
ASTA clients can tunnel through any firewall using ASTA Sockets or
WinInet. Use of winInet is now uses dynamic loading of WinInet.dll
AutoUpdate
The autoupdate process has been extended to allow for the Updated EXE to
be streamed from http servers and to also integrate the ASTA Binary Patch
Manager to allow for just "delta's" or binary patches to be streamed down
and applied by remote clients.
ASTA Servers
ASTA servers are available in a new format that
allows for them to be run as normal EXE's or NT
Services. Additionally they can be easily extended to
support the following technologies (typically with just
a property setting):
25 / 449
ASTA 3 for Delphi
Remote Control
Instant Messaging
PDA support
ODBC Driver
JDBC Driver
New Threading Model New tmSmartThreading allows for ASTA Pooled and
Persistent Sessions threading to be mixed allowing
for the best of both worlds.Scalable servers using
connection pooling but also for any user being able to
connected using a specific user name and password.
Named Pooled
Sessions
ODBC Driver
Servers support the ASTA thin client ODBC driver available using the ASTA
Safari Kit
JDBC Driver
Servers support the ASTA type 3 JDBC driver available using the ASTA
Safari Kit
C# Client
Dot net support available from the ASTA safari kit
COM Client
Non VCL Com client available from the safari pack using Wince of Win32
Messaging Options
Extended Messaging options using new OnOutParamList event on the
AstaServerSocket and threaded Database enabled blocking messaging
calls.
Options to send and get large files from servers to clients and clients to
servers in configurable "chunks"
Instant Messaging
Formal Instant Messaging API (IMA) to support sophisticated IM
applications including disconected messaging with Java, Palm and WinCE
IM clients available.
26 / 449
ASTA 3 for Delphi
Remote Control
ASTA Remote Control source was given to ASTA 2.6 users as a XMAS
present in Dec 2001. It is now easily integrated into ASTA 3 servers with a
line or 2 of code and allows for pcAnywhere type of access to the remote
Server. ASTA licensing has been relaxed to allow for RemoteControl Servers
to be run from client apps so that ASTA users can support their clients by
connecting directly to their machines and "taking control" of the application
from a remote admin client.
Provider Broadcasts
New manual provider Additional properties have been added to make
broadcasts broadcasting and updating possible with no code.
Cached MetaCalls
When setting servermethods or provider names at runtime, ASTA clients
must fetch param information. This is optionally cached locally to avoid a
trip to the server.
Enhanced Logins
Logins now include a ClientParamList returned to clients on logins and also
allows for the pickup and any messages sent to other users while off line.
KeepAliveOptions
Some networks disconnect after certain periods of activity. The
AstaclientSocket has a new KeepAlivePing option that sends a
codedMessage to ASTA servers to keep dialup lines active.
Voip Support
ASTA Voice over IP is Is not part of ASTA 3 but will be integrated with ASTA
in Beta. This is an 3 instant messaging and TAstaMQManager to provide
ASTA addon. for administrative features for VoIP apps.
27 / 449
ASTA 3 for Delphi
ASTA Scheduler
We have licensed the Scheduler component written by David Quinn from
ASTA UK and this will be integrated in ASTA 3 to work with the
TAstaMQManager to allow for events to be scheduled and exececuted in
threads.
ASTA Scheduler probably won't make it into the initial release of ASTA 3 but
will come soon after.
ServerMethods can now be called from Palm and WinCE clients directly
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
ASTA 2.6 and ASTA 3 are largely compatible as we have taken great care in making sure
that your existing applications will migrate easily. This document will discuss migration
issues from ASTA 2.6 to ASTA 3.
OnSubmitSQLParams
OnServerQuerySetParams
All of the properties used on the AstaSQLGenerator and AstaClientSocket to format SQL
have become deprecated.
2. ASTA Servers are now in a new format to run as normal exe's or services. There is a
new AstaServiceUtils unit that encapsulates all that is necessary to run servers as
services. ASTA 3 Server's main forms descend from the TAstaServceForm in order to run
as services or normal exe's. In addition, there are built in concepts of Remote Control and
Remote Administration.
4. ASTA server add a new threading model that implements Pooled sessions but also
allows for any remote client to run their own PeristentSession and to switch back and
forth from Pooled or Persistent. It is recommended that all servers run
tmSmartThreading.
28 / 449
ASTA 3 for Delphi
5. Indexes are now available for AstaDataSets. All AstaDataSets and AstaClientDataSets
now have Indexes. In the past, the way to re-order datasets was to sort them. The old
sort calls still work, but create temp indexes. Calls like SetRange are now supported. You
probably want to rethink calls like SortDataSetByFieldName and SortOrderSort to use the
new indexes.
6. XML- ASTA 2 DataSets supported XML and ASTA 3 still supports the old ASTA 2 XML
routines. But ASTA 3 has a new DOM XML Parser and adds supports for standard ADO and
DataSnap formats as well as AstaParamList XML Routines so it is recommended that the
new XML DOM support be used.
Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation
ASTA History
ASTA has been in development since 1997 after Delphi Chief Architect Chuck Jazdzewski
visited the Boise Delphi User Group and told us about the new open TDataSet model in
Delphi 3 along with the new borland sockets. Within 2 weeks we had AstaClientDataSets
streaming across the Internet.
It took us 7 months then to develop ASTA 1.0 which was released in July of 1998 after a
large beta. ASTA 2 was released in October 1999 adding server side components like the
TAstaProvider and TAstaBusinessObjectsManager. ASTA Palm and Wince support was
added in the year 2000 and AstaInterOP for Windows and Linux for cross platform
support was released in 2001. ASTA 2.6 was released in July 2002.
To that we have since added the ability to go cross platform and with any device with the
ASTA SkyWire Architecture. Our design goals have evolved to our Hitchhikers Guide to
the Wireless World.
The ASTA train is on track and moving forward to bring you the latest technology and
making it easy for you to use. The ASTA team is commited to doing whatever it takes to
29 / 449
ASTA 3 for Delphi
assure that YOUR ASTA project is successful! We want to hear from you. Don't hesitate to
contact ASTA with any question or suggestion
With the release of .NET the Windows landscape has been forever changed. Microsoft has
foresaken COM and, with the help of Turbo Pascal Creator and Delphi 1 Chief Architect
Anders Heilsjsberg, Microsoft now has Delphi like Tools. At the Borland conference in
Anahheim, Anders showed the new code to create a form in .NET. The old Windows
Petzold style of coding required calls like this
HWND CreateWindowEx(
Anders showed new calls that looked like Delphi code and commented that this was not
new for the Delphi guys and good ideas don't change!
Form1:=TFormCreate(Nil);
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/cpref/html/frlrfSystemDataDataTableClassTopic.asp
These tools will be part of the ASTA SkySync initiative which provides
for Cross Platform Syncronization.
http://www.astawireless.com/products/skysync/
30 / 449
ASTA 3 for Delphi
Combined with the existing ASTA cross platform messaging, ASTA users
will be able to connect to any remote database server built to run
on Win32 or Linux or any platform that supports Java, disconnect from
the server ,and then edit insert and delete as required. At a later
time, the client will be able to connect once again to the remote server
and post updates with full conflict resolution via Delphi or scripting.
By using the .NET model ASTA lays the groundwork for .NET clients
without the necessity for the CLR. ASTA plans to support .NET clients
with applications written using VB6, Delphi 5 and 6, Kylix, Java, Palm,
WinCE and GCC Linux.
Java is best used on the server as is .NET. With thin, rich, no admin
ASTA clients the best of both worlds can be achieved. Use Architect
level programmers to code servers using Delphi, C# or Java and
application devleopers using Delphi, Visual Basic 6 and any of the
Popular PDA DEvelopment tools to create secure, thin client applications
that run efficiently over the Internet.
This initiative will include virtualizing the ASTA Delphi and Kylix
DataSets to be able to be configuarable as to the amount of memory used
along with a full SQL92 client SQL parser. Persistency will be achieved
using individual files or a paging system to allow for any number and
amount of data to be streamed to one file. ASTA will implement this
under Pascal and C++ for SkyWire Use.
void Clear(void);
void Reset(void);
void BeginLoadData(void);
void EndLoadData(void);
void AcceptChanges(void);
void RejectChanges(void);
};
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
31 / 449
ASTA 3 for Delphi
General Topics
Database Discussion
ASTA Clients
ASTA Servers
ASTA Messaging
ASTA Tools
Automatic Client Updates
Firewalls
Provider Broadcasts
Security Issues
Sockets and tcp/ip Issues
XML Support
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
1. Always code the AstaclientSocket.OnDisconnect event even with a comment or set the
new AstaclientSocket.SQLErrorHandling.seNoExceptiononDisconnect to true. It is
imperative that your know when your client disconnects so ASTA will raise an exception
by default unless you assign the OnDisconnect event or set the
seNoExceptionOnDisconnect to true.
2. Run an ASTA server unchanged first and write some Client side SQL before you start to
code the server so you can get a "feel" for the way things work
3. Don't worry about writing Update, Insert or Delete SQL Statements as ASTA was
designed so that you only need write Select SQL and then just set the EditMode property
of the AstaClientDataSet.
4. Do not tried to open AstaClientDataSets in the formcreate method. The earliest you
can open an AstaClientDataSet is in the OnConnect method of the AstaclientSocket or of
your server has higher security settings, after your client has been authenticated.
5. If you want to reconnect an ASTA ClientSocket after it has disconnected, you cannot
set the Active to true Property in the OnError or OnDisconnect Event. Use a TTimer
instead to allow the event to be passed through and to have the timer trigger the Active
:= True outisde of the OnError or OnDisconnect event.
7. If you have an AstaClientDataSet open at design time do not try to open it in the
OnConnect method. You can do one OR the other but not both.
8. NEVER set the AstaClientSocket.Active at design time. The Borland sockets that ASTA
inherits from do not support design time connection.
32 / 449
ASTA 3 for Delphi
9. To use the AutoClientUpdate feature you must have your clients log into the server.
ASTA Compression
To use compression with ASTA just set the Compression property of the AstaServerSocket
and AstaClientSocket to AstaZLib. All data now passed between clients and servers will
be compressed. AstaZLib compression is available cross platform including Win32, Palm,
WinCE and when used with ASTA Java clients.
Note: earlier versions of ASTA used a freeware lzh compression unit that turned out not
to be thread safe. AstaZLib compression is recommended.
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
ASTA uses a registry key to store some values in the registry. by Default it is set to
HKEY_CURRENT_USER. Source code users can change this by a DEFINE in Asta.Inc
{$IFDEF USEREGISTRYLOCALMACHINE}
AstaRootKey = HKEY_LOCAL_MACHINE;
{$ELSE}
AstaRootKey = HKEY_CURRENT_USER;
{$ENDIF}
Main Key:
AstaRegKey = AstaRootKey\SOFTWARE\Asta'.
33 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
Unit
AstaUtil
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
Created with the Personal Edition of HelpNDoc: iPhone web sites made easy
The fastest way to deploy internet ready client server applications is to use ASTA's client
side SQL. This allows you to use ASTA servers unchanged and to write ASTA client
applications much the same way you would code normal 2 tier fat client applicatons.
If your existing BDE applications have TQueries on data modules then you simply need
do a Save As and create a new data module. Then replace all the TQueries with
TAstaClientDataSets and the TDatabase with a TAstaClientSocket. If your application
already has good client/server manners then you should be able to ASTA'cize your
application very quickly. There is an ASTA Conversion Wizard to help out with this
process.
N-tier programming purists believe that there should be NO SQL on the client and all the
"business rules" should be defined on the server. ASTA supports this also with
TAstaProviders, TAstaBusinessObjectsManagers and ASTA messaging. This allows you to
deploy ASTA clients that use NO SQL but merely point to either a TAstaProvider on an
ASTA server or a server side method.
To use ASTA server side components you must of course code an ASTA server, so
development time may be greater than with client side SQL. However there are other
benefits to deploying clients with NO SQL in that the client application need not change
with modifications only made to the server.
34 / 449
ASTA 3 for Delphi
Once you have business logic on an application server you may then "share" some of
those Methods with business partners, by publishing them via SOAP Services so that your
business partners can have access to required services.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
Packet Fetches
AstaClientDatasets can be set to Open a Server side cursor and return RowsToReturn
number of rows. In this way large queries can be more efficiently fetched over latent
lines. In order to use this technique the ASTA server must be running in
PersistentSessions threading model which requires each remote client to have their own
Database Session. Although this technique is useful, the AstaServer will not scale as well
as when it is run using the recommended Pooled Threading Model.
When RowsToReturn is set to -1 all rows are returned. When RowsToReturn is set to 0
only the FieldDefs are returned and an empty DataSet is returned. This may be useful
when only inserted rows are required.
After a Packet Fetches is executed you may also then do a GetNextPacketLocate which
executes a server side Locate call on the open TDataSet on the server. Performance will
depend on the size of the result set and how the Locate is implemented by your server
side component. File server components like DBISAM can use indexes on locates so
performance can be quite fast. For client/server databases indexes are not available on
result sets so server side locates would have to iterate sequentially through the DataSet
so large result sets may not result in fast results.
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
Client/Server Manners
The two most important factors affecting performance of your ASTA client application are
bandwidth and your application design. It is important to follow the client/server prime
35 / 449
ASTA 3 for Delphi
directive: Fetch ONLY what you need WHEN you need it.
If you come from a file server background, then you should think about moving from a
procedural, navigational model to an SQL result set oriented design. The "appearance" of
great speed and responsiveness can be achieved by limiting the amount of data
requested from ASTA servers, and the number of requests made to the server.
Client/server round trips are costly.
See also:
The Paradox of Databases Online
ASTA for Database Developers Online
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
This is available as part of the ASTA Safari Pack or separately as ASTA PosBus.
ASTA allows remote users to connect to databases across the Internet and efficiently
communicate with a remote server. When deploying applications over WAN's and the
Internet, developers must be very conscious of the cost to and from remote servers. In
this brave new world the most precious resource is now bandwidth, not cpu speed,
memory or database speed.
Disconnected Users
Oftentimes users work remotely or connect to a server for a limited period of time and
then want to be able to work "offline". With the rise in wireless communication and the
spread of reasonably priced connectivity, more and more employees will be given the
opportunity to work remotely but will not always be able to be connected to a remote
server 24 hours a day, 7 days a week.
The Solution
To deal with all the above issues, ASTA is developing an Add On that uses the internal
36 / 449
ASTA 3 for Delphi
code name of AstaPosBus. (PosBus is Afrikaans for Post Office Box and was coined by the
PosBus project leader Stephan Marais as Stephan had experience on a simlar project in
his native South Africa). ASTAPosBus will allow table by table and field by field replication
and syncronization. Replication can be very complicated subject but ASTAPosBus will
attempt to provide base methods to allow for ASTA developers to easily synchronize data
between remote databases using ASTA servers.
Purpose
To provide a basic process to sync remote databases with a server database. This does
not apply to database schema changes, only data changes. There are 3 different actions
that can be applied to a table, and depending which kind of action, it must be handled
differently.
Insert
Can be handled in two ways:
1. The table must contain an update_date/insert (datetime) field
2. An audit table can be used to record the insert. The audit table must also contain an
"action" field
Update
Can be handled in two ways:
1. The table must contain an update_date/insert (datetime) field
2. An audit table can be used to record the insert. The audit table must also contain an
"action" field
Delete
1. An audit table can be used to record the insert. The audit table must also contain an
"action" field
Assumptions
1. Primary keys are not allowed to be changed. If needed, delete the record and make a
new entry
2. The tables on the server must have at least all the fields as the tables on the client
3. If audit tables are used, each audit table must have a field called action_indicator
(char) and audit_date (datetime)
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
Suitcase Model
The following discussion uses the example as supplied with the ASTA components in the
\ASTA\Tutorials\SuitCase directory.
37 / 449
ASTA 3 for Delphi
SaveCachedUpdates This also saves and loads the internal FOldValuesDataSet where
ASTA stores the original values if EditMode is set to Cached or
After Post.
In the Asta Suitcase tutorial, a normal query is run but then the TAstaClientDataSet
saves the data from the query to a file by calling AstaClientDataSet1.SaveSuitCaseData.
This saves all the data, including all the field types (even blobs and memo fields) to disk.
Run the tutorial, do the query and click the Save to File button. Stop the tutorial, and this
time set the SuitCaseData.Active property to True. When you compile and run the
tutorial, instead of fetching the data from the remote ASTAServer, the TAstaClientDataSet
will load the data from the SuiteCaseData.FileName property.
The following methods are available to aid in the Suitcase Model and are implemented in
the TAstaDataSet the ancestor of the TAstaClientDataSet.
1. Set up a normal query with some SQL and set the Active property to True.
2. Set the Suitcase.Active to True but DO NOT put a file name in the
Suitcase.Filename property. This will have the effect of keeping the table open at
run time but NOT firing a query to fetch data from the server. This is what
OpenNoFetch does.
3. When you want to fetch your data, instead of closing and opening the table, call
the AstaClientDataSet.RefireSQL method.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
The TAstaDataSet and the TAstaClientDataSet both suport master detail linking with
MasterSource and MasterFields properties. When the AstaDataSet is used as a
DetailDataSet it uses a filter to implement the limiting of visible rows. The
AstaClientDataSet requires a parameterizd query to run live master detail queries from
the server.When the Master changes a new query is fired to the server for the detail.
After writing the SQL be sure to set the Parameter datatype using the Params property of
the AstaClientDataset. As the MasterDataSet is scrolled a new query is fired from the
detail dataset using the linked field to populate the Param. On inserts you are required to
code the OnNewRecord event of the DataSet to set any detail values that are linked to
38 / 449
ASTA 3 for Delphi
the master.If the Param name, in the above case Custno, matches the linked field on the
server, then the Detail CustNo field will be automatically populated.
AstaClientDataSets can also run in masterdetail mode disconnected from the server by
fetching the complete detail dataset and then using filters. There are AstaClientDataSet
helper methods to facilitate moving back and forth between live detail selects using
parameterized queries and the fetching of the complete detail table for all master fields
using filters. See AstaClientDataSet.SetToDisconnectedMasterDetail and
AstaClientDataSet.SetToConnectedMasterDetail and the BDE Master Detail tutorial for an
example.
For support of AutoIncrement fields on Master DataSets that Detail DataSets link to there
is a method called SendMasterDetailAutoIncTransaction.
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
The Asta Pooled threading model has been extended to allow asyncronous query support.
In ASTA's Pooled Threading Modela Pool of Database Sessions are created at system
startup. Using the BDE as a model, this typically consists of a Datamodule that includes a
Tdatabase/TSession Pair. On server start up you can say Sessions=8 and 8 Datamodules
will be created when the server starts up.
When a remote ASTA client makes a database request, using a TAstaClientdataSet, the
client goes into a wait state and sends the request to the server. On the server, one of
the "Sessions" is checked out of the Pool and a thread is launched with that session.This
means that only one client side process can be executed at any time for a remote client.
AstaclientDataSet1.Open;
AstaClientDataSet1.Next;
etc.
ASTA must hide the asyncronous nature of sockets and go into a "wait state".
The client socket is used as a token on the server to "check" a session out of the pool.
ASTA allows a remote client to have more than one Session in use on the server using
ASTA messaging. So on the client you can now SendACodedParmList and on the server
you can thread the message call using the ThreadedDBUtilityEvent to ask for a query,
execute the sql and stream the result back in a TAstaParamList. The AstaBDEServer is
now coded to allow for async messaging using this technique and a client test app is
available. This is different than using a TAstaClientDataSet. You send out the messages in
SendCodedParamList and then you must handle them in the OnCodedParamlist event.
Say you send out 5 messages with sql requests. They all go to the server and each will
get their own Session from the pool and be launched in a thread using the Messaging
thread call ThreadedDBUtilityevent. They will finish executing at different times
depending on the size of the result set etc and will be streamed back to the clients
OnCodedParamList.
39 / 449
ASTA 3 for Delphi
case Msgid of
1550: AstaServerSocket1.ThreadedDBUtilityEvent(ClientSocket, ttSelect,
TestUtilSQLEvent, Params);
end;
This calls the ThreadedDBUtilityEvent which is used to thread messages and the ttSelect
represents the type of database component you require for your event, in this case
TestUtilSQLEvent. ASTA delivers you the Query which is what is returned from
ThreadedDBSupplyQuery for ttSelect. The result set is stuffed in the ParamList and
returned to the client.
Maximum Sessions
You can now define Maximum Sessions for each client. In this case with the BDE Server
we started the server with 2 pooled sessions and we don't want it extended. So the
MaximumSessions is set to 2 and the MaximumAsyncSessions is put at 2. If a client
executes 10 async queries at once, at most only 2 sessions will be used for that client.
The rest will be queued up and executed as soon as a session is available.
AstaServerSocket1.MaximumSessions := 2;
AstaServerSocket1.MaximumAsyncSessions := 2;
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
ASTA supports multiple tables to be updated when using a Cached EditMode. This is not
supported in AfterPost edit mode as a transaction is required for the possible multiple
lines of SQL generated for any one row.
1. Write your SQL Join and set the AstaClientDataSet.Active property to true at design
time
2. Use the EditMode property editor and click on the Multi Table Join Tab
3. Click on the Define fields for multiple table updates button
4. Choose an Update tablename for each field and tag the primekey fields.
40 / 449
ASTA 3 for Delphi
Note: the PrimeKeys of all the update tables must be included in the Join as they will be
required for the SQL.
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
SQL Generation
ASTA can generate SQL either on the client or on an ASTA server. You may configure
ASTA to generate SQL according to your database requirements.There are several
properties and events that can be changed to customize your SQL syntax. With ASTA 3
these options are required to be used less often as ASTA 3 generates Paramerized Queries
so that the Params themselves are passed to the server where the Delphi Database
Component on the server must be coded to handle them.
The following properties and events are available on the client using a TAstaClientSocket
and on the server using an TAstaSQLGenerator.
Properties
SQLOptions
UpdateSQLSyntax
SQLDialect
Events
OnCustomParamSyntax
OnCustomSQLSyntax
When SQL is used on the client, SQL for inserts, updates and deletes is generated by
ASTA and posted to the server. When there is NO SQL on the client, inserts, updates and
deletes are accomplished by sending an OldValueDataSet and a CurrentValueDataSet to
TAstaProviders which generate SQL on the server and provide events that you can code to
41 / 449
ASTA 3 for Delphi
ASTA can generate SQL either on the client or on an ASTA server. On the client side the
TAstaClientSocket has the following properties and events to allow you to customize your
SQL. If you are using server side SQL generation then you must have an
ASTASQLGenerator connected to the TAstaServerSocket on your ASTA server. The
AstaSQLGenerator acts similarly to the TAstaClientSocket in allowing you to customize
your SQL. SQL dialects can vary greatly between databases and locations. ASTA provides
certain properties and events to allow you to customize your SQL to fit your database and
your locale.
TAstaServerSQLOptionTypes = (ssUseQuotesInFieldNames,
ssTableNameInInsertStatments, ssBooleanAsInteger, ssUSDatesForLocalSQL,
ssTerminateWithSemiColon, ssNoQuotesInDates, ssDoubleQuoteStrings,
ssUseISInNullCompares);
TAstaServerSQLOptions = set of TAstaServerSQLOptionTypes;
Value Meaning
ssUseQuotesInFieldNames Used for Paradox or any database that allows spaces in field
names. Databases like Access need this set to false.
ssBooleanAsInteger MS SQL Server has bit fields that map to ftboolean in the
VCL but then the SQL must be generated as Integers, eg. 0
or 1.
ssUSDatesForLocalSQL Interbase, Paradox and xBase using the BDE don't like
international dates so this forces the server to receive US
formatted dates.
ssNoQuotesInDates Use this if you don't want to use single quotes in dates and
datetimes.
ssDoubleQuoteStrings Use this if your strings don't need single quotes but double
quotes.
Note: The following discussion provides routines that were used in older versions of ASTA
and are kept for backwards compatibility. With ASTA 3 which sends full parameterized
queries to the server, most often you will not need to use these routines.
There may be times where these settings are not enough to customize the SQL that ASTA
42 / 449
ASTA 3 for Delphi
generates. In those instances you can use the DateMaskforSQL and DateTimeMaskForSQL
properties to tell ASTA how to format your ftDate and ftDateTime fields in select
statements and update and insert statements.
There are also two events available on the TAstaClientSocket and the TAstaSQLGenerator
that allow any field to be formatted to your specifications. Note that you MUST set the
boolean parameter Handled to true if you are overriding the default format that ASTA
uses. It is up to you to format the string parameter TheResult to your specifictions.
If the SQL that ASTA generates for your database is not correct, you may write a method
handler that allows you to supply the correct SQL syntax.
Remember to set Handled to true so that ASTA knows that you are going to be handling
these fields.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
43 / 449
ASTA 3 for Delphi
There may be times when you want to thread your ASTA client application in order to
be able to populate AstaClientDataSets in the background. When threading normal
client/server applications each thread must have it's own database connection and query
component. If you are connected to one ASTA server, all TAstaClientDataSet requests go
through one TAstaClientSocket which uses pooled Database Sessions on ASTA servers so
things are a bit different in the N Tier World.
The client makes a request to a server and then waits to get data back from the
server. The request is quite small and very fast, it's the result set that must be processed
on the server, execute, packed up and streamed back that takes the time.
When you enter the world of Async, what can happen on the server is that one client
can have multiple threads running on the server at the same time so a single client could
be using multiple Database Sessions on the server. With 50 clients doing async queries
along with normal queries this could greatly increase the Database Sessions used on the
ASTA server. So be careful of this resource consumption and will mostly depend on the
Delphi Database Component used on your ASTA server. The BDE for instance requires
quite a bit of resources for each TDatabase/TSession connection. Other components
require a lot less (eg ADO,IBObjects, DOA, dBisam, Advantage,NativeDB). Your mileage
will vary.
44 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle
ASTA SmartWait
ASTA Clients use Asyncronous non-blocking event driven sockets to communicate with
remote ASTA servers. This means that typically a request is sent to the server and the
client does not "wait" or "block". Any response from the server is received in a event and
is thus called Event Driven Programming.
Database Applications are difficult to code using this model since developers need to
write procedural code such as:
AstaClientDataSet.Open;
while not AstaClientDataSet.Eof do begin
//do something
end;
When your client appliction is first executed you will need to understand how the
asyncronous sockets work to know when the remote server is actually connected to in
order to then access the database.
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TCP/IP maintains state so that when a client connects to a server they stay connected
until either client or server wants to force a disconnect, or there is a network error forcing
a disconnect.
HTTP is a stateless protocol and runs on top of TCP/IP. It is the protocol that has made
the Internet famous and ubiqutious for use by browsers. Browser clients use HTTP to
connect to a remote web server, make a request, and then disconnect. HTTP typically
runs on port 80.
45 / 449
ASTA 3 for Delphi
ASTA servers and clients. TCP/IP has a number of benefits which include speed, and the
abililty to "push" data from the server which also enables communication between
clients.
Features like ProviderBroadcasts allow for any interested client to be notified immediately
if another user makes any change to a database via a TAstaProvider. This feature would
not be possible, in real time, if the clients were running stateless.
ASTA supports a login or authentication process where a user connects and gets
authenticated and added to the AstaServerSocket.UserList. Of course if clients are
stateless, the standard authentication mechanism designed for TCP/IP will not function.
ASTA supports this with stateless cookies.
There may be times when TCP/IP is not appropriate or possible. These include when a
firewall is present on the client, when using ASTA client components in ISAPI dll's, or in
handheld development.
Firewalls
http://www.astatech.com/support/white/firewalls.asp
Many firewalls do not allow allow TCP/IP traffic but only HTTP traffic via browsers. ASTA
supports this through HTTP tunneling where the ASTA messages are "wrapped" or
disgusised as HTTP. In order to use HTTP tunneling with ASTA, a web server is required.
An ISAPI dll is available in the ASTA installation named Astahttp.dll. This dll is copied to
a web server like IIS and installed in a directory that allows for ISAPI dll's to be run.
Typcially in the scripts directory for IIS.
The AstaClientSocket has a WebServer property that allows for the configuratio of the
AstaClientSocket to use http either using ASTA sockets or using the Microsoft DLL
WinInet.dll. WinInet.dll comes with any version of IE (Internet Explorer). Using the ASTA
WinInet option is the recommended way to traverse any firewall as it uses settings
already in place by Internet Explorer.
Clients that run HTTP connect and disconnect to the server on each request. There is
overhead in this. Additionally, there is no userlist on the AstaServer socket when running
stateless and the normal ASTA authentication process does not apply. ASTA supports the
authentication of stateless clients. For a discussion of this see the Cookies Discussion.
Blocking Clients
ASTA sockets are async and event driven and do not block or require threads. They use
the recommended mode of event driven socket programming by Microsoft using windows
messages. Windows programs contain a "message" pump to handle windows messaging.
If you are coding an ISAPI dll there is no message pump so ASTA clients must run in
blocking mode. See the Blocking Discussion for more detail on this.
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
Cached Updates
Asta supports data-aware controls and can generate SQL to automatically transmit
46 / 449
ASTA 3 for Delphi
update, insert and delete statements to the ASTA server. To enable automatic SQL
generation you must set three public properties using the EditMode property editor. Make
sure you set some SQL and make your table active first so that there are actual field
names available for ASTA to work with.
The EditMode property editor allows you to set up a TAstaClientDataSet so that ASTA can
automatically generate the SQL for you. The EditMode property editor requires that the
TAstaClientDataSet have field information already defined by writing an SQL select
statement and setting active to true. After using the property editor, it will display text
regarding the EditMode status as Read Only, Cached or After Post. For fields that you do
not want included in any insert, update or delete statement set the ReadOnly property of
that field to true. For AutoIncrement fields, just pull down the AutoIncrement property
with that field name and it will not be used on insert statements. of ASTA can Refetch
the auto increment value of a field, and other fields automatically after an insert
statement, as well as after update statements if the AstaServer you are running supports
this.
UpdateTablename This is the name of the table that is to be updated and works just like
the TableName property with a pull down list of tables available on the
server.
PrimeFields Asta needs to know what fields are used to determine uniqueness.
UsmServerTransaction This posts the SQL to the server and calls the explicit
transaction support that ASTA servers have. The AstaBDEServer
will use the TDataBase.StartTransaction call. The
ASTAODBCExpress server will use the Thdbc.StartTransact. See
the TAstaTransaction.doc for a discussion on transactions.
UsmCommitAnySuccess This posts the SQL to the server just like usmServerTransaction
however a Commit will be called on the server if any SQL sent
to the server is successful.
47 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Project Analyzer
To send plain update, insert and delete ExecSQL in a transaction you can use
SendSQLTransaction or SendSQLStringTransaction. If you want to send a list of
Parameterized ExecSQL statements you can use the following methods.
procedure ClearParamterizedQuery;
procedure AddParameterizedQuery(TheSQL: string; P: TAstaParamList);
function SendParamterizedQueries: TAstaParamList;
function ParamQueryCount: Integer;
Example
var
p, p1: TAstaParamList;
i: Integer;
begin
p := TAstaParamList.Create;
p.FastAdd('LastName', 'Borland');
p.FastAdd('EmpNo', 2);
with AstaclientDataSet1 do begin
ClearParameterizedQuery;
AddParameterizedQuery('Update employee set LastName = :LastName where
EmpNo = :empNo', p);
p.parambyName('Empno').AsInteger := 4;
AddParameterizedQuery('Update employee set LastName = :LastName where
EmpNo = :empNo', p);
p.Clear;
p.FastAdd('Phone', NewExt.Text);
p.FastAdd('PhoneExt', OldExt.Text);
AddParameterizedQuery('Update employee set PhoneExt = :Phone where
PhoneExt < :PhoneExt', p);
48 / 449
ASTA 3 for Delphi
p1 := SendParamterizedQueries;
end;
Memo1.Lines.Clear;
//params will include the orginal SQL as the name and either an Error
message or the
//rows affected in the actual param
for i := 0 to p1.count - 1 do
memo1.lines.add(p1[i].Name + ':' + p1[i].AsString);
p.free;
p1.free;
end;
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
ASTAClientDataSets can refetch values from the server on inserts and updates. Use your
down arrow in this grid to add a row or two but only put something in the SomeField
column. Leave the id and default field fields alone. For master/detail there is also
autoncrement support in the SendMasterDetailAutoIncTransactionmethod of the
AstaClientSocket.
1. Set up your select query and set your edit mode to cached. Refetch on insert action
can only work within a transaction so your database must support transactions.
3. Set the fields that you want to refetch from the RefetchFieldsOnInsert Property
4. Run your project and call apply updates after you have inserted a row or 2. In this
demo the auto increment value and the default field value are streamed back to the client
with NO code needed by you!
What do you need to do? Not much. Just code one event on the AstaServerSocket.
The above code is specific to your database. For access, paradox and Interbase 5.X the
above code should work in calling MAX to get the last value used by the server for an
autoinc field. For MS SQL Server, Sybase, and SQL Anywhere you would need to write
code to access the @@identify variable. The AstaODBC server is already coded to identify
these databases and make the appropriate call. For Oracle you would need to get the last
sequence value.
49 / 449
ASTA 3 for Delphi
3. If the autoinc is the only field requested to be refetched it is streamed back to the
asta
clientdatset if the transaction is successful. If you have tagged other values in the
AstaClientDatSet.RefetchOnInsert property, an additional select statement is fired that
retrieves
any fields that you have choosen (default server values, values changed by triggers etc)
and all the values are streamed back.
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad
TAstaDataSets are streamable so that they can be saved to disk or even stored in the
blob field of a database. There are several methods available for streaming:
When these methods are called both the defined fields and the data is streamed.
Streaming memos and blobs is fully supported. Since the field definitions are stored in
the form (.dfm) file, TAstaDataSets do NOT load their field definitions when
LoadFromStream or LoadFromFile is called. This is done so as not to interfere with any
persistent fields that you have defined. The fields are, however, always stored in the
saved streams. To load a TAstaDataSet that has been saved from another TAstaDataSet
that has no fields defined, use the following functions:
Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation:
The Benefits of a Help Authoring Tool
ASTA Servers
50 / 449
ASTA 3 for Delphi
· Run Threaded
· Support Client Side SQL
· Remote Adminstration
· Remote control
· Run as a normal EXE or NT Service
· Support the ASTA ODBC Driver
· Support SkyWire (non-vcl) Clients like Palm and WinCE
· Support JDBC Driver
Below is a screen shot of the Asta3ADOServer. ASTA 3 servers use a specific format. See the ASTA
Server components also.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help
Authoring Tool
AstaServerFormat
ASTA Servers can run as NT Servicers or normal EXES. The following is a discussion of the
standard format of ASTA servers. This discussion will use the Asta3ADOServer as an
example but the same concepts apply to all ASTA servers as they are converted to the
new format. ASTA 3 ships with 10+ servers in the new server format with 30+ Servers
available using Delphi 3rd Party Database Components. If you do not see a server using
the Delphi 3rd Party Database Component you want to use contact ASTA.
1. Asta3ADOServer.dpr
2. AstaADOSupplement.pas
3. MainForm.pas which uses AstaServiceUtils.pas
4. SocketDM.pas
5. DM.pas
51 / 449
ASTA 3 for Delphi
The MainForm.pas has the GUI and options to configure the server Port, compression,
encryption etc and implements a form that descends from TAstaServiceForm as defined
in AstaServiceUtils.pas. This has a lot of housekeeping internals to allow the server to run
as a normal EXE or NT Service.
The DM.pas file is where the Database Components reside. If you want to put the
"Business Logic" on the server using TAstaProviders to ASTA Server Methods, code it on
this form. By coding it on the DM.pas, and not accessing any database components
beyond that form, your Database code will be thread safe and ASTA will handle the
threading for you. You can also add as many other DataModules as you desire. Any
Messaging should be coded on the SocketDM.pas unit and that is where you can also add
your PDA Support, with one like of code if you don't want to customize your server for
Palm or WinCE clients but use the SkyWire API only.
Database Support
Remote Admin
Messaging
NT Service
Remote Control
NT Service
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
AstaServerFormat.RemoteAdmin
ASTA servers can be administered from a remote Admin Client. Below is a screen shot of
the AstaServerAdmin that comes with the ASTA Server Download. The
AstaServerSocket.ServerAdmin allows you to set up the server to be administered by are
remote admin client. Internally the AstaServerSocket instantiates another
AstaServerSocket on another port for security purposes.
52 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
These Security Measures
AstaServerFormat.RemoteControl
ASTA Servers support the concept of RemoteControl, just like PcAnywhere where the
machine that a server is running on can actually be fully controlled by a remote ASTA
client. To enable this feature, ASTA servers have a table where the RemoteControl client
port can be configured and the remote control client can be enabled.
If you want to enable this feature on your ASTA server make sure the compiler directive
{$DEFINE AstaRemotecontrol}
is defined in AstaServiceUtils.pas and that your project adds the path to the AstaRemote
Control Components (\Asta\RemoteControl) to your server.
This feature can also be used in your ASTA client applications. You can use an
AstaServerSocket to support your users. ASTA servers licenses do not apply in this case
as ASTA allows you to use the AstaServerSocket and RemoteControl component (found in
your ASTA\RemoteControl directory) to then connect to your clients running your ASTA
app and actually take over their keyboard.
53 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
AstaServerFormat.CodingTheServer
To extend your ASTA server with Messaging, code the SocketDM.pas unit. This is the the
unit that has the AstaServerSocket on it. To extend the server with TAstaProviders and
ServerMethods using the TAstaBusinessObjectsManager code the DM.pas unit which
contains the Delphi Database Components used on your ASTA server. ASTA also supports
any number of other DataModules to be used in your server. We have heard of one user
coding 100 DataModules on an ASTA server!
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
These Security Measures
AstaServerFormat.Messaging
When coding your ASTA server using messaging calls use the SocketDM.Pas unit where
the AstaServerSocket is found.
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
54 / 449
ASTA 3 for Delphi
AstaServerFormat.DatabaseSupport
ASTA Servers support something called Client Side SQL and in order to do this there are
certain features that are required to be supported like supporting SQL Selects,
Parameterized Queries and Transactions. Since each Delphi 3rd Party Database
component uses different properties and mehtods, ASTA has abstracted the whole
Database process in the unit AstaDatabasePlugin.pas.
Each ASTA 3 server, using the new Database format will have a unit called
AstaXXXDatabaseSupplement.pas that implements a descendent of the
TAstaDatabasePlugin.
TAstaADOPlugin = class(TAstaDataBasePlugin)
Source to this file comes with the ASTA server you are using.
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
AstaServerFormat.NTService
Asta Servers can be run as Services or stand alone EXE's. To run as a service, run the
server one time to setup the Server port and other options and then run type from the
command line
Asta3ADOServer /install
Below is the code from the Asta3ADOServer.dpr project file. ASTA uses the registry to
store information about the settings you set from your server. If you want to run multiple
copies of an ASTA server as an NT Service just copy the EXE to another file name like
AstaNorthwindServer.exe and that server will have it's own set of registry settings and
run as an NT Service completely separate from the Asta3ADOServer
begin
//AstaServiceName:=AstaDefaultServiceName;
//default will be Asta3ADOServer
//if you need to run 2 instances just rename the Exe
AstaAppInstancecheck;
if Installing or StartAstaService then
begin
SvcMgr.Application.Initialize;
SocketService := TAstaService.CreateNew(SvcMgr.Application, 0);
// use this next constructor if you have any dependencies where AServiceName is the name of
the service
//SocketService.TAstaService.CreateNewDependency(SvcMgr.Application, 0. AServiceName:
String);
Application.CreateForm(TAstaServiceForm, AstaServiceForm);
Application.CreateForm(TServerDM, ServerDM);
SvcMgr.Application.Run;
end else
55 / 449
ASTA 3 for Delphi
begin
Forms.Application.ShowMainForm := False;
Forms.Application.Initialize;
Forms.Application.CreateForm(TAstaADOServiceForm, AstaServiceForm);
AstaServiceForm.Initialize(False);
Forms.Application.Run;
end;
end.
Dependencies
If you are running your ASTA server on the same machine as your database you may
want to configure the dependencies to wait for another service to start. Below is some
code examples of how to do this for the Interbase Server and the Interbase guardian.
Created with the Personal Edition of HelpNDoc: Keep Your Sensitive PDFs Safe with These Easy Security
Measures
Asta 3 Servers support a flexible Database threading model designed to easily support
the ASP Model (Application Service Provider). ASTA 3 introduces " smart threading" which
means that users can each have their own database connection (Persistent Threading) or
share a "pool" of database sessions.
Pooling Database Sessions allows ASTA 3 servers to scale as users can "share" database
connections. This means that at server startup, any number of sessions are created for
database work. When a remote user comes in for any database work a "Session" or
DataModule, is checked out of the Session pool, the work performed in a thread, and
when the database task is completed, the Session is returned to the Pool. This will allow
for a single session to support many many remote clients. Typically 50-100 users can be
supported with a handful of sessions.
Here is a way to define a session (sales) with 3 initial sessions and it's the default session
Serversocket.MultiSessionList.Clear;
Serversocket.MultiSessionList.AddSession('Sales',3,True);
Serversocket.MultiSessionList.AddSession('HR',2,False);
Serversocket.MultiSessionList.AddSession('Customer Service',5,False);
Asta 3 Pooled Database threading supports the concept of "named" pooled Sessions. This
means that different Session pooled can be created to support groups of connected
clients. Using the AstaServerSocket.MultiSessionList property, Sessions can be created
and the number to initially create be defined. For instance Sessions could be created for
56 / 449
ASTA 3 for Delphi
Sales - Initial # of 3
Human Resource - Initial # of 2
Customer Service - Initial # of 5
When a client logs into a Server, the UserRecord.PooledSessionname must be set. This
will define what Database Session or DataModules that client receives when performing
any database tasks.
You may want to authenticate users from a database table and to that end you will need
a Database connection for each PooledSessionName. the
AstaServerSocket.MultiSessionList has a property named
CreateSessionsForALogin:Boolean. by setting this, when the Session Pool is initially
created an extra Datamodule is created for each named session that is available outside
of the thread pool for use in the OnClientAuthenticate event and elsewhere in non-
threaded operations.
ServerSocket.MultiSessionList.SessionByName('Sales').LoginDatabaseSession which
returns the DataModule created in the ServerSocket.ThreadedDBSupplySession event.
then on the ThreadedDBSupplySession you need to do something for each named session
sent in.
57 / 449
ASTA 3 for Delphi
AdoConnection.Connected := True
end;
except
LogException(ClientSocket, 'Create ADO Connection Error ' +
EDataBaseError(ExceptObject).Message, True);
end;
end;
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
Adonis
Advantage Database Engine
Asta3ADOServer ADO support
Asta3BDEServer BDE support
Asta3DBISAMServer DBISAM support
Asta3DOAServer DOA support
Asta3IBExpressServer IB Express
AstaCTLibServer Native access to Sybase and Adaptive
Server Anywhere
AstaOdacServer
AstaSkywireEmulator
Diamond Access
Direct Oracle Access
Flash Filer Coming soon - www.turbopower.com
Halcyon DBF server – www.grifsolu.com
InterBase Objects
MySQL Using WinZeos components
NativeDB Native SQL Anywhere
NCOCI8 Native freeware Oracle 8i server –
www.ncom.ru/diman/index.html
ODBC98
ODBCExpress
Opus Direct Provides BDE replacement, use the
AstaBDEServer – www.opus.ch
Oracle Direct Access Core Labs (under development)
SQL Direct MS SQL Server, Oracle, Informix, ODBC
SQLQuery TheComponentStore
In some cases, tcp/ip will report that clients are connected to an ASTA server when
indeed, they are not. If a client raises any kind of tcp/ip error, the astaServerSocket will
use a low level winsock API call to verify the connection and if the connection is not valid
58 / 449
ASTA 3 for Delphi
will disconnect the client. Sometimes a client will pass this test even though they are
either having network problems or are not connected to the server. In some cases even
when the server sends some data to that client, tcp/ip raises no error and pushes the
bytes out dutifully to the now phantom client.
ASTA 3 adds some new routines on the AstaServerSocket that will aid in validating
remote clients. This is done by a new property on the TUserRecord of
LastActivity:TdateTime. This records the last time that data was "received" by the
AstaServerSocket not sent.
In order to validated clients, a ping request can be sent from the AstaServerSocket to
remote clients.
procedure TAstaServerSocket.RequestPing(SecondsToAllow:Integer);
If a client has already communciated with the server within the period covered by the
ping request, they will not be asked to ping the server. Example:
it's 9:00AM and RequestPing(180) is called. any Client that sent any data to the server
since 8:57 (3 x 60 = 180 or 3 minutes) will not be asked to send another request.
DisconnectClientsByLastActivity(secondsToAllow:Integer);
which will send a request for each client to send a codedmessage to the server (handled
all internally by ASTA).
If no data is received within the stated period the clients are disconnected.
Created with the Personal Edition of HelpNDoc: Elevate Your Help Documentation with a Help Authoring
Tool
To further extend ASTA servers as the most appropriate vehicle for the ASP Model
(Application Service Provider) ASTA introduces ASTA Middleware Triggers.
59 / 449
ASTA 3 for Delphi
To use AstaTriggers on the client you must register the Tablename.Fieldname that you
want default values to be fired against on the server.
AstaClientSocket1.RegisterTrigger('Customer', 'UserID');
A default value must also be supplied. This can be done from the client application or
within the Login process on the AstaServer. From the Client you would call:
ClientSocketParams.FastAdd('UserID', 1002);
AstaServerSocket1.UserList.GetUserParamList(Sender as
TCustomWinSocket).FastAdd('UserID', 1002);
Note the UserID of 1002 supplied depending on the Client UserName and Password.
The result is that if the Customer row had a userId field that contains the UserID of the
last user that updated the row, a Parameterized Query is generated and the UserID
param is supplied with values that exist on the server based on the
ClientSocket:TCustomWinSocket, not the client.
ASTA 3 servers now have the concept of a ServerAdmin. There is an subproperty of the
AstaServerSocket named ServerAdmin. This allows for the AstaServerAdmin.exe to be
run and connect to an internal AstaserverSocket instatiated and connected solely to be
used for remote administration.
TServerAdmin = class(TPersistent)
published
60 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
ASTA servers, by default come with logging turned on but with an option to turn it off. By
definition, logging is an expensive activity and is not thread safe. Writing to a UI
component (TMemo) is not thread safe and eats a lot of CPU cycles.
If you require more granualar control of the logging process, you can define which events
you want the server to log.
61 / 449
ASTA 3 for Delphi
You can specify that you want to log all items and add items that you don't want to log to
the NoLogItems property, or you can define the actual items you want logged.
Which checks the LoginOn, LogItems and NoLogItems. If the LogEvent is coded you can
further control if an item is passed through to the log. Only if all the tests passed is
RecordServerActivity actually called.
Note: Problems on ASTA servers are often caused by ASTA users writing logging routines
that are not thread safe. Beware of too much logging!
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
The ADO Server allows multiple ADOConnections to be created on the fly so that
AstaClientDatasets can use the Database:string property to access any number of
Databases on the server. Other ASTA servers have been coded to allow for multiple
Datasources including the AstaOdbcServer, AstaDbisamServer and AstaBDEServer. There
is also a multi-datasource ASTA ISQL Demo tutorial that demonstrates this feature.
This ADO Server contains a new menu option of Manager Aliases to allow Alias
information to be defined and saved to file by a TAstaDataSet calling SaveToFile. The
62 / 449
ASTA 3 for Delphi
procedure TForm1.SetupDBMSDataBase;
var
i: Integer;
d: TAstaDataSet;
begin
with AstaDataModule do begin
with DBMSDataSet do begin
if FileExists(AliasDataSetFileName) then begin
D := TAstaDataSet.Create(nil);
try
d.LoadFromFilewithFields(AliasDataSetFileName);
//add the main one you login on or the one you set the
ADOConnection to on the datamodule
AppendRecord([AstaServerSocket1.AstaServerName, 'Main',
ExtractFileName(Application.EXEName)]);
while not d.Eof do begin
AppendRecord([AstaServerSocket1.AstaServerName,
d.FieldByName('Alias').AsString, '',
ExtractFileName(Application.EXEName)]);
d.Next;
end;
finally
d.Free;
end;
end
else AppendRecord([AstaServerSocket1.AstaServerName,
AstaServerSocket1.DataBaseName, '',
ExtractFileName(Application.EXEName)]);
end;
UpdateAstaAlias(DBMSDataSet);
end;
end;
How to have server side database calls react to the Database:string property
coming from the client
AstaClientdataSets will send their Database:string property to ASTA Servers on every
database request. the Server must be able to respond to these requests by using or
creating ADOConnections that are then connected to the ADO Database components
sitting on the server AstaDataModule.
An FDatabaseList is used on the server to store the Alias Names and the AdoConnections
that are created on the server in response to a client request for a particular Database.
This works in all 3 ASTA threading models and will create a list of Aliases with
TAdoConnection components stored in the FDatabaseList.Objects property. When first
adding a TAdoConnection that does not exist there may be a slight
delay as the AdoConnection connects to the server, depending on which database you are
using but after that it will be very fast and efficient.
Note: When you define an Alias, build a Connection string and paste it into the memo
field on the AliasManager setup form. this will be used to connect to the AdoConnection
created on the fly.
63 / 449
ASTA 3 for Delphi
var
spot: Integer;
Ad: TAdoConnection;
begin
Result := ADOConnection;
if Alias = '' then Exit;
//add a line here if you want to skip this test for your default
DataSource
spot := FDatabaseList.Indexof(Alias);
if spot < 0 then begin
if FDataSet.RecordCount = 0 then
FDataSet.LoadFromFilewithFields(FileName);
if not FDataSet.Locate('Alias', Alias, [locaseinsensitive]) then Exit;
if CompareText(AdoConnection.ConnectionString,
FDataSet.FieldByName(AstaAliasconnectionString).AsString) = 0 then Exit;
Ad := TAdoConnection.Create(Self);
Ad.LoginPrompt := False;
Ad.Provider := AdoConnection.Provider;
Ad.IsolationLevel := AdoConnection.IsolationLevel;
Ad.CursorLocation := AdoConnection.CursorLocation;
Ad.ConnectOptions := AdoConnection.ConnectOptions;
Ad.ConnectionString :=
FDataSet.FieldByName(AstaAliasconnectionString).AsString;
FDatabaseList.AddObject(Alias, Ad);
Result := Ad;
Ad.Connected := True;
end
else Result := TComponent(FDataBaseList.Objects[spot]);
end;
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
ASTA servers come coded with a logging memo so that server activity is easy to view
during the design phase of your ASTA application. There is a tremendous performance
cost to writing to any visual control in addition to the fact that Delphi Visual Components
are not thread safe. ASTA 2.5 server socket's have a new property of LogOn (type
Boolean) that turns on and off writing to the logging memo found on ASTA servers.
The ASTA server socket has an event called OnShowServerMessage which is typically
coded like this:
The AstaServerSocket has a method used internally by ASTA to show threading activity
and other internal ASTA server activities for debugging and demonstration purposes, to
prove the servers really do thread <g>. RecordServerActivity will call the
OnShowServerMessage.
The LogOn property just unassigns the OnShowServerMessage event. No event, no log.
64 / 449
ASTA 3 for Delphi
no cpu degradation. Writing to the log is very, very costly in terms of cpu usage so we
recommend that servers have no visual interface.
What ASTA needs to do is to supply a ClientAdmin ASTA app to show server activity. In
developing theASTA Anchor Server which does load balancing and fail over, ASTA added
amessaging layer that can return ASTA server information .
Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation
ASTA was designed to allow any Delphi database component to be used on ASTA servers
and be threaded by ASTA internally to support ASTA's 3 threading models (singlesession,
persistentsession and pooled).
To support the above 6 items, ASTA Servers need to know which components to use for
which operation. To that end the ThreadedDBSupplyQuery is called.
So in your case you are using TAstaProviders on the server to generate SQL on the server
from remote AstaClientDataSets.
When you are using an AstaClientDataSet with NO SQL and you want to be able to make
it editable and post changes on the server using a provider, you set the
SQLGenerateLocation property of the AstaClientDataSet to gsServer. This sets EditMode
to Cached and allows you to then call ApplyUpdates(usmServerTransaction) to post any
inserts, updates and deletes on the server.
When you call ApplyUpdates, the AstaClientDataSet sends two datasets to the server. The
OriginalValues (nothing for inserts) and CurrentValues(nothing for deletes).
The TAstaProvider then looks to (or creates if none exists) a TAstaSQLGenerator to get
any SQLDialect settings (for instace MS SQL Server needs booleans to be posted as
integers).
65 / 449
ASTA 3 for Delphi
7. At the end of the transaction ASTA calls the OnTransactionEnd passing the TDatabase
again, and either commits or rolls back the transaction according to what has
happened on the executes.
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
ASTA Servers were designed to be able to support any kind of Database component that
can be used with Delphi. Currently ASTA supports over 30 Delphi Database Components
on ASTA Servers. One of the design goals of ASTA was to handle the threading issues
internally so that the Application developer would never have to worry about such low
level details.
SQL Selects
Parameterized Queries
Metadata Requests
Fetch Blob Requests
Transactions
Stored Procedures
To thread ASTA servers there are some additional events that must be coded.
SupplyDatabaseWorkerComponents
SupplyDatabaseSessions
ASTA Servers are threaded internally by ASTA so there is never a need for you to code
any threading. If you code the required events your ASTA server will be able to run in all
4 ASTA threading models.
The following command line switches are available for the AstaBDEServer and
AstaODBCServer. See also AstaServerSocket.CommandLinePortCheck.
Note: The new ASTA 3 Server format deprecates old command line switches used in ASTA
2.6 as in ASTA 3 server options are stored in the registry.
66 / 449
ASTA 3 for Delphi
Examples
AstaBDEServer.exe Port=9012
AstaBDEServer.exe Port=8080
AstaODBCServer.exe Port=1111 Compression
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
To insure that ASTA servers thread properly, ASTA server side components must be
deployed on a DataModule on the server. This allows for ASTA to create copies of the
DataModule so that each user can have their own unique copy of it for database work
within a thread. This includes any Delphi 3rd party database components that you are
using and Asta components with the exception of TAstaServerSocket and
TAstaSQLGenerator which should be kept on the mainform of the application as only one
instance of each of these components are required for the server.
Since ASTA servers can use any number of data modules, in order to support the proper
threading of ASTA servers typically there will be ONE TDatabase (using BDE terminology)
like component per data module and additional data modules will need to be initialized
with their TDataSets set to this TDatabase. Use the OnAddDataModule event to perform
this initialization.
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
Asta servers have been designed to support Asta client applications with no changes.
Everything that you can do with a normal 2-tier fat client database application, ASTA
servers can provide to ASTA client applications. There is much to be said in developing
and deploying a generic ASTA server that can serve diverse client applications. Writing
client side SQL select statements, calling stored procedures from ASTA clients, and using
ASTA to generate SQL on update, insert, allow ASTA developers to quickly and easily
deploy thin client 3 tier applications. However there may be times when you want to
customize an ASTA server or to NOT use SQL in an ASTA client.
ASTA provides tools to allow you to easily create and maintain ASTA servers that will
allow you to deploy ASTA client applications that require NO SQL using TAstaProviders,
Server DataSets or the TAstaBusinessObjectManager.
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
67 / 449
ASTA 3 for Delphi
In order to handle a large amount of concurrent users, ASTA servers can multi-thread
their database sessions. The AstaServerSocket is non-blocking and event driven so that
client requests can always be handled. Performance issues are normally related to
bandwidth considerations and a properly designed client application is critical if you want
your ASTA server to respond promptly to requests.
In order to multi-thread any database application, each user must have their own
connection or session to the database, and their own copy of the component that is to be
used in conjunction with this session, usually a query or stored procedure component.
Using the BDE, each client needs a TSession and their own TQueries. Using ODBC, each
client would need their own handle to a database (THdbc) and their own query
component (TOEDataSet using ODBCExpress).
ASTA servers can run in one of 4 different threading models: Singled Threaded, Persistent
Sessions, Pooled, and Smart Threading.
It is recommended that you use ASTA SmartThreading on all ASTA 3 servers as this gives
you the best of both worlds: the ability to scale the server with pooled sessions and also
to have the ability to have any single user have their own specific Database Connection
via a PersistentSession, and even to switch in and out of this mode.
For small numbers of users the Single Threaded model is the most efficient mode to run
an ASTA Server. The most scalable is the Pooled Threading Model. If you want to be able
to keep an open cursor on an ASTA server and be able to use packetized queries on ASTA
clients, or use database user name and password, use the Persistent Threading Model.
ASTA servers can also maintain client database state while the client is connected to the
server. This model will not scale as well, but there may be certain occasions where you
would want a client to keep a persistent database connection. For example, you might
want a client to use a real database name and password to keep their database security
level applicable to them or when you want to open a server side cursor and fetch partial
rows from the server. See Coding ASTA Servers for steps to create an ASTA server.
1. Set the ThreadingModel property. If tmPooledSessions is chosen, then you must set
the DataBaseSessions property to the number of sessions to be created at server
startup.
When an ASTA server starts up, the method CreateSessionsForDbThreads is called. If the
DataBaseSessions property is greater than 0, and the ThreadedDBSupplySession event
and the ThreadedDBSupplyQuery event is coded, then an AstaSessionList can be created
that will act as a pool of connections to the database. If you choose to thread the server,
these two events must be coded. Use the function UseThreads to verify at runtime which
threading model is in effect.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
68 / 449
ASTA 3 for Delphi
One of ASTA's design goals was to shield the developer from any Threading issues and to
allow ASTA to handle all threading internally. There are some general thread habits you
need to follow which mostly apply to the VCL GUI controls not being thread safe and the
use of Global Variables.
To write thread-safe code (as in the case of file I/O, make sure in each instance of the
thread, you will not be writing to the same file), and also this means that the threaded
procedure should not access directly the global variables (which will have no guarantee of
maintaining its value in each thread) and the properties of objects in the user interface.
Doing so would cause Access Violation Errors. You will find that by using global variables
and setting the properties of the User Interface Visual Objects, unfamiliar access violation
errors occur, and yet your code compiles perfectly. However, you can still use those
global variables, and read the values of the properties of VCL objects by passing it
through the TAstaParamList parameter and then decoding it within the threaded
procedure.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with a Help
Authoring Tool
In order to fully support JDBC clients, as well as customer requests, ASTA 2.5 will contain
new features to the PersistentSessions threading model.
When running an ASTA server in PersistentSessions, each remote client will have their
own database components (data module) so that the database user name and password
can optionally be used. When database work is required in this threading model, each
database activity is done in a thread with each client having their own database
connection. (This is NOT the most scalable threading model. To scale an ASTA server,
Pooled Sessions Threading is encouraged. )
ASTA servers can be started in this mode by putting PersistentSessions on the command
line. When running in the Persistent Sessions threading model the following features are
now supported:
1. Packet Queries:
With SQLOptions.soPackets set to True and RowsToReturn > 0, an SQL query will execute
on the server but only RowsToReturn rows will be returned to the client.
WithAutoFetchPackets set to True, any visual control that attempts to scroll or access EOF
will force the AstaClientDataSet to call GetNextPacket which will launch a new thread on
the server using the initial dataset opened on the server by the SQL statement. With
AutoFetchPackets set to False you must explicitly call GetNextPacket.
2. Packet Locates
function GetNextPacketLocate(const KeyFields: string;
const KeyValues: Variant; Options: TLocateOptions): Integer;
GetNextPacketLocate works like the TDataSet.Locate but it will use the query created
from step #1. Depending on your database on the server, this can be a very fast
operation. Using a file server database like DBISAM, locates will use indexes if the SQL
does not include a join. The GetNextPacketLocate will call a TDataSet.Locate on the server
and return RowsToReturn rows, and place the server side cursor on the position where the
locate has positioned it. This can result in very fast fetches on large tables. Your mileage
will vary depending on how the database component used on the server handles this.
69 / 449
ASTA 3 for Delphi
3. StartTransaction:
Normally in the n-tier model, round trips to the server should be minimized and activities
and transactions should be started and ended on the server in one action. Using
ApplyUpdates, ASTAClientDataSets send SQL to the server, start a transaction, execute
any SQL from the client and then commit or rollback the transaction as necessary. When
running Persistent Sessions you can now explicitly start a transaction with the
AstaClientSocket.
procedure StartTransaction;
The following code shows how these can be used. The idea is that any number of
parameterized queries can be created and then sent to the server in one call.
Prior to ASTA 3 there were 3 threading models Single, Persistent and Pooled. ASTA 3
introduces tmSmartThreading. This allows Pooled and PersistentSessions to be mixed and
is the default threading model for all ASTA 3 servers.
70 / 449
ASTA 3 for Delphi
By default remote users will share a database connection from the ASTA Database session
pool. To allow for any user to get their own unique database connection, there is a new
event defined on the AstaServerSocket:
Below is an example of the Asta3ADOServer. In this case, if a user has the name of
'PersistentSessions' then a datamodule will be created for that user.
Additionally, remote users can move from Pooled to Persistent Sessions. Below is some
code from the Asta 3 SmartThreading tutorial that shows how to change a user from
Pooled to persisent Sessions. There is an Extra ParamList available that will be transferred
to the server side TUserRecord.ParamList. This would allow you to add logic so that the
correct Database connection could be created for a specific client.
71 / 449
ASTA 3 for Delphi
Value Meaning
tmSingleSession This is the default model and should be the fastest
for small numbers of users or larger numbers of
users that don't have excessive concurrent
activity.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
UseRegistry
The AstaBDEServer and AstaODBCServer will both respond to the UseRegistry command
line switch that allows you to pull login information from the registry instead of entering
it directly. On the login dialog, if you click on the Use Registry check box, the alias (or
datasource), username and password will be saved in the registry. You can then
subsequently run the server with the command line switch UseRegistry to start up the
72 / 449
ASTA 3 for Delphi
1. Start up an ASTA server, and then choose an alias and type in your user name and
password. Make sure to click on the UseRegistry check box.
2. Run it once.
3. Next time you run the server put UseRegistry on the command line and it will use the
alias, user name and password from the registry.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
ASTA Messaging
ASTA was designed to be used by Delphi database application developers using skill sets
they already possess. ASTA uses TCP/IP for it's transport and contains an easy to use
messaging system. ASTA ParamList Messaging provides an extremely flexible and
powerful communications framework.
ASTA uses non-blocking event driven sockets as it's underlying transport. These sockets
are by their nature asyncronous. This means that a message sent by one method does
not wait for any response from a server and if a response does come it will fire an event.
So if you send something here, when you get a response it will be over there. ASTA was
designed that you would not have to deal with foolishness such as this. Both the
AstaServerSocket and AstaClientSocket have easy to use messaging calls. You can send a
string or a stream with SendCodedMessage or SendCodedStream.
Then on the server you would just code the AstaServerSocket. OnCodedMessage like this:
When we built ASTA there were times of course that we wanted to send other kinds of
data than strings and streams so we created the TAstaParamList. The TAstaParamList is
just like a TParamList that you are familiar with on the TQuery component but it is fully
streamable. It also can contain datasets, any kind of binaries and even other ParamLists.
So once we created the TAstaParamList and the call procedure
SendCodedParamList(Msgid: Integer; Params: TAstaParamList) we pretty much could
transport anything back and forth between servers and clients (and client to client also
btw) easily.
But, you say, in the above examples we send in one place and receive in anevent and you
told us that you saved us from that. AstaClientsockets have a call of
SendGetCodedParamList which sends a TAstaParamList and also waits until the server
sends back a response. This allows you to write procedural code rather than event driven
73 / 449
ASTA 3 for Delphi
code.
var
P1, P2: TAstaParamlist;
begin
P1 := TAstaParamList.Create;
try
P1.FastAdd('Hello World');
P1.FastAdd(Now);
P1.FastAdd(4.333);
P2 := AstaClientsocket1.SendGetcodedParamList(1010, P1);
//Do something with the P2 ParamList that is returned
//from the function result
finally
P1.Free;
P2.Free;
end;
end;
ASTA users have thought of all kinds of ways to use ASTA messaging from taking fairly
static queries and executing and compressing them on ASTA servers to be sent out using
ASTA messaging, to controlling remote servers, to getting back performance information
form servers, to sending faxes. Once you have a middle tier, there is a complete world
that opens up of new possibilities.
Asta provides a solid and easy to use messaging system to facilitate communication
between the server and client. Messages consist of an Integer and either a String, a
Stream or an AstaParamList (which can contain any datatypes including DataSets). Both
TAstaServerSockets and TastaClientSockets have the following message routines. The
TAstaClientSocket sends to the implicit ServerSocket while the TAstaServerSocket must
identify which client it is sending to.
AstaClientSocket
procedure SendCodedMessage(MsgID: Integer; Msg: string);
procedure SendCodedStream(MsgID: Integer; MS: TMemoryStream);
procedure SendCodedParamList(MsgId: Integer; Params: TAstaParamList);
function SendGetCodedParamList(Msgid: Integer; Params: TAstaParamList);
AstaServerSocket
procedure SendCodedMessage(ClientSocket: TCustomWinSocket; MsgID: Integer;
Msg: string);
procedure SendCodedParamList(ClientSocket: TCustomWinSocket; MsgID:
Integer; Params:TAstaParamList);
procedure SendCodedStream(ClientSocket: TCustomWinSocket; MsgID: Integer;
MS: TMemoryStream);
There are also three events defined on both the TAstaClientSocket and TAstaServerSocket
to allow for messages to be received.
property OnCodedMessage: TAstaClientCodedDataEvent;
property OnCodedStream: TCodedStreamEvent;
property OnCodedParamList: TCodedParamEvent;
74 / 449
ASTA 3 for Delphi
SendCodedMessage allows you to send a message to the server, and then make a custom
response back to the client. The SendCodedMessage method allows you to roll your own
protocol where certain MsgIDs have specific meaning to your application. The ability to
create your own protocol in this fashion is a simple yet powerful technique. See the
Simple Business Objects Example below.
The simple code below sends a message to the server, but the message is sent with two
different MsgIDs. The server will handle the message differently depending on which of
the MsgIDs, 1700 or 1750, accompanies the message.
The server responds by loading a memo into a stream and sending it to the client.
procedure
TForm1.AstaServerSocket1CodedMessage(Sender: TObject;
MsgID: Integer; Msg: string);
var
MS : TMemoryStream;
begin
case MsgID of
2000: begin
MS := TMemoryStream.Create;
mSelectSend.Lines.SaveToStream(MS);
AstaServerSocket1.SendCodedStream(2000, MS);
MS.Free;
end;
end;
end;
75 / 449
ASTA 3 for Delphi
The client receives the stream and displays it in a memo and saves it to a file.
procedure TForm1.AstaClientSocket1CodedStream(Sender: TObject;
MsgID: Integer; MS: TMemoryStream);
begin
case MsgID of
2000: begin
mFileFromServer.Lines.Clear;
mFileFromServer.Lines.LoadFromStream(MS);
mFileFromServer.Lines.SaveToFile('ATGTestFile.Txt');
end;
end;
end;
The TAstaParamList allows any number and any kind of data to be transported easily and
efficiently. See the CodedParamList Tutorial for an example of using an AstaParamList to
send a TextFile from a client to the server. Not only does it send the file, but the name of
the file and the time it was sent. The same tutorial contains an example of sending a zip
file from the client to the server, demonstrating how AstaParamLists can be used to
transport binary files.
Chat Messaging
Procedure SendChatPopup(S: String) will broadcast a message from the sending client to
all the other clients connected to the same server. This message is intrusive and it will
stop the other clients from working while the message is displayed in a modal dialog that
halts the other clients' progress. See SendChatEvent for an alternative.
The following code reads the input from a Memo named mChatMessage and broadcasts it
to all the clients (including the sending client) in a popup dialog box.
Procedure SendChatEvent(S: String) broadcasts a message from the sending client to all
other clients connected to the same server, but it is not intrusive.like SendChatPopup.
This message must be intercepted and handled in the OnChatMessage event handler. If
you do not assign the event handler, then the message will NOT be displayed.
This code broadcasts a message from the client to all the other clients.
76 / 449
ASTA 3 for Delphi
end;
1850: begin
AstaServerSocket1.SendCodedMessage(MsgID,
MyBusinessObject.NewCreditLimit(Msg));
end;
end;
end;
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
ParamList Messaging
ASTA has a flexible and easy to use Messaging Layer. AstaParamLists can contain any
kind of Data including other ParamLists and DataSets. There are tutorials available to
show how to pack up ParamLists containing other paramlists and DataSets.
ASTA of course has a DataBase layer but there are a surprising number of ASTA
applications deployed that only use ASTA messaging. As a Database Application
Developer, you world will change forever once you learn the power of ASTA ParamList
messaging. Messages can be send between client and server and also directly to other
clients either through the server or by creating an TAstaServerSocket on remote clients
and allowing for Peer to Peer Access (P2P).
ASTA supports not only users connected to a server or connected to each other via P2P
but disconected messaging with the Asta MessageQueue which allows for messages to be
send to users are are not connected to a server. Messages are stored on the server and
when users connect the messages are picked up.
ASTA ParamLists are supported cross with libraries written in C++ and java for support of
Palm, Wince, GCC Linux, Java and AstaCOmClient.dll for Win32 and WinCE. See the
SkyWire help for more information on non-vcl implementations of AstaParamLists and the
TDataSet like data structure called a DataList.
AstaClientSocket
The AstaClientSocket has calls to SendCodedParamLists to server and to optionally wait
for a response. You must decide if you require your client to block or wait for any
response from a server or, to code using async calls that allows for server side processes
to be "initited" by a messaging call and when completed to return to the client. Note:
Asta Server Methods support async calls with the DelayAction:Boolean option on the
TAstaBusinessObjectsManager.
ASTA sockets are async event driven sockets (jump to async link) and by nature do not
block. We have added blocking calls to allow you to write procedural code. So it's up to
you to decide which calls to use.
Non-Blocking Calls
77 / 449
ASTA 3 for Delphi
SendCodedParamList is a non-blocking call and the building block for all ASTA
messaging. You create a TAstaParamList, fill it with data and send it to the server with a
Msgid:Integer. On the server, the ParamList will be received in the OnCodedParamList
call of the AstaServeSocket.SendGetCodedParamList will not block or wait so after the
server processes the call:
SendCodedParamList - non blocking
SendNamedUserCodedParamList - requires used to login with unique usernames. Then
you can send a named message to 'shaq.lakers' or 'jason.nets' on the server. This is
used extensively in the Asta Instant Messaging API.
Blocking Calls
These calls block or "wait":
SendGetCodedParamList
SendGetCodedDBParamList
GetCodedParamList
event OnCodedParamList
This event is fired when a the server calls SendCodedParamList or
ClientBroadcastParams on the server.
AstaServerSocket
Methods
SendCodedParamList - This is the base call to send ParamLists to ASTA clients. If the
client is a skywire client, (palm,wince,java) any translations are done internally so the
client can receive the paramlist.
ClientBroadcastParams - this allows for paramlists to be send to all users connected to
the server.
Events
Asta uses non-blocking async sockets so that ASTA servers don't require threads for
messaging calls. ASTA implemented the autoupdate feature using ParamList messaging
so that when the SendGetCodedParamList call is made from an ASTA client, the return
of any data is threaded. This applies only to the return of data.
78 / 449
ASTA 3 for Delphi
PdaServerPlugin
See the SkyWire documentation on how to handle SkyWire (non-vcl) ParamList
messaging on servers.
The table below recaps all the ASTA ParamList messaging calls.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
ASTA supports sending and receiving any kind of data including files using ASTA
messaging. There are examples and tutorials that use SendCodedStream or
SendCodedParamList. This is all easy and straightforward but there are times when you
want to send very large files or lots of files. If that is the case, then you can use some of
79 / 449
ASTA 3 for Delphi
the ASTA FileSegment Send routines that allow you to configure the size or block sizes of
data sent over the wire.
AstaParamlist messaging is very flexible and should be used whenever possible. When
calling SendGetCodedParamlist from AstaClients, any sends will be sent in a background
thread. But sometimes, if you are sending very large files (10mb) you may want control
on how much processing time you want the server to commit to sending and receiving
files.
In order to support this, ASTA has routines to send files from the server to the client or
from the client to the server in configurable "chunks".
1. FileSend- This shows how to use normal ASTA messaging to send files between client
and server.
2. File Transfer : ServerToClient - This shows how to request files from a remote server
and send them in a thread in configurable "chunks"
3. File transfer : Client To Server - this shows how to send a file or groups of files using
masks to a remote server.
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
ASTA clients typically connect to an ASTA server using an IP address and port number.
ASTA servers scale quite well but there may be times when you want to have fail over
abilities with multiple servers, or just have too many clients to be handled by one server.
The ASTA Anchor Server provides load balancing and fail over abilities. Instead of clients
connecting directly to a remote ASTA server they connect to the AnchorServer which then
finds the next available ASTA server and sends back to the client the IP address of that
server. The client disconnects from the Anchor Server and connects to the ASTA server
designated by the Anchor Server.
The Anchor Server can be configured to connect to any number of ASTA servers. When
the Anchor Server starts up it will attempt to connect to all the ASTA servers and will
display the current status of each server. When the Anchor Server starts, it can show the
connected number of users for each ASTA server.
If an ASTA Server goes down, all the remote users from that server will be disconnected
and will then connect back to the Anchor Server which will hand them off to other ASTA
servers. This is the concept meant by fail over. One of the advantages of the N Tier
architecture is that once you design your ASTA client application it can scale simply by
adding more ASTA servers to be used with the ASTA Anchor Server.
The AstaAnchor server makes use of the Asta Adminstrative Remote API to retrieve
information from remote ASTA Servers. Since the ASTA Anchor Server requires multiple
ASTA servers it is not part of the ASTA Entry suite but is part of the ASTA Power Pack and
higher licenses.
80 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
Created with the Personal Edition of HelpNDoc: Maximize Your Reach: Convert Your Word Document to
an ePub or Kindle eBook
ASTA proxy server can be requested by any ASTA server and can be run on a client
firewall to allow Client applications to have their ports redirected by the Proxy. It is
available on request by registered ASTA users.
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
AstaServerLauncher
81 / 449
ASTA 3 for Delphi
AstaSeverLauncherNTSÞ¸Ë|ô|
This does not have a user interface, it is run as a service and reads the registry to tell
which programs to start. Use the AstaServerLauncher to setup the Registry configuration.
To install it as a service, run the program with the command line parameter of /Install
(you can create a shortcut to use for this by editing the shortcut's Target property and
adding /Install to it, /Uninstall does the reverse). Then in control panel, open up
Services. Look for AstaServerLaunherNTS. Double click it. Set it to Manual or Automatic
start. Click on Allow Service to Interact with Desktop so that it is checked. (You can also
set it to run in its own session by selecting a particular account with This Account radio
button). Press OK.
You can start the service manually. Once started it will read the registry and start up any
programs that need AutoStarted. It will then keep these programs alive if they are set to
AutoReStart.
Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents
AstaSQLExplorer
The ASTASQLExplorer is an ASTA client application available with full source that can
show ASTA server side information including metadata, ASTA Providers and ASTA
ServerMethods.
1. SQL
Enter a free format sql query. Certain TDataset descendants allow you to do non-select
queries. Execute the query. Once you have executed the query, you must specify/set the
primary keys and an update table. To do this, click on the "Set Primary Keys" button or
select the menu item. A dialog box will be displayed that will list the tables of the query
in a combobox. Select the Update Table. If the table that you select contains any primary
keys, as returned by the Asta server (not all Asta servers return primary key
information), the primary key fields will be checked. You can change the fields to be used
as the primary keys for edits, by checking the fields. Select OK. If you have selected any
primary keys for the Update table, The dbnavigator will now display more buttons. You
can now do edits on the result set.
2. Data
Data is a quick way to view data in a table. Select the table in the explorer tree and then
select the Data tab. Unlike the SQL tab where you can specify the primary keys, ALL the
fields will be used as the primary keys.
3. Params
Use this tab to display input/output parameters for a selected Business object or
Provider. Select the Business object or Provider and then click on the "Retrieve
parameters" button. If there are any parameters, they will be displayed in the scrollbox.
Fill in the parameter values and Execute.
4. SQL Errors
All SQl errors returned from the server will be displayed on this tab.
5. History
After every query (SQL tab), the sql statement will be appended to the history dataset.
82 / 449
ASTA 3 for Delphi
Select the record to display the sql statement in th ememo field, or double click to open
the query in the SQL tab. To clear existing history, delete the file AstaSQLExplorer.dat in
the directory of AstaSQLExplorer.Exe
The Explorer treeview has a popup menu that will be enabled when you select a System
Table, Table or View. Extract SELECT statement - Extracts a SELECT field1, field2... FROM
table for the selected table. Extract SELECT and Run - Extracts a SELECT field1, field2...
FROM table for the selected table AND execute the query. Not all Asta servers return
mdVCLField information, so these two menu options might not return any sql statement.
In this case you can change the code return just a SELECT * FROM table statement.
Note that not all servers return all the MetaData information, so not all the treeview
nodes might return any data.
Some of the Astaservers return different field names for metadata. For this reason an
option is added in which you can "map" the field names to be used by the explorer
components. Tools|Options|Field Names. These will default to the Asta BDE server's field
names.
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
ASTA provides you with the ability to automatically update AstaClients. Clients must be
enabled to Login to the server and for the AutoClient Update process to be activated.
When you deploy your original ASTA Clients, fill in the AstaClientSocket.ApplicationName
and ApplicationVersion properties. When you wish to deploy a new client, increment the
ApplicationVersion (if your first distribution is 1.0, then you next release might be 1.1 or
2.0). After you have produced the new client executable (with the incremented
ApplicationVersion), you can register that executable at the AstaServer. When a user of
version 1.0 logs into the server, he or she will be updated automatically to the latest
version of your software.
There are two events on the AstaServerSocket that fire when a client comes in for an
update check:
OnAstaClientUpdate
OnAstaClientUpdateDecide
Update information can be maintained remotely using the Asta Remote Adminstrative
API.
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
Information about Client exes that have been registered on AstaServers for version
updates can now be obtained from remote clients using the new RequestUtilityInfo call
from the AstaClientSocket. This API was first developed to support the ASTA Anchor
Server which does load balancing and fail over.
This is an asyncronous request that will bring back a TAstaDataSet that contains
information about current Client Exe's that have been registered on an ASTA Server for
83 / 449
ASTA 3 for Delphi
These Datasets are stored in the TAstaParamList as Strings and they can be converted to
Datasets using StringToDataSet (from astadrv2.pas) but you are then responsible for
freeing the Dastaset.
84 / 449
ASTA 3 for Delphi
end;
Firewalls are a fact of life at many companies. Firewalls block access in a number of
ways: by blocking ports, by filtering what kind of data can go through some port
numbers, by blocking all data except through a "proxy", etc. ASTA 2.6 has a number of
techniques that you can use in your ASTA client application to work through a firewall,
including the addition of WinINet support. Another feature of ASTA 2.6 is that ASTA
servers can now serve TCP/IP and stateless http remote clients with no changes on the
server.
ASTA Servers require a static IP Address and a "port" to run on. There are 65535 ports
available on any machine with port numbers lower than 1024 generally reserved for the
operating system. HTTP Servers typically run on port 80, ftp runs on port 23 and SMTP
(mail) servers run on port 21. You can run as many as ASTA servers as your hardware
allows, on any one machine, as long as each one runs on a different port. Figure 1 shows
a typical ASTA server connected to a database, usually over an Ethernet network, with
remote clients connected to it via TCP/IP. The only requirement for the remote clients is
that they can connect to the ASTA server IP Address and port.
The IP Address can be specified either numerically (1.2.3.4) or as a hostname
(somecomputer.companyname.com).
85 / 449
ASTA 3 for Delphi
Figure 1
ASTA provides numerous ways to defeat firewalls. They can be grouped between those
that maintain state and use TCP/IP and those that are stateless and use http.
Stateless Techniques
Set the AstaClientSocket.WinINet property to true along with ISAPI DLL on a Web
Server
Use the AstaClientSocket ability to format messages as http through an ISAPI DLL
on Web Server
Use ASTA Proxy Server support
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
86 / 449
ASTA 3 for Delphi
Most firewall issues are port restrictions. ASTA clients can connect seamlessly through a
firewall if the administrator agrees to open up the port that the ASTA server is running
on. For example, if the ASTA server is configured to use port 9000 and administrator
opens up the port on the client firewall to allow TCP/IP traffic on port 9000, the firewall
issue is resolved.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
Sometimes the firewall administrator will not open a port up. The next solution is to run
your ASTA server on port 80 or port 8080, as firewalls must have port 80 open if clients
are allowed to use browsers to access the Internet and remote HTTP servers. They must
allow unfiltered TCP/IP traffic on port 80/etc. for this solution to work. Figure 2 shows a
network where there is a firewall but only port 80 is opened.
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad
Running ASTA clients stateless doesn't allow you to use such features as Server
broadcasts or client-to-client messaging along with provider broadcasts. SOCKS is a
technology available to provide Authenticated Firewall Traversal. If you have a SOCKS4 or
SOCKS5 Server, ASTA can allow you to connect via the SOCKS server and use TCP/IP as a
normal client application. The AstaClientSocket has a method to set it up to connect
through a SOCKS5 Server.
Figure 3 shows the SOCKS Setup form that allows client applications to configure their
SOCKS server settings.
87 / 449
ASTA 3 for Delphi
Figure 3
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
ASTA also provides an ASTA Proxy Server that can be run on the same machine as the
firewall that allows ASTA clients to connect to the AstaProxyServer and be re-routed to a
remote ASTA server.
Figure 4
Created with the Personal Edition of HelpNDoc: Maximize Your CHM Help File Capabilities with HelpNDoc
The Microsoft WinInet DLL comes with Internet Explorer and provides client access to
HTTP support including SSL, SOCKS and access through Proxy Servers. ASTA 2.6 allows
the AstaClientSocket to use WinINet and the AstaHttp.dll to get through any Firewall that
Internet Explorer can use the same registry settings for proxy servers and authentication
as set by Internet Explorer. To activate WinINet support just set the public
88 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
In this scenario a Web Server like IIS (Internet Information Server) receives requests
from remote ASTA clients through an ISAPI dll (AstaHttp.dll) and proxies the request to
an ASTA server that can be located anywhere. ASTA supplies an ISAPI dll that can be
placed in the scripts directory or equivalent of the Web Server and remote clients are
configured to format their messages as HTTP messages by calling SetupforIsapiUse.
procedure TAstaClientSocket.SetForIsapiUse(WebServerAddress,
AstaServerAddress, AstaIsapiDll: string; WebServerPort, AstaServerPort:
Word);
Clients can call AstaIsapiSetup to input the address and port information for the remote
Web Server and ASTA server as well as the location of AstaHttp.dll Figure 4 shows the
setup form that appears when the AstaClientSocket. AstaIsapiSetup routine is called. A
Kylix built Apache DSO that does the same on Linux will be available in September 2001.
ASTA Palm and WinCE clients will also be able to take advantage of this technique. For
more information see www.astawireless.com.
Figure 5
Figure 5 shows how ASTA clients can be configured to appear as normal browsers with
HTTP formatted messages and running through an existing HTTP Server like IIS using the
ASTAHTTP.DLL
Figure 6
89 / 449
ASTA 3 for Delphi
This is of course another stateless solution since the client is using real HTTP and
communicating through IIS just like a normal browser. Use this technique if your clients
don't have WinInet.dll available.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
Sometimes there may be a proxy server like Netscape Proxy Server running on your client
application. In this case your ASTA client application must connect to the proxy server
rather than the ASTA server. ASTA supports this with the AstaClientSocket Method
SetForProxyUse.
Note: WinINet is still recommended before this technique. Use this only if WinINet.DLL is
not available on your client machines.
Figure 7 shows an ASTA proxy setup form that allows your ASTA client application to be
configured to connect through a Proxy Server like Netscape Proxy Server.
Note: this call is not required if you use the ASTA WinINet support as WinINet will use
the proxy settings as set by Internet Explorer.
Figure 7
Figure 8
90 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
Stateless Authentication
Normal TCP/IP ASTA clients can support "server push", authentication, and ASTA
messaging. When running stateless HTTP the landscape changes a bit. ASTA does provide
features to allow stateless HTTP clients to use features that ASTA users have been
accustomed to.
The ASTA Stateless Authentication tutorial has an example server and client to show how
authentication can be done with ASTA and stateless clients.
Asta stateless support via HTTP requires a web server to run like Microsoft IIS (internet
Information Server). Another good choice for testing is the Omini Web Server available
from www.omnicron.ca.
Server Side
The AstaServerSocket has an AddCookie property which is of type
TAstaServerCookieOption.
In order to tunnel via HTTP, ASTA binary messages are wrapped using the
HTTP format so that they can be disguised as normal browser traffic in order to traverse
any client firewall. When cookies are used, additional authentication information is
included in the ASTA messaging format.
Value Meaning
coNoCookie No cookie information
91 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
ASTA clients can have their messages formatted as HTTP if the client firewall will only
allow HTTP traffic on port 80 and the remote ASTA server is running on the same machine
as IIS or another web server. ASTA supports HTTP tunneling running stateless through an
isapi dll sitting on the server that will pass all ASTA client/server messages through the
web server to the ASTA server, and back to the client
Stateless tunneling is performed through an HTTP server using the isapi dll -
ASTAHTTP.DLL. ASTA supplies an isapi DLL called AstaHttp.dll which you put intp your IIS
scripts directory or
whatever directory your web server expects to find isapi dll's.
To set the server, up you must set the ASTAProtocol to AstaIsapi or use the isapi
command line switch: AstaBDEServer.exe isapi
Example
The ASTA client application will then create actual HTTP messages and connect to your
remote web server which will pass any messages through to your ASTA server via the
ASTAHTTP.DLL and stream results back as normal HTTP messages to the client
application.
92 / 449
ASTA 3 for Delphi
See Also:
Firewalls
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
Setting Up IIS
Microsoft has recently added Lockdown tools to IIS that use the MS Security tool
URLScan.
URLScan must be configured to allow for AstaHttp.dll to be able to run. Below are some
comments from an ASTA User who made changes to URLScan.ini to allow for AstaHttp.dll
to run under IIS.
The problem came from "URLScan", which blocks all requests containing "." considering
that in /scripts/AstaHttp.dll/Asta, the dot is not an extension event if ".dll" is allowed. So
users using IIS and URLScan have to modify the default configuration of URLScan, by
allowing the dot, and the ".dll" in the request.
[options]
UseAllowExtensions=0 ; if 1, use [AllowExtensions] section, else use
[DenyExtensions] section
AllowDotInPath=1 ; if 1, allow dots that are not file
extension
Don't try to set UseAllowExtensions to 1, to deny all extensions except those allowed (I
think that it is better to secure a server, but Microsoft disagrees), because in this case
you'll deny requests without extensions! www.beaconseil.com will be rejected, because
there's an extension in this
request. www.beaconseil.com/index.html will be allowed!
Salutations,
Olivier MERLE
Bea Conseil
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
93 / 449
ASTA 3 for Delphi
Provider Broadcasts
When coding applications like auctions, sometimes it is necessary to have ASTA servers
"push" out information with it being directly requested from ASTA clients. TAstaProviders
provide a way to do just this with little or no code.
TAstaProviders can be used to allow remote ASTA clients to be notified of any changes to
any table. When using a TAstaClientDataSet, instead of using SQL, choose a Provider by
pulling down the ProviderName property. Then click on the ProviderBroadcast property
and set the RegisterForBroadcast property to True. If you want the AstaClientDataSet to
be editable set the SQLGenerateLocation to gsServer.
When the TAstaClientDataSet is opened, it will fetch any results from the TDataSet
attached to the provider on the server and also internally call RegisterProviderForUpdates
which registers that TDataSet to receive notification when any other TAstaClientDataSet
makes any changes to that TDataSet attached to the TAstaProvider on the server.
Any changes will be broadcast from the server side TAstaProvider and recieved in the
TAstaClientDataSet.OnProviderBroadCast event. If you want the AstaClientDataset to
automatically post any updates , deletes or inserts, so the
TAstaClientDataSet.ProviderBroadcastOptions AutoUpdate and RetrievePrimekeyFields to
True. to true andProviders can limit broadcast to specific row criteria by coding the
AstaProvider.OnBroadCastDecideEvent. Providers can be networked to allow them to
broadcast to all connected clients using the same TAstaProvider.UpdateTableName by
calling TAstaServerSocket.NetWorkProviderBroadcast
ASTA Provider broadcasts provide an almost no code, efficient way to keep make sure
that remote clients receive any changes posted to the server in real time by other users.
Broadcasts are triggered by AstaClientDataSets applying their updates on the server
either by calling ApplyUpdates or SendProviderTransactions. There may be times however
when you want to flow custom information or information triggered by client side
messaging or a server side process through the provider broadcast mechanism.
procedure TAstaServerSocket.BroadCastProviderchanges(ClientSocket:
TcustomWinSocket; TheProvider: TAstaProvider; const ProviderName,
UpdateTableName: string; D: TAstaDataSet; BroadCastsToOriginalClient:
Boolean);
Value Meaning
ClientSocket If you want to use ASTA messaging to trigger a broadcast
manually you can pass in the
ClientSocket:TCustomWinSocket that is available on ASTA
server whenever a client makes any server request. If you
want to trigger the broadcast from the server just pass in
NIL for the ClientSocket.
94 / 449
ASTA 3 for Delphi
TheProvider You don't have access to the actual provider so pass NIL for
TheProvider.
D This can contain any dataset you want but most probably
will be a TAstaDataSet (in memory DataSet) that you
create and populate. Remember, that remote clients are
going to try and do updates based on the PrimeKey field
and are expecting certain fields. Of course if you are coding
the OnProviderBroadcast of the AstaClientDataSet yourself,
do as you please and send over anything you want! The
dataset must contain the same extra 2 fields as the normal
broadcast dataset 'delta' and 'bookmark' where delta
contains one of TDeltaType = (dtEdit, dtDelete, dtAppend,
dtAppendAndDelete);
6000:
begin
AstaServerSocket1.BroadCastProviderchanges(ClientSocket, nil,
params[0].Name, 'customer', params[0].AsDataSet as TAstaDataSet, true);
end;
6001:
begin
AstaServerSocket1.BroadCastProviderchanges(nil, nil, params[0].Name,
'customer', params[0].AsDataSet as TAstaDataSet, true);
end;
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
In order to fetch primekey field information for any provider to allow the
Provider.ProviderBroadcast.BroadcastAction to function as baAuto primekey field
information must be available on the AstaClientDataSet. To retrieve primekey field
information for providers, call the SetPrimeKeyFieldsFromProvider method after the
Provider is opened and you are connected to the server. Use the OnAfterPopulate event to
call this method.
95 / 449
ASTA 3 for Delphi
if AstaClientDataSet1.PrimeFields.Count = 0 then
AstaclientDataSet1.SetPrimeKeyFieldsFromProvider;
Created with the Personal Edition of HelpNDoc: Easily create EPub books
Broadcasts allow changes from from one user to be seen by other users, and optionally to
have their TAstaClientDataSets automatically updated. Using SendProviderTransactions,
multiple AstaClientDatasets can be updated on the server in one transaction.
ASTA 3 adds the ability to add manual broadcasts for providers. This allows you to create
and fill a TAstaDataSet on the server with any kind of data you want and broadcast it out
to users who have registered a provider for a broadcast. This broadcast can be initiated
by a server side process, or by a message from a remote client to trigger the broadcast.
When AstaClientDataSets are used in conjunction with AstaProviders on the server, when
ApplyUpdates is called, 2 Datasets are created, an OriginalValuesDataSet and a
CurrentValuesDataSet. They are linked together by a Bookmark:Integer field so that on
the server, the Provider Before/After events can be fired for each row of the
OriginalValuesDataSet. You can allow the TAstaProvider to generate SQL or you can set
the Handled:Boolean param to true and perform any database activity you choose.
We have had ASTA users, using Views, who use providers and take control of updating
whatever tables they want, taking control of their own data destiny. But by doing this,
they lose the ability to broadcast their changes since they have choosen to not allow
ASTA to generate SQL for update.
ASTA 3 introduces a new Event and a couple of new Provider properties to allow for ASTA
users to use Broadcasts even though they have elected to take control of the Update
process in lieu of ASTA's default behavior.
All of the providers that participated in the SendProviderTransation call will be presented
in this event as an Array of TAstaProvider.
96 / 449
ASTA 3 for Delphi
procedure TServerDM.ServerSocketProviderCompleteTransaction(
Sender: TObject; TransactionCommitted: Boolean; const Providers: array of
TAstaProvider);
var
i: Integer;
begin
for i := Low(providers) to High(Providers) do begin
if Providers[i].RetainCurrentValuesDataset then begin
if providers[i].CurrentValuesDataSet = nil then
Log(' nil ')
else
Log(Providers[i].Name + ' :' +
IntToStr(Providers[i].CurrentValuesDataSet.RecordCount) + ' current
values.');
end else Log(Providers[i].Name);
end;
end;
Thanks to our ASTA users in Scandinavian countries who seem to be big Provider
Broadcast fans.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
When using ASTA providers and ServeMmethods and setting the ProviderName or
ServerMethod Name at runtime for AstaClientDataSets, Param information must be
retrieved from the server. In order to make this process more efficient, and to eliminate
server round trips, Provider and ServerMethod information can be cached on the client.
The AstaClientSocket has a method that can fetch Provider and Servermethod
information:
AstaClientSocket.CacheMetaDataOptions: TServerMetaCacheOptions
TServerMetaCacheOptions = (smNoCache, smFetchOnValidate, smLoadFromFile);
97 / 449
ASTA 3 for Delphi
If you want to manually control this process use the following call after the client has
been authenticated in the OnLoginParamsEvent:
AstaClientSocket.CacheproviderAndMethodInfoLocally(FileName: string;
ForceServerRefresh: Boolean);
If your server will not change, you can store this information in a local file. Call it after
your client has logged into the server.
Now anytime you set a provider or servermethod at runtime, the param information will
be retrieved from a local store. In addition the Provider primekey field information will be
stored in this cache so that support for the baAuto Broadcast Option will be transparent.
It is recommended that MetaData be cached using the smFetchOnValidate property. This
greatly reduces server round trips.
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad
When using server side SQL, AstaClientDataSets do not generate SQL on the client but
instead send the OldValuesDataSet and current values dataset only.
In order to preserve bandwidth, if blob and memo fields are not changed then the
blob/memo fields are not sent but are instead set to null. This then makes it problematic
as to how to set the blob/memo field in the OnProviderBroadcast event on the client.
Created with the Personal Edition of HelpNDoc: Effortlessly create a professional-quality documentation
website with HelpNDoc
Security Issues
ASTA has a rich set of options and events in order to insure that your ASTA application
will run securely. Remote Clients can be authenticated and all communication can be
encrypted and compresssed. Below is a general discussion of the events and properties
that are used to secure ASTA Servers.
Remote Users who don't login correctly can be immediately disconnected using the
AstaServerSocket.DisconnectClientsOnFailedLogin Property.
98 / 449
ASTA 3 for Delphi
Design time Access can be controlled with TrustedAddresses and the DTUserName and
DTPassword properties.
Authentication
Encryption
By default, ASTA servers are shipped with no security to easily allow clients to connect to the server.
Servers can be made secure in degrees and also allow for "back doors" to allow for administration and
design time support. In addition, users can be allowed to access certain processes on servers.
Authentication
Using the OnClientAuthenticate event on the AstaserverSocket, users can be required to use a
username and password. By default the AstaClientSocket will not even login to the server. To trigger the
login process the AstaClientSocket.AutoLoginDlg must be set to anything but ltNoChallenge. When this
happens UserName and Password along with the ClientsocketParams will be sent to the server after a client
connects to the server. See the discussion on the Login process for more detail.
ASTA servers will allow for ASTA clients to successfully connect to the server with AutoLoginDlg set to
ltNoChallenge. For new ASTA users, we have found that we must not secure servers too tightly as they will
have difficulting connecting to servers.
To set an ASTA server so that the ONLY message that is allowed to be processed by any remote client is an
Authentication message, containing the server name and password, set the
AstaServerSocket.SecureSocket:Boolean to true.
Note: this will close the old design time back door used by DTAccess. Used TrustedAddressses if you want
to allow for design time access with no login.
Remote Users who don't login correctly can be immediately disconnected using the
AstaServerSocket.DisconnectclientOnFailedLogin Property.
(for backwards compatibility the old Design time Access is still available but using TrustedAddressess is
now the recommended method of defining back doors).
The AstaServer can set the public SecureSocket :Boolean to true to ONLY allow for Login Messages to be
processed to completely lockdown a server and force any access to require a Login before any other
message can be processed.
Hardware can also be used to authenticate users allowing for only certain PC's, by registering the MAC
address of the network card on the server, to be authenticated. SkyWire Clients (palm and Wince) also
send unique identifiers to the server that can be used to insure that only authorized devices, with proper
usename and password, that also use a recognized encryption scheme can connect to ASTA servers.
99 / 449
ASTA 3 for Delphi
defined that will be allowed to connect and process any kind of data on the server. If you set SecureServer
to true and still want to allow for design time access to the server use the TrustedAddresses property to
define what development machines can connect to your server.
Encryption
For production servers, encryption should be used in addition to Authentication. ASTA supplies native
DES, AES and RSA Encryption that is available cross platform. Additionally, custom encryption can be
used which allows for any Encyryption component to be used on ASTA servers and clients. The only
reuqirement is that a passed in VAR string be encrypted or descrypted.
See Also
DES
AES
RSA Encryption
The OnBeforeProcessToken event allows any server side process to be limited to any or all users. In
addition, the UserRecord.ParamList can be used to store any kind of information so you can code your
server to have a security level for each client and check as to whether you want to permit access
depending on some criteria and if not, raise an exception.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
Encryption
ASTA has implemented DES, AES and RSA Public key Encryption in Pascal for Delphi and in C++ for
Palm, Wince and Linux Clients. There are open source options for use in ASTA Java Clients.
For production servers, encryption should be used in addition to Authentication. ASTA supplies native
DES, AES (or Rijndael choose by the US Dept of Commerce) and RSA Encryption that is available cross
platform.
DES is a 64 bit encryption that is available for all ASTA users and is easily implemented by setting a few
properties on the AstaClientSocket and AstaServerSocket.There are currently licensing restrictions on
ASTA strong Encryption (AES and RSA) so that it is only available (july 2002) to users in the US and
Canada. ASTA has applied for a US Government export license and will be able to export strong encryption
outside the US later in 2002. Stronger encryption can be implemented using user defined Encryption.
Additionally, custom encryption can be used which allows for any Encyyption component to be used on
ASTA servers and clients. The only requirement is that a passed in VAR string be encrypted or decrypted.
There are inexpensive and freeware libraries for use with user defined encryption.
DES
AES
RSA Encryption
User Defined
100 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
UserDefined
ASTA allows you to plug in any kind of encryption to the TAstaServerSocket and
TAstaclientSocket.
You can find encryption libraries the following links that can all be used with ASTA.
http://www.crypto-central.com
http://www.turbopower.com
http://www.scramdisk.clara.net/d_crypto.html
http://www.streamsec.com/prod_strsec2.asp
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
RSA
ASTA RSA (512 bit) implements public key exchange. Here is the way it works with ASTA
After a client connects to a server the client makes a request to do a key exchange. The
Server sends to the client a public key. The Client randomly generates a session key for
use with a symmetric algoritm (AES) to encrypt this key by server's public key end and
sends it back to the server. The Server decrypts the session key and set this key to be
used for the clients connection.
The RSA algorithm was invented by Ronald L. Rivest, Adi Shamir, and Leonard Adleman
in 1977. This page has a collection of links to RSA-related documents on this web site.
There are a variety of different cryptographic schemes and protocols based on the RSA
algorithm in products all over the world; RSA Laboratories recommends the RSAES-OAEP
encryption scheme and the RSASSA-PSS signature scheme with appendix for new
applications.
RSAES-OAEP (RSA Encryption Scheme - Optimal Asymmetric Encryption Padding) is a
public-key encryption scheme combining the RSA algorithm with the OAEP method. The
inventors of OAEP are Mihir Bellare and Phillip Rogaway, with enhancements by Don B.
Johnson and Stephen M. Matyas.
101 / 449
ASTA 3 for Delphi
AES
ASTA implements AES, choosen by the US Dept of Commerce, in Pascal and in C++ for
use with SkyWire Clients.
AES can take either one key or two keys and ASTA defines methods and properties that
can be used to set these keys. Remember that the InKey on the Client is the OutKey on
the server.
Created with the Personal Edition of HelpNDoc: Free help authoring tool
DES
Declaration
Description
64 bit
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
Login Process
The following is a list of events that occur when an ASTA client connects to an ASTA
Server. by tcp/ip clients. Stateless http clients are authenticated by Cookies.
By default AstaClients do not go through the login process. Most production applications
102 / 449
ASTA 3 for Delphi
of course will require a login but this is not the default behavior of the AstaClientSocket.
Set the AstaClientSocket.AutoLoginDlg to anything but ltNoChallenge to force a login. To
lock down the security on an ASTA server set the TAstaServerSocket.SecureServer to
true.
7. The Login is processed and a message is sent to the client that can be handled by the
OnLoginAttempt event.If the Login Request is denied and the
DisconnectClientsOnFailedLogin:Boolean is set to true then the Client is disconnected
immediately.
9. Any AstaClientDataSets opened at design time are closed and Opened after the
ClientSocket is connected and properly authenticated so they can perform any selects
from the remote server.
10. The AstaClientSocket then requests version information from the AstaServersocket
using the Asta Remote Administrative API call of RequestUtilityInfo passing in
uiServerVersion so the AstaclientSocket.ServerVersion can be update accurately.
11. If the AstaClientSocket has the CacheMetaData property set to true then metadata, that contains
information about TAstaProviders and ServerMethods is sent to the client to allow for more efficient runtime
use of the TAstaClientDataSet with Provider and ServerMethod Params.
Created with the Personal Edition of HelpNDoc: Modernize your help files with HelpNDoc's WinHelp HLP
to CHM conversion tool
Asta Transports
Asta and Blocking Sockets
Asta in an ISAPI DLL
Early Connects
Socket Errors
103 / 449
ASTA 3 for Delphi
TCustomWinSocket
Login Process
Disabling and Enabling AutoDial
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
ASTA Transports
ASTA Clients can use a number of different protocols in communcation with remote ASTA
Servers. The ASTA server is always aware of the protocol used by remote clients. So if a
client is accessing a server from an ISAPI dll and using tcp/ip blocking calls or via
WinInet using HTTP, the server will disconnect the client since they are "stateless". When
using blocking calls the server must use Pooled or SmartThreading. ASTA Servers require
no command line switches or protocol changes to support any ASTA client. One Server
supports them all with the only requirement that they support Pooled Database Sessions.
See the discussion on Threading ASTA servers for more detail.
104 / 449
ASTA 3 for Delphi
ASTA supports blocking calls for use in Isapi DLL's and in other cases where there is no
windows message pump available. Blocking calls use the concept of TimeOut so the client
will "block" for the Timeout: Integer (milliseconds) interval. When making a blocking call
the server will "know" that the client is blocking and disconnect the client when any
server side process is done. So if you set a large timeout value, the server will still
disconnect the client as soon as possible. This is supported by the ASTA server threading
calls from remote clients and, recognizing the client as stateless, forcing a disconnect at
the end of any thread processing. Note: when running stateless use
SendGetCodedParamLists calls if you want to use ASTA messaging. See Stateless
Discussion.
SkyWire note: Traditional Palm and WinCE clients will use the same blocking calls. The
server will recognize that they are palm or WinCE clients and disconnect them also
UNLESS the SetTerminateConnection call is set to NOT terminate the client.
HTTP clients
In order to traverse or "tunnel" through firewalls, ASTA supports stateless HTTP clients
that masquerade their traffic as HTTP. This is accomplished by adding HTTP header
information to the ASTA binary transport.
HTTP clients require the use of a Web Server like Microsoft Internet Information Server
(IIS), Apache or the Omni Server (www.omnicron.ca). ASTA comes with an isapi DLL
(Astahttp.dll) that is placed in the scripts directory or equivalent of IIS and receives
requests from ASTA clients and relays them to an ASTA server. See the
TAstaClientSocket.WebServer property for a discussion on how to setup ASTA clients to
use http tunneling. Using ASTA WinINet support is the preferred method to guarantee
that any firewall can be traversed as WinInet uses the same settings as Internet
Explorer.
SkyWire Note: SkyWire clients also support http tunneling which is required for Palm VII
support via Palm.NET
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
Since ASTA uses Non-blocking and event driven sockets which require windows
messaging using ASTA Client components in an ISAPI dll has been problematic and we
have supplied AstaWinManagement.pas in order to add a message pump to
an ISAPI DLL but the results have not been consistent.
So we have added some calls to allow the ASTA client socket to be used in blocking
mode. To allow the ASTAClientDataSet to be used with blocking calls we have added
105 / 449
ASTA 3 for Delphi
This means that once the AstaclientSocket is set to block you can call
normalAstaclientDataSet calls and they will be cached until you say:
AstaClientSocket.SendAndBlock(100);
Where 100 is a timeout value of how long to wait (see TWinSocketStream for details on
this in the Delphi Help). Any error is returned as the function result. If you want to raise
an exception on the same call use:
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of HelpNDoc for
CHM Help File Generation
Since ASTA uses non-blocking and event driven sockets which require windows
messaging, using ASTA client components in an ISAPI DLL has been problematic. We
have supplied AstaWinManagement.pas in order to add a message pump to an ISAPI
106 / 449
ASTA 3 for Delphi
We have added some new calls to allow the ASTA client socket to be used in blocking
mode. To allow the ASTAClientDataSet to be used, under ASTA 2.5 we have added
routines to "cache" dataset calls if the AstaClientSocket.ClientType is ctBlocking. This
means that once the AstaClientSocket is set to block you can call normal
AstaclientDataSet calls and they will be cached until you say
AstaclientSocket1.SendAndBlock(100). Where 100 is a timeout value of how long to wait
(see TWinSocketStream for details on this in the Delphi Help).
Early Connect
The earliest you can access an Asta server is in the OnConnect of the AstaClientSocket.
The formcreate or formshow will most probably be called before the AstaclientSocket
connects to the server. If the ASTA server has SecureServer set to true you will not be
able to communicate with the server until the client has been properly Authenticated.
ASTA uses non-blocking event driven Sockets which are asyncronous by nature. You can't
write procedural code. We have shielded you from this everywhere but in the Connect.
Move your intialization code to the OnConnect method of the AstaClientSocket as that is
where you know the socket will be connected.
Some people do this but coding the OnConnect event is preferable. ASTA has a method
OpenTheSocket that does exactly this.
AstaClientSocket1.Active := True;
while not Astaclientsocket1.Active do
Application.ProcessMessages;
When you have an AstaClientDataSet open at design time here is what we do behind the
107 / 449
ASTA 3 for Delphi
scenes.
1. The AstaclientDataSet will be opened in the formcreate. The socket is not connected
yet so the AstaClientSocket adds the DataSet to an internally list to be re-opened after
the socket has successfully connected to the server.
2. After the AstaclientSocket connects ASTA iterates through all the AstaclientDataSets
found in step #1 and opens them again.
3. At run time when you say AstaClientDataSet.Open ASTA goes into a wait state using
AstaSmartWait to allow you to write procedural code and to shield you from the true
asyncronous nature of sockets.
Note: Asta messaging is asyncronous also. You do a SendCodedMessage and then handle
it in the OnCodedMesssage. However, we added a SendGetCodedParamList that uses
AstaSmartWait to allow you to write procedural code with Asta Messaging also.
The most Secure time to fetch data from an ASTA server is NOT in the OnConnect but
after a successful OnLoginParamsAttempt . This can be enforced by setting the
TAstaServerSocket.SecureServer to True.
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
Socket Errors
108 / 449
ASTA 3 for Delphi
underlying failure.
WSAENETUNREACH 10051 Network is unreachable.
WSAENETRESET 10052 Network dropped connection on
reset.
WSAECONNABORTED 10053 Software caused connection
abort.
WSAECONNRESET 10054 Connection reset by peer.
WSAENOBUFS 10055 No buffer space available.
WSAEISCONN 10056 Socket is already connected.
WSAENOTCONN 10057 Socket is not connected.
WSAESHUTDOWN 10058 Cannot send after socket
shutdown.
WSAETOOMANYREFS 10059 Too many references: cannot
splice.
WSAETIMEDOUT 10060 Connection timed out.
WSAECONNREFUSED 10061 Connection refused.
WSAELOOP 10062 Too many levels of symbolic
links.
WSAENAMETOOLONG 10063 File name too long.
WSAEHOSTDOWN 10064 Host is down.
WSAEHOSTUNREACH 10065 No route to host.
WSASYSNOTREADY 10091 Returned by WSAStartup(),
indicating that the network
subsystem is unusable.
WSAVERNOTSUPPORTED 10092 Returned by WSAStartup(),
indicating thatthe Windows
Sockets DLL cannot support
this
application.
WSANOTINITIALISED 10093 Winsock not initialized. This
message is returned by any
function except WSAStartup(),
indicating that a successful
WSAStartup() has not yet been
performed.
WSAEDISCON 10101 Disconnect.
WSAHOST_NOT_FOUND 11001 Host not found. This message
indicates that the key (name,
address, and so on) was not
found.
WSATRY_AGAIN 11002 Nonauthoritative host not found.
This error may suggest that the
name service itself is not
functioning.
WSANO_RECOVERY 11003 Nonrecoverable error. This error
may suggest that the name
service itself is not functioning.
WSANO_DATA 11004 Valid name, no data record of
requested type. This error
indicates that the key (name,
address, and so on) was not
found.
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
109 / 449
ASTA 3 for Delphi
TCustomWinSocket
TCustomWinSocket is the base class for all Windows socket objects in the Borland
Sockets which ASTA uses. See the Delphi help for more detail. This is a pointer pointing
to the the actual ClientSocket of any remote clients. A TCustomWinSocket is required to
communicate with remote clients and is maintained in the AstaServerSocket.UserList.
Unit
Scktcomp
Description
TCustomWinSocket introduces properties, events, and methods to describe an endpoint
in a Windows socket connection. Descendants of TCustomWinSocket are used by socket
components to manage the Windows socket API calls and to store information about a
socket communication link.
XML Support
1. Native DOM Parser and Thunk Layer (source code users only)
2. AstaDataSet XML Support
3. AstaParamList XML Support
ASTA 3 contains a native DOM XML parser implemented in pascal and also a "thunk" layer
to use the Microsoft XML parser. The thunk layer can only be used by ASTA source code
users and affects DataSet routines only.
Modify the defines in XML_Thunk.pas to link in the ASTA native parser, Delphi 6 XML
helpers or the MS Parser.
{$IFDEF USE_LEGAL_D6}
xmldom, XMLDoc, XMLIntf
{$ELSE} //end USE_LEGAL_D6
{$IFDEF USE_MSXML}
ActiveX, MSXML_TLB
{$ELSE} //end USE_MSXML
astaxml_dom, astaxml_xmlv, astaxml_xmlw
{$ENDIF USE_MSXML}
{$ENDIF USE_LEGAL_D6}
110 / 449
ASTA 3 for Delphi
ASTA Datasets and ParamLists can load and save XML files. The AstaXMLExplorer tutorial
shows how to use the ASTA DOM XML parser to load and browse the XML attributes of any
XML File.AstaDatasets can save and load to XML using the ADO or DataSnap (midas)
Formats.
The TAstaDataset has several methods for XML support and supports both the ADO and
Midas format.
The ASTA 2 XML routines are maintained for backwards compatibility but we recommend
you move to the new DOM XML Parser that use standard formats.
111 / 449
ASTA 3 for Delphi
It used to be that all Business Applications were Database Applications. Now with the
Internet, all business applications are Database Applications with an Internet Strategy.
Most companies support desktop browser clients whether they are customers making e-
commerce purchases or employees taking care of business.
The second stage of the Internet is upon us. The first stage secured the browser as an
integral part of normal business practices. The second stage will open up Business-to-
Business channels through Web Services, as Information Systems inter-communicate.
Mobile users with PDAs, PDA-Phones and Tablets will demand support beyond the
browser.
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
File Server
Database application development started with File Server databases, often referred to as
"Desktop Databases". Examples of these include dBase, Paradox and Access. These
databases were just files that each user accessed directly over a network or from a local
machine. Applications contained all the "business Logic" in the EXE itself and when
accessing the database "files," portions of the file itself and associated indexes were
transported over the wire. Typically, there were file corruption issues, and when any new
application was created, it needed to contain all the business logic in the program itself.
A proprietary API (Application Programming Interface) was used to access the files. There
was no security built into the system.
112 / 449
ASTA 3 for Delphi
Security None
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
Client Server
In the 1980's Client/Server systems started to appear. Clients no longer directly accessed
"files" over the network, but communicated with a "Server". Result sets or "copies" of the
data were transported over the wire and SQL became the new standard API to access the
Database. Client/Server Databases now also allowed for the "business Logic" to be stored
in the database itself through the use of foreign keys, domains, stored procedures and
triggers. The "Business Logic" could now be split between a FAT client and the server.
Client applications were said to be FAT as they often required extensive setup programs
and a number of DLL's to be installed. Each client used their own user name/password to
connect to the database as Client Server introduced security features.
Figure 1 shows basic client server design; Table 2 covers design aspects.
113 / 449
ASTA 3 for Delphi
Access SQL
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
The mid 1990's brought the Internet blowing through the world and changing it forever.
The Internet introduced the "N Tier" model with the benefits of scalability, cross platform
support and thin clients.
Figure 2 represents the basic n-tier model; Table 3 highlights design details of N-Tier
114 / 449
ASTA 3 for Delphi
Transport HTTP
State Stateless
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's
Advanced Features
As Web development matured, the use of an Application Server became "best practice".
Both Java and Microsoft (MTS) offered application Server choices. By combining the best
of client/server databases and Application Servers, modern developers can build secure,
scalable applications. Instead of having web applications access the Database directly,
Remote Procedures are coded on the Application server. Web Developers no longer need
to know which table or even what database is in use. Application level architects code the
business logic on the application Server so that any application uses the same business
rules. Application Developers can concentrate on delivering the application rather than
database specific issues.
Using an Application Server also opens up the ability for Businesses to communicate with
each other using Web Services or SOAP, as Remote Procedures are made available to
business partners.
115 / 449
ASTA 3 for Delphi
Transport HTTP
State Stateless
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
We have discussed traditional web development and shown how using an Application
server provides functionality to ensure security, scalability and the centralization of
business logic. All this, of course, is for traditional web development using html and http.
No one can dispute the popularity of browser applications. It should be noted however,
that the two most popular applications that run on the Internet - Email and Instant
Messaging - are not browser applications, but normal Windows applications.
Windows users are accustomed to features like MDI and fancy reports when running their
normal business applications. The browser interface is quite limited compared to the Rich
Thin Client applications that ASTA can provide. If the Internet is one big network, and
everybody is connected why not allow them to use Windows as it was intended? Why not
stay connected to the server and use TCP/IP so that the server can "push" out
information. Why not allow clients to communicate directly with each other?
116 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
117 / 449
ASTA 3 for Delphi
ASTA was conceived in 1997 in order to integrate the Internet with traditional
client/server database applications. ASTA Applications are Thin Client Internet database
applications that open up worlds beyond traditional database - and even Web -
development. With scalable cross platform database application servers, and cross
platform clients that not only support database applications but collaborative Internet
applications as well, the ASTA SkyWire framework provides an all-encompassing fabric.
Using this fabric, any database application with an Internet Strategy can support other
clients in addition to traditional desktop browsers, and also add collaborative abilities and
the capacity to work disconnected. Desktop users are going mobile and want the same
information outside the office they are accustomed to on the desktop. Browser users of
the world unite! You have nothing to lose but your Ethernet cables!
As the Internet moves into the Second Wave, and more users go mobile, Application
developers must reach into a toolbox that can solve problems that go well beyond the
traditional database toolset. "There is more to heaven and earth, Horatio, than Browser
applications."
The remaining pages contain tables and figures illustrating the feature rich and flexible
capacities of the ASTA technologies.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
ASTA Framework
Feature Description
Cross Platform Messaging Full Cross Platform Messaging Layer for
any datatypes.
Napster Like File Sharing ASTA Napster like API to allow for
efficiently searching and secure streaming
of files from collaborative workgroups.
Super Suitcase Model for Virtual DataSets with native SQL support
Disconnected Users for low memory use and disconnected
Application development.
118 / 449
ASTA 3 for Delphi
Thin Client ODBC Driver ASTA ODBC Driver to use with Legacy 2
tier Applications.
EJB Access from Delphi JAsta allows for EJB's to be created and
and Beyond EJB methods executed from ASTA Cross
Platform Clients.
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
119 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation
120 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
Business to Business
121 / 449
ASTA 3 for Delphi
Cross Platform/Device/Protocol
122 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
ASTA Components
ClientSide
ServerSide
AstaClientDataSet
The AstaClientDataSet is the key component in the architecture. It descends from
the VCL's TDataSet object. In essence, the AstaClientDataSet is a hybrid TTable-TQuery-
TUpdateSQL component that resides in memory. Since it is loaded into memory, access
to records in the AstaClientDataSet is extremely fast. If you need persistence, the dataset
can be streamed to a file and then loaded from the file. You point a TDataSource
component to the AstaClientDataSet in the same way that you would point a TDataSource
to a TTable or TQuery. You can use the AstaClientSocket to write Client Side SQL or to
access Business Logic on the Middle Tier with TAstaProviders and with ServerMethods
123 / 449
ASTA 3 for Delphi
using TAstaBusinessObjectsManager.
AstaClientSocket
The AstaClientSocket is the component that connects the client to the AstaServer
or middle-tier. It descends from a combination of the VCL's socket objects. The
AstaClientSocket is the client end of the "pipe". All data sent to or from the application
passes through this component. The AstaClientSocket's Address and Port properties
need to match the server's Address and Port properties (the Host and Port properties can
be used if you are using the Domain Naming System [DNS]).
The AstaClientSocket, is also a place where "global" characteristics can be assigned to the
client piece of the application. If you wish to use compression or encryption, for instance,
you would set those at the AstaClientSocket.
AstaServerSocket
The AstaServerSocket is the AstaServer component that accepts the connections
from the AstaClients. It descends from the VCL's socket objects. The AstaServerSocket
is the center control of the application server. It manages who is connected and which
messages they are receiving. Every message in an AstaServer flows through the
AstaServerSocket.
Asta Clients
AstaClients are normally comprised of an AstaClientSocket and at least one
AstaClientDataSet. The AstaClientSocket is in charge of "speaking" to the AstaServer or,
more specifically, to the AstaServerSocket.
Asta Servers
An AstaServerSocket is the core component of an ASTA server. The ASTA server is the
"application server" or "middle tier". It manages all the client connections and
simultaneously speaks to the database (via regular database controls) as necessary. As
depicted in the diagram, the ASTA server easily speaks to BDE or ODBC data sources.
Although not depicted in the diagram, the ASTA server can be made to speak to other
data sources as well. In fact, if you are willing to write an interface, the ASTA server can
be hooked up to anything you can think of. Not just databases, but process control or
custom-made equipment.
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
Client Side
TAstaDataSet
TAstaClientDataSet
TAstaClientsocket
TAsta2AuditDataSet
TAstaCloneDataSet
TAstaUpdateSQL
124 / 449
ASTA 3 for Delphi
TAstaStatusBar
Remote Directory Components
TAstaDataset
TAstaDataSet
Properties : Methods : Events
Unit
AstaDrv2
Declaration
type TAstaDataSet = class(TAstaCustomDataSet);
Description
The TAstaDataSet set is an in-memory dataset. It descends from the TDataSet object in
the Delphi VCL. The TAstaDataSet can be used like a Delphi TTable but it doesn't use the
BDE or any "real" database. In essence, it is the "thin" in "thin client". Since it resides in
memory, you will also find that it is very fast.
The same methods and techniques that you can use with TTables are used with the
TAstaDataSet but without worry about performance. Be certain to define fields before
using the TAstaDataSet, either at design time or runtime.
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
Properties
TAstaDataSet
Aggregates
FieldsDefine
Indexes
IndexFieldCount
IndexFieldNames
IndexFields
IndexName
KeyExclusive
KeyFieldCount
MasterFields
MasterSource
ReadOnly
StreamOptions
125 / 449
ASTA 3 for Delphi
Active
AggFields
AutoCalcFields
BlockReadSize
Bof
Bookmark
CanModify
Constraints
DataSetField
DataSource
DefaultFields
Designer
Eof
FieldCount
FieldDefList
FieldDefs
FieldList
Fields
FieldValues
Filter
Filtered
FilterOptions
Found
Modified
ObjectView
RecordCount
RecNo
RecordSize
SparseArrays
State
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
TAstaDataSet.Aggregates
TAstaDataSet
Declaration
property Aggregates: TAstaAggregate;
Description
Use Aggregates to define aggregates that summarize the data in the client dataset.
Aggregates is a collection of TAstaAggregate objects, each of which defines a formula for
calculating an aggregate value from a group of records in the client dataset. The
individual aggregates can summarize all the records in the client dataset or subgroups of
records that have the same value on a set of fields. Aggregates that summarize a
subgroup of records are associated with indexes, and can only be used when the
associated index is current.
TAstaAggregates is the type of the Aggregates property, which represents all the
maintained aggregates for a client dataset. A single TAstaAggregate object represents
each maintained aggregate. Maintained aggregates summarize data over the records in
the client dataset.
TAstaAggregates can include a mix of active and inactive aggregate objects. Active
aggregates are updated dynamically as the data in the client dataset is edited. Inactive
aggregates define a formula for summarizing data and a group of records to summarize,
126 / 449
ASTA 3 for Delphi
but these formulas are not evaluated. Aggregates can be inactive because they are not
currently needed, or because the index that defines the group of records they summarize
is inactive.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
TAstaDataset.FieldsDefine
TAstaDataSet
Declaration
property FieldsDefine;
Description
The FieldsDefine property editor allows you to create fields for the AstaDataSet. Input the
name, type, and size if applicable.
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
TAstaDataset.Indexes
TAstaDataSet
Declaration
property Indexes: TAstaIndexes;
Description
Asta datasets can have indexes defined so that multiple sort orders can be defined.
Indexes can be added at design time using the Indexes property or at runtime by calling
AddIndex or AddIndexFields. The following properties and methods are used in
conjunction with indexes:
Properties
IndexFieldCount
IndexFields
KeyExclusive
KeyFieldCount
127 / 449
ASTA 3 for Delphi
Methods
ApplyRange
CancelRange
EditRangeEnd
EditRangeStart
SetRange
SetRangeEnd
SetRangeStart
SetKey
EditKey
FindKey
FindNearest
GotoKey
GotoNearest
AddIndexFields
AddIndex
Created with the Personal Edition of HelpNDoc: Easily create iPhone documentation
TAstaDataSet.IndexFieldCount
TAstaDataSet
Declaration
property IndexFieldCount: Integer;
Description
Check IndexFieldCount to determine how many fields are used by the current index for
the dataset.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
TAstaDataSet.IndexFieldNames
TAstaDataSet
Declaration
property IndexFieldNames: string;
Description
Use IndexFieldNames as an alternative method of specifying the index to use for a client
dataset. Specify the name of each field on which to index the dataset, separating names
with semicolons. Ordering of field names is significant.
Note: The IndexFieldNames and IndexName properties are mutually exclusive. Setting
one clears the other.
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
HTML5 template
128 / 449
ASTA 3 for Delphi
TAstaDataSet.IndexFields
TAstaDataSet
Declaration
property IndexFields[Index: Integer]: TField;
Description
IndexFields is a zero-based array of field objects, each of which corresponds to a field in
the current index. Index is an ordinal value indicating the position of a field in the index.
The first field in the index is IndexFields[0], the second is IndexFields[1], and so on.
Note: Do not set IndexField directly. Instead use the IndexFieldNames property to order
datasets on the fly at runtime.
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
TAstaDataSet.IndexName
TAstaDataSet
Declaration
property IndexName: string;
Description
Use IndexName to specify an alternative index for a client dataset. If IndexName
contains a valid index name, then that index is used to determine sort order of records.
Note: IndexFieldNames and IndexName are mutually exclusive. Setting one clears the
other.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaDataSet.KeyExclusive
TAstaDataSet
Declaration
property KeyExclusive: Boolean;
Description
Use KeyExclusive to specify whether a range includes or excludes the records that match
its specified starting and ending values. By default, KeyExclusive is False, meaning that
matching values are included.
To restrict a range to those records that are greater than the specified starting value and
less than the specified ending value, set KeyExclusive to True.
Created with the Personal Edition of HelpNDoc: Free help authoring environment
TAstaDataSet.KeyFieldCount
TAstaDataSet
129 / 449
ASTA 3 for Delphi
Declaration
property KeyFieldCount: Integer;
Description
Use KeyFieldCount to limit a search based on a multi-field key to a consecutive subset of
the fields in that key. For example, if the primary key for a dataset consists of three-
fields, a partial-key search can be conducted using only the first field in the key by
setting KeyFieldCount to 1. Setting KeyFieldCount to 0 allows the client dataset to search
on all key fields.
Note: Searches are only conducted based on consecutive key fields beginning with the
first field in the key. For example if a key consists of three fields, an application can set
KeyFieldCount to 1 to search on the first field, 2 to search on the first and second fields,
or 3 to search on all fields. By default KeyFieldCount is initially set to include all fields in
a search.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TAstaDataSet.MasterFields
TAstaDataSet
Declaration
property MasterFields: string;
Description
The MasterFields property is used for setting up master/detail relationships. This property
must be used in conjunction with the MasterSource property and the detail table needs to
use a parameterized query. A master/detail relationship can also be used in Suitcase
mode using filters when the TAstaClientDataSet is disconnected from the server.
Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily
TAstaDataSet.MasterSource
TAstaDataSet
Declaration
property MasterSource: string;
Description
The MasterSource property determines the master table in a master/detail relationship.
The property must be used in conjunction with the MasterFields property
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaDataSet.ReadOnly
TAstaDataSet
Declaration
property ReadOnly: Boolean;
Description
130 / 449
ASTA 3 for Delphi
Use the ReadOnly property to prevent users from updating, inserting, or deleting data in
the dataset. By default, ReadOnly is False, meaning users can potentially alter the
dataset's data.
To guarantee that users cannot modify or add data to a dataset, set ReadOnly to True.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
TAstaDataSet.StreamOptions
TAstaDataSet
Declaration
property StreamOptions: TAstaStreamSaveOptions;
Description
Allows for options to be set in saving in-memory datasets.
Option Description
ssAstaLegacy
ssZlibCompression
ssEncrypted
ssIndexes
ssCachedUpdates
ssExtendedFieldProperties
ssBlobOnlyStreamEvent
ssAggregates
ssCustom
Created with the Personal Edition of HelpNDoc: iPhone web sites made easy
Methods
TAstaDataSet
AddBookmarkIndex
AddIndex
AddIndexFields
ApplyRange
CancelRange
131 / 449
ASTA 3 for Delphi
CleanCloneFromDataSet
CloneCursor
CloneFieldsFromDataSet
CloneFieldsFromDataSetPreserveFields
CompareFields
DataTransfer
DefineSortOrder
EditKey
EditRangeEnd
EditRangeStart
Empty
FastFieldDefine
FilterCount
FindKey
FindNearest
GetRecordSize
GotoKey
GotoNearest
IsBlobField
LastNamedSort
LoadFromFile
LoadFromFileWithFields
LoadFromStream
LoadFromStreamwithFields
LoadFromString
NukeAllFieldInfo
RemoveSortOrder
SaveToFile
SaveToStream
SaveToString
SetKey
SetRange
SetRangeEnd
SetRangeStart
SortOrderSort
UnRegisterClone
ValidBookmark
132 / 449
ASTA 3 for Delphi
FindNext
FindPrior
First
FreeBookmark
GetBlobFieldData
GetBookmark
GetCurrentRecord
GetDetailDataSets
GetDetailLinkFields
GetFieldData
GetFieldList
GetFieldNames
GotoBookmark
Insert
InsertRecord
IsEmpty
IsLinkedTo
IsSequenced
Last
Locate
Lookup
MoveBy
Next
Open
Post
Prior
Refresh
Resync
SetFields
Translate
UpdateCursorPos
UpdateRecord
UpdateStatus
Created with the Personal Edition of HelpNDoc: Free help authoring environment
TAstaDataSet.AddBookmarkIndex
TAstaDataSet
Declaration
procedure AddBookmarkIndex;
Description
When an index is defined with no fields defined, the internal bookmarks will be indexed.
This may increase performance with large DataSets using bookmarks.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TAstaDataSet.AddIndex
TAstaDataSet
Declaration
procedure AddIndex(FieldName: string; Descending: Boolean);
Description
133 / 449
ASTA 3 for Delphi
Call AddIndex to create a new index for the client dataset based on a single field.
FieldName is the field to use for the index. Descending specifies the sort order of the
index.
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
TAstaDataSet.AddIndexFields
TAstaDataSet
Declaration
procedure AddIndexFields(TheIndexName: string; const FieldNames: array of
string; const Descending: array of Boolean);
Description
Call AddIndexFields to create a new index for the client dataset.
TheIndexName is the name of the new index. FieldNames is an array of field names to
include in the index. Descending is an array of Boolean values to define the sort order for
each field in FieldNames. Descending must include the same number of values as
FieldNames does.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
TAstaDataSet.ApplyRange
TAstaDataSet
Declaration
procedure ApplyRange;
Description
Call ApplyRange to cause a range established with SetRangeStart and SetRangeEnd, or
EditRangeStart and EditRangeEnd, to take effect. When a range is in effect, only those
records that fall within the range are available to the application for viewing and editing.
After a call to ApplyRange, the cursor is left on the first record in the range.
Created with the Personal Edition of HelpNDoc: Effortlessly Support Your Windows Applications with
HelpNDoc's CHM Generation
TAstaDataSet.CancelRange
TAstaDataSet
Declaration
procedure CancelRange;
Description
Call CancelRange to remove a range currently applied to a client dataset. Canceling a
range reenables access to all records in the dataset.
Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation
134 / 449
ASTA 3 for Delphi
TAstaDataSet.CleanCloneFromDataSet
TAstaDataSet
Declaration
procedure CleanCloneFromDataSet(D: TDataSet); overload;
procedure CleanCloneFromDataSet(D: TDataSet; CallFirst: Boolean); overload;
Description
This method clears the current field definitions and copies the field definitions and data
from the dataset D.
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaDataSet.CleanCloneFromDataSetPrimative
TAstaDataSet
Declaration
procedure CleanCloneFromDataSetPrimative(D: TDataSet; CopyBookMarks, AddData,
CallFirst:Boolean;FieldsToSkip ,FieldsToAdd:TStrings;MaxRows:Integer = -1);
Description
CleanCloneFromDataSetPrimative gives you more control if you want to customize what fields to add or
ignore, the maximum number of rows you want to add, if you want to copy bookmarks or call the First
method before adding data.
TAstaDataSet.CloneCursor
TAstaDataSet
Declaration
procedure CloneCursor(Source: TAstaCustomDataSet; KeepFilter: Boolean);
Description
TAstaDataSets may also be cloned. This is a process where the field definitions are copied
to another TAstaDataSet and then linked to each other. Any edits, deletes or inserts will
affect all clone linked datasets. The KeepFilter argument decides whether the Filter
property and the OnFilterRecord event are used by the clone. You can remove all clone
links by calling RemoveCloneLinks or just a specific one by calling UnRegisterClone.
Created with the Personal Edition of HelpNDoc: Save time and frustration with HelpNDoc's WinHelp HLP
to CHM conversion feature
135 / 449
ASTA 3 for Delphi
TAstaDataSet.CloneFieldsFromDataSet
TAstaDataSet
Declaration
procedure CloneFieldsFromDataSet(SourceDataSet: TDataSet; AddData,
IncludeBlobs: Boolean);
Description
This method clears the current field definitions and copies the field definitions from the
SourceDataSet and allows Data to optionallaly be added as well as Blob Data. For more
control and to add data use CleanCloneFromDataSetPrimative.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
TAstaDataSet.CloneFieldsFromDataSetPreserveFields
TAstaDataSet
Declaration
procedure CloneFieldsFromDataSetPreserveFields(D: TDataSet; AddData,
IncludeBlobs, CallFirst: Boolean);
Description
Copies a dataset but does not clear out any previously defined fields.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaDataSet.CompareFields
TAstaDataSet
Declaration
function CompareFields(key1, key2: TAstaDBlistItem; AField: TField;
APartialComp, ACaseInsensitive: Boolean): Integer;
Description
Used internally for ASTA index support.
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
HTML5 template
TAstaDataSet.DataTransfer
TAstaDataSet
Declaration
procedure DataTransfer(D: TDataSet; IncludeBlobs: Boolean);
Description
This method appends the current dataset with data from D. If blob data is required, then
set IncludeBlobs to True.
136 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaDataSet.DefineSortOrder
TAstaDataSet
Declaration
procedure DefineSortOrder(ASortName: string; const AFields: array of string;
const ADescending: array of Boolean);
Description
This method has been deprecated in Asta 3. Instead use the new method AddIndex.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaDataSet.EditKey
TAstaDataSet
Declaration
procedure EditKey;
Description
Call EditKey to put the client dataset in dsSetKey state while preserving the current
contents of the current search key buffer. To determine current search keys, you can use
the IndexFields property to iterate over the fields used by the current index.
EditKey is especially useful when performing multiple searches where only one or two
field values among many change between each search.
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaDataSet.EditRangeEnd
TAstaDataSet
Declaration
procedure EditRangeEnd;
Description
Call EditRangeEnd to change the ending value for an existing range. To specify an end
range value, call FieldByName after calling EditRangeEnd. After assigning a new ending
value, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
TAstaDataSet.EditRangeStart
TAstaDataSet
Declaration
procedure EditRangeStart;
137 / 449
ASTA 3 for Delphi
Description
Call EditRangeStart to change the starting value for an existing range. To specify a start
range value, call FieldByName after calling EditRangeStart. After assigning a new ending
value, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
TAstaDataSet.Empty
TAstaDataSet
Declaration
procedure Empty;
Description
The Empty method deletes all records from the dataset. If the dataset is filtered, then
only those rows that meet the filter condition as defined by the filter property or the
OnFilterRecord event will be deleted. The DataSet must be opened when you call Empty.
Created with the Personal Edition of HelpNDoc: Maximize Your CHM Help File Capabilities with HelpNDoc
TAstaDataSet.FastFieldDefine
TAstaDataSet
Declaration
procedure FastFieldDefine(FieldName: string; FType: TFieldType; Size:
Integer);
Description
A fast way to add a new field to a TAstaClientDataSet. Just supply the field name, type
and size and you new field will be created and added to the dataset.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
TAstaDataSet.FilterCount
TAstaDataSet
Declaration
function FilterCount: Integer;
Description
FilterCount returns the count of all rows that meet the filter condition as defined by the
Filter property and the OnFilterRecord event.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
138 / 449
ASTA 3 for Delphi
TAstaDataSet.FindKey
TAstaDataSet
Declaration
function FindKey(const KeyValues: array of const): Boolean;
Description
Call FindKey to search for a specific record in a dataset. KeyValues contains a comma-
delimited array of field values, called a key. Each value in the key can be a literal, a
variable, a NULL, or nil. If the number of values passed in KeyValues is less than the
number of columns in the index used for the search, the missing values are assumed to
be NULL
If a search is successful, FindKey positions the cursor on the matching record and returns
True. Otherwise the cursor is not moved, and FindKey returns False.
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
TAstaDataSet.FindNearest
TAstaDataSet
Declaration
procedure FindNearest(const KeyValues: array of const);
Description
Call FindNearest to move the cursor to a specific record in a dataset or to the first record
in the dataset that matches or is greater than the values specified in the KeyValues
parameter. If there are no records that match or exceed the specified criteria,
FindNearest positions the cursor on the last record in the table. The KeyExclusive
property controls whether matching values are considered.
KeyValues contains a comma-delimited array of field values, called a key. If the number
of values passed in KeyValues is less than the number of columns in the index used for
the search, the missing values are assumed to be NULL.
TAstaDataSet.GetRecordSize
TAstaDataSet
Declaration
function GetRecordSize: Word;
Description
Returns the size of the current record.
Created with the Personal Edition of HelpNDoc: Bring your WinHelp HLP help files into the present with
HelpNDoc's easy CHM conversion
139 / 449
ASTA 3 for Delphi
TAstaDataSet.GotoKey
TAstaDataSet
Declaration
function GotoKey: Boolean;
Description
Use GotoKey to move to a record specified by key values assigned with previous calls to
SetKey or EditKey and actual search values indicated in the search key buffer.
If GotoKey finds a matching record, it positions the cursor on the record and returns True.
Otherwise the current cursor position remains unchanged, and GotoKey returns False.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaDataSet.GoToNearest
TAstaDataSet
Declaration
procedure GotoNearest;
Description
Call GotoNearest to position the cursor on the record that is either the exact record
specified by the current key values in the key buffer, or on the first record whose values
exceed those specified. If there is no record that matches or exceeds the specified
criteria, GotoNearest positions the cursor on the last record in the dataset.
Note: KeyExclusive determines which records are considered part of a search range.
Before calling GotoNearest, an application must specify key values by calling SetKey or
EditKey to put the dataset is dsSetKey state, and then use FieldByName to populate the
buffer with search values.
Created with the Personal Edition of HelpNDoc: Import and export Markdown documents
TAstaDataSet.IsBlobField
TAstaDataSet
Declaration
function IsBlobField(F: Tfield): Boolean;
Description
Call IsBlobField to determine whether a field represents BLOB data.
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaDataSet.LastNamedSort
TAstaDataSet
Declaration
140 / 449
ASTA 3 for Delphi
Description
This method has been deprecated in Asta 3. See Indexes instead.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
TAstaDataSet.LoadFromFile
TAstaDataSet
Declaration
procedure LoadFromFile(FileName: string);
Description
Loads a TAstaDataSet from a file. The fields should already have been defined using
FieldsDefine. If the fields have NOT been defined then use LoadFromFileWithFields.
Related Topics
Streaming
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites
TAstaDataSet.LoadFromFileWithFields
TAstaDataSet
Declaration
procedure LoadFromFileWithFields(const FileName: string);
Description
When AstaDataSets are loaded from a file, it is normally expected that the fields have
already been defined, either from a select statement or using the FieldsDefine property.
If fields have NOT been defined then use LoadFromFileWithFields.
Related Topics
Streaming
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaDataSet.LoadFromStream
TAstaDataSet
Declaration
procedure LoadFromStream(Stream: TStream);
Description
Loads a TAstaDataSet from a stream. Assumes that the fields have already been defined.
If the fields have NOT been defined call LoadFromStreamwithFields .
Related Topics
Streaming
141 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TAstaDataSet.LoadFromStreamwithFields
TAstaDataSet
Declaration
procedure LoadFromStreamWithFields(Stream: TStream);
Description
Although TAstaDataSets are saved with field information, when loading, the fields are
normally thought as to have been already defined either from the FieldsDefine property or
an SQL select statement. Use LoadFromStreamWithFields if you want the fields to be
loaded from the stream.
Related Topics
Streaming
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaDataSet.LoadFromString
TAstaDataSet
Declaration
procedure LoadFromString(S: string);
Description
This loads just the data from a string into the dataset. The field definitions are not loaded
with this method. The dataset should already contain matching field definitions.
Related Topics
Streaming
Created with the Personal Edition of HelpNDoc: Revolutionize Your CHM Help File Output with HelpNDoc
TAstaDataSet.NukeAllFieldInfo
TAstaDataSet
Declaration
procedure NukeAllFieldInfo;
Description
Removes all field definitions from a dataset.
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
142 / 449
ASTA 3 for Delphi
TAstaDataSet.RemoveSortOrder
TAstaDataSet
Declaration
procedure RemoveSortOrder(SortName: string);
Description
This method has been deprecated in Asta 3. See Indexes instead.
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaDataSet.SaveToFile
TAstaDataSet
Declaration
procedure SaveToFile(const FileName: string);
Description
This saves a dataset to disk along with all field definitions and data.
Related Topics
Streaming
Created with the Personal Edition of HelpNDoc: Full-featured EBook editor
TAstaDataSet.SaveToStream
TAstaDataSet
Declaration
procedure SaveToStream(Stream: TStream);
Description
Saves a TAstaDataSet to a stream, including the field definitions.
Related Topics
Streaming
Created with the Personal Edition of HelpNDoc: Free CHM Help documentation generator
TAstaDataSet.SaveToString
TAstaDataSet
Declaration
function SaveToString: string;
Description
DataSets can be saved to a string and stored in blob fields.
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
143 / 449
ASTA 3 for Delphi
Encryption
TAstaDataSet.SaveToXML
TAstaDataSet
Declaration
procedure SaveToXML(const FileName: string; XMLFormat: TAstaXMLDataSetFormat);
overload;
procedure SaveToXML(Stream: TStream; XMLFormat: TAstaXMLDataSetFormat);
overload;
Description
Use SaveToXML to save your dataset to either a file or stream in XML format. Specify an
XMLFormat of taxADO for the XML format used by ADO, or taxMidas for the XML format
used by MIDAS.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
TAstaDataSet.SetKey
TAstaDataSet
Declaration
procedure SetKey;
Description
Call SetKey to put the dataset into dsSetKey state and clear the current contents of the
search key buffer. Use FieldByName to supply the buffer then with a new set of values
prior to conducting a search.
TAstaDataSet.SetRange
TAstaDataSet
Declaration
procedure SetRange(const StartValues, EndValues: array of const);
Description
Call SetRange to specify a range and apply it to the dataset. The new range replaces the
currently specified range, if any.
StartValues indicates the field values that designate the first record in the range.
EndValues indicates the field values that designate the last record in the range.
144 / 449
ASTA 3 for Delphi
After a call to SetRange, the cursor is left on the first record in the range.
If either StartValues or EndValues has fewer elements than the number of fields in the
current index, then the remaining entries are set to NULL.
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad
TAstaDataSet.SetRangeEnd
TAstaDataSet
Declaration
procedure SetRangeEnd;
Description
Call SetRangeEnd to put the dataset into dsSetKey state, erase any previous end range
values, and set them to NULL. Subsequent field assignments made with FieldByName
specify the actual set of ending values for a range.
After assigning end-range values, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaDataSet.SetRangeStart
TAstaDataSet
Declaration
procedure SetRangeStart;
Description
Call SetRangeStart to put the dataset into dsSetKey state, erase any previous start range
values, and set them to NULL. Subsequent field assignments to FieldByName specify the
actual set of starting values for a range.
After assigning start-range values, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
TAstaDataSet.SortDataSetByFieldName
TAstaDataSet
Declaration
procedure SortDataSetByFieldName(FieldName: string; Descending: Boolean);
Description
Creates a temp index in order to show the DataSet sorted. To create a permanent Index
use AddIndex.
145 / 449
ASTA 3 for Delphi
TAstaDataSet.SortDataSetByFieldNames
TAstaDataSet
Declaration
procedure SortDataSetByFieldNames(const AFieldNames: array of string; const
ADescending: array of Boolean);
Description
Creates a temp index in order to show the DataSet sorted. To create a permanent Index
use AddIndexFields.
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaDataSet.SortOrderSort
TAstaDataSet
Declaration
procedure SortOrderSort(SortName: string);
Description
This method has been deprecated in Asta 3. Use Indexes now.
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaDataSet.UnRegisterClone
TAstaDataSet
Declaration
procedure UnRegisterClone(Source: TAstaCustomDataSet);
Description
Call UnRegisterClone to remove a single cloned dataset's link to a source dataset. Clone
linking is a process where the field definitions are copied to another Asta dataset and
then linked to each other. Any edits, deletes or inserts will affect all clone linked datasets.
To clone a dataset call CloneCursor.
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAstaDataSet.ValidBookMark
TAstaDataSet
Declaration
function ValidBookMark(BM: string): Boolean;
Description
146 / 449
ASTA 3 for Delphi
Events
TAstaDataSet
OnStreamEvent
TAstaDataset.OnStreamEvent
TAstaDataSet
Declaration
property OnStreamEvent: TAstaStreamEvent;
Description
Allows for streams to be encrypted/compressed when SaveToStream or LoadToStream is
called.
Created with the Personal Edition of HelpNDoc: Converting Word Documents to eBooks: A Step-by-Step
Guide with HelpNDoc
Unit
AstaDrv2
147 / 449
ASTA 3 for Delphi
DataSetToString
StringToDataSet
CloneDataSetToString
DataSetToStringWithFieldProperties
FilteredDataSetToString
StringToDataSetWithFieldProperties
These additional helper functions allow you to manipulate the TAstaDataSet component in
a variety of ways.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
FilteredDataSetToString
Unit
AstaUtil
Declaration
function FilteredDataSetToString(D: TAstaDataSet): string;
Description
This allows a TAstaDataSet to be saved to a string and calls the TAstaDataSet method
SaveToString but respects any active filters and only includes the rows matching the filter
condition. To save the complete DataSet regardless of any active filters, use
DataSetToString or CloneDataSetToString. The DataSet can be converted back to a
TAstaDataSet by calling StringToDataSet.
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
DataSetToStringWithFieldProperties
Unit
AstaUtil
Declaration
function DataSetToStringWithFieldProperties(D: TAstaDataSet): string;
Description
This allows a TAstaDataSet to be saved to a string and also saves extended TField
information.
Created with the Personal Edition of HelpNDoc: Elevate Your Help Documentation with a Help Authoring
Tool
StringToStream
Unit
AstaUtil
Declaration
procedure StringToStream(const S: string; var TM: TMemoryStream);
Description
Converts a String to a TMemoryStream that already exits.
148 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
StringToDataSetWithFieldProperties
Unit
AstaUtil
Declaration
function StringToDataSetWithFieldProperties(S: string): TAstaDataSet;
Description
This converts a string created using DataSetToStringWithFieldProperties to a
TAstaDataSet and contains extended TField properties.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
Sorting Datasets
LastNamedSort
RemoveSortOrder
SortOrderSort
DefineSortOrder
SortDataSetByFieldName
Created with the Personal Edition of HelpNDoc: Free Web Help generator
DataSetToString
Unit
AstaUtil
Declaration
function DataSetToString(D: TAstaDataSet): string;
Description
This allows a TAstaDataSet to be saved to a string and calls the TAstaDataSet method
SaveToString. The DataSet can be converted back to a TAstaDataSet by calling
StringToDataSet.
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
149 / 449
ASTA 3 for Delphi
into an eBook
CloneDataSetToString
Declaration
function CloneDataSetToString(D: TDataSet): string;
Description
This allows any TDataSet, not necessarily a TAstaDataSet descendent, to be copied to a
string. It can then be converted into a TAstaDataSet by calling StringToDataSet.
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework
StringToDataSet
Unit
AstaUtil
Declaration
function StringToDataSet(S: string): TAstaDataSet;
Description
This function calls the TAstaDataSet.LoadFromString method.
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
TAstaClientDataSet
TAstaClientDataSet
Properties : Methods : Events
Unit
AstaClientDataset
Declaration
type TAstaClientDataSet = class(TAstaBaseClientDataSet)
Description
TAstaClientDataSet implements the client database functions on an ASTAClient. This is a
hybrid component that implements methods and properties common to the two-tier
TTable and TQuery components. It is the core "thin client" component if you are accessing
a database. Multiple AstaClientDataSet objects connect to an AstaClientSocket that is
connected to the ASTA server middle tier.
The TAstaClientDataSet behaves similar to a Delphi TQuery in that you normally enter
some SQL and set Active to true to execute a query that fetches data from an Asta
server. There is a Params property for parameterized queries a MasterFields and
150 / 449
ASTA 3 for Delphi
ServerSide Techniques
The TAstaClientDataset can also be used without SQL or Stored Procedures on the client
by using TAstaProviders or ServerMethods with the TAstaBusinessObjectsManager that
don't return a result set or perhaps just parameters.If you want to efficiently see changes
in real time from the action of other users, use Provider Broadcasts.
Properties
TAstaClientDataSet
Aggregates
Ascending
AstaClientSocket
AutoFetchPackets
AutoIncrementField
DataBase
EditMode
ExtraParams
Indexes
IndexFieldCount
IndexFieldNames
IndexFields
IndexName
IndexPrimeKey
KeyExclusive
KeyFieldCount
MasterFields
MasterSource
MetaDataRequest
NoSQLFields
OldValuesDataSet
OracleSequence
OrderBy
ParamQueryCount
Params
PrimeFields
ProviderBroadCast
ProviderName
ReadOnly
RefetchOnInsert
ResetFieldsOnSQLChanges
RowsAffected
RowsToReturn
ServerDataSet
ServerMethod
151 / 449
ASTA 3 for Delphi
ShowQueryProgress
SQL
SQLGenerateLocation
SQLOptions
SQLWorkBench
StoredProcedure
StreamOptions
SuitCaseData
TableName
UpdateMethod
UpdateMode
UpdateObject
UpdateTableName
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
TAstaClientDataSet.Aggregates
TAstaClientDataSet
Declaration
property Aggregates: TAstaAggregates;
152 / 449
ASTA 3 for Delphi
Description
Use Aggregates to define aggregates that summarize the data in the client dataset.
Aggregates is a collection of TAstaIOAggregate objects, each of which defines a formula
for calculating an aggregate value from a group of records in the client dataset. The
individual aggregates can summarize all the records in the client dataset or subgroups of
records that have the same value on a set of fields. Aggregates that summarize a
subgroup of records are associated with indexes, and can only be used when the
associated index is current.
TAstaIOAggregates is the type of the Aggregates property, which represents all the
maintained aggregates for a client dataset. A single TAstaIOAggregate object represents
each maintained aggregate. Maintained aggregates summarize data over the records in
the client dataset.
TAstaIOAggregates can include a mix of active and inactive aggregate objects. Active
aggregates are updated dynamically as the data in the client dataset is edited. Inactive
aggregates define a formula for summarizing data and a group of records to summarize,
but these formulas are not evaluated. Aggregates can be inactive because they are not
currently needed, or because the index that defines the group of records they summarize
is inactive.
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaClientDataSet.Ascending
TAstaClientDataSet
Declaration
property Ascending: Boolean
Description
The Ascending property is used in conjuction with the OrderBy property to allow you to
write SQL with no order by statement and to easily change it at run time. See the
OrderBy discussion for more detail.
Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator
TAstaClientDataSet.AstaClientSocket
TAstaClientDataSet
Declaration
property AstaClientSocket: TAstaClientSocket;
Description
An ASTA client application requires an AstaClientSocket. The AstaClientSocket "speaks"
to the ASTA server as depicted in the Developer's Abstract.
In turn the AstaClientDataSet must communicate with the AstaClientSocket. The
AstaClientSocket property is responsible for connecting the AstaClientDataSet to the
AstaClientSocket. Note: Many AstaClientDataSets can be connected to a single
AstaClientSocket.
This property should be set to the AstaClientSocket on your client. The property should
fill in automatically when you drop the AstaClientDataSet onto your form or data module
after you drop an AstaClientSocket component onto it. If you drop the AstaClientDataSet
onto the form, and then the AstaClientSocket, you will have to set the property manually.
153 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Converting Word Documents to eBooks: A Step-by-Step
Guide with HelpNDoc
TAstaClientDataSet.AutoFetchPackets
TAstaClientDataSet
Declaration
property AutoFetchPackets: Boolean
Description
When an ASTA server runs in a threaded state using the Persistent Sessions Threaded
Model, a TAstaClientDataSet can be set up to open a cursor on the server and fetch rows
of data on demand, rather than the complete dataset. Set the RowsToReturn property to
a positive number and the SQLOptions.soPackets to True to enable this state.
When the above conditions are met, the AutoFetchPackets property will attempt to call
GetNextPacket when a UI control is used, or there are any calls that reference EOF or the
DoAfterScroll event. If AutoFetchPackets is set to False then you must manually call
GetNextPacket.
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites
TAstaClientDataSet.AutoIncrementField
TAstaClientDataSet
TAstaProvider
Declaration
property AutoIncrementField: string;
Description
The AutoIncrement property facilitates working with auto increment values. When you
utilize ASTA's ability to automatically generate SQL, ASTA generates SQL for all the fields
including your database's auto increment fields, but the auto increment field must not
appear in Update or Insert statements, those values must be assigned by the database
itself. Specifying the auto increment field in the AstaClientDataSet's AutoIncrementField
property allows you to overcome this problem. When you specify the AutoIncrement field,
ASTA does not include that field when it generates Update or Insert statements. The
proper SQL is generated for the remaining fields and the database correctly assigns the
auto increment value. If there are other fields that you do not want ASTA to include in
154 / 449
ASTA 3 for Delphi
In order to allow you to work easily with auto increment values at the client (or to update
those values if they are being displayed to the end user), ASTA provides an easy way for
you to retrieve those values after an Insert statement. If the auto increment field is
included as one of the fields in the RefetchOnInsert property, then the value in the
AstaClientDataSet will be automatically updated after each transaction that includes any
Insert statements.
If an AutoIncrementField is defined and included in this list of fields, then you must code
the OnInsertAutoIncrementFetch event on the TAstaServerSocket. For Paradox and
Access a call to Max (FieldName) is made. For SQLServer and SQL Anywhere you can
code a call to the variable @@identity to retrieve the last auto increment value. The ASTA
server then uses this value, or the prime key fields value to fetch all the fields as
specified in the RefetchOnInsert property. The server SQL is executed and when it all is
completed, the RefetchOnInsert values are streamed from the ASTA server and matched
up to the appropriate rows in the TAstaClientDataSet.
Related Topics
ASTA SQL Generation
Oracle Sequence
SendMasterDetailAutoIncTransaction
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaClientDataSet.DataBase
TAstaClientDataSet
Declaration
property DataBase: string;
Description
This property applies to an AstaBDE server only. If you are using an AstaODBC server this
property should be left blank.
If you are using the BDE, this property should be used if you wish to query different
aliases from the same ASTA server. When using file server databases and the BDE, the
DataBase property will map to the Alias property of a Delphi TQuery. The string value
from the Database property is passed to the ASTA server so that you can query different
data sources from the server.
The following is an example of how the DataBase property appears to an ASTA server on a
SubmitSQL statement coming from a TAstaClientDataSet:
TAstaClientDataSet.EditMode
TAstaClientDataSet
Declaration
property EditMode: string;
Description
155 / 449
ASTA 3 for Delphi
At design time, click on the EditMode property's ellipse button to bring up the EditMode
Property Editor. You must select the Update Method, the Prime Key/s (there can be more
than one field in the prime key, which correlates to your database), and the UpdateTable
(specify the table that you wish to update). The dataset's status will change to "Editable"
when you have filled in all three of the required subproperties.
TAstaClientDataSet.ExtraParams
TAstaClientDataSet
Declaration
function ExtraParams: TAstaParamList;
Description
These ExtraParams can be filled up and are used by AstaProviders when
callingApplyUpdates using AstaClientSocket.SendProviderTransactions and they then
appear on AstaProviders on the server as AstaProvider.ClientDataSetExtraParams.
Created with the Personal Edition of HelpNDoc: Free Web Help generator
TAstaClientDataSet.Indexes
TAstaClientDataSet
Declaration
property Indexes: TAstaIndexes;
Description
Asta datasets can have indexes defined so that multiple sort orders can be defined.
Indexes can be added at design time using the Indexes property or at runtime by calling
AddIndex or AddIndexFields. The following properties and methods are used in
conjunction with indexes:
Properties
IndexFieldCount
IndexFields
KeyExclusive
KeyFieldCount
Methods
ApplyRange
CancelRange
EditRangeEnd
EditRangeStart
SetRange
SetRangeEnd
156 / 449
ASTA 3 for Delphi
SetRangeStart
SetKey
EditKey
FindKey
FindNearest
GotoKey
GotoNearest
AddIndexFields
AddIndex
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with a Help
Authoring Tool
TAstaClientDataSet.IndexFieldCount
TAstaClientDataSet
Declaration
property IndexFieldCount: Integer;
Description
Check IndexFieldCount to determine how many fields are used by the current index for
the dataset.
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
TAstaClientDataSet.IndexFieldNames
TAstaClientDataSet
Declaration
property IndexFieldNames: string;
Description
Use IndexFieldNames as an alternative method of specifying the index to use for a client
dataset. Specify the name of each field on which to index the dataset, separating names
with semicolons. Ordering of field names is significant.
Note: The IndexFieldNames and IndexName properties are mutually exclusive. Setting
one clears the other.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Project Analyzer
TAstaClientDataSet.IndexFields
TAstaClientDataSet
Declaration
property IndexFields[Index: Integer]: TField;
Description
IndexFields is a zero-based array of field objects, each of which corresponds to a field in
the current index. Index is an ordinal value indicating the position of a field in the index.
157 / 449
ASTA 3 for Delphi
The first field in the index is IndexFields[0], the second is IndexFields[1], and so on.
Note: Do not set IndexField directly. Instead use the IndexFieldNames property to order
datasets on the fly at runtime.
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAstaClientDataSet.IndexName
TAstaClientDataSet
Declaration
property IndexName: string;
Description
Use IndexName to specify an alternative index for a client dataset. If IndexName
contains a valid index name, then that index is used to determine sort order of records.
Note: IndexFieldNames and IndexName are mutually exclusive. Setting one clears the
other.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaClientDataSet.IndexPrimeKey
TAstaClientDataSet
Declaration
property IndexPrimeKey: Boolean;
Description
Automatically adds an index for the primekey fields to aid in faster ProviderBroadcast
updates and faster locates.
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
HTML5 template
TAstaClientDataSet.KeyExclusive
TAstaClientDataSet
Declaration
property KeyExclusive: Boolean;
Description
Use KeyExclusive to specify whether a range includes or excludes the records that match
its specified starting and ending values. By default, KeyExclusive is False, meaning that
matching values are included.
To restrict a range to those records that are greater than the specified starting value and
less than the specified ending value, set KeyExclusive to True.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
158 / 449
ASTA 3 for Delphi
TAstaClientDataSet.KeyFieldCount
TAstaClientDataSet
Declaration
property KeyFieldCount: Integer;
Description
Use KeyFieldCount to limit a search based on a multi-field key to a consecutive subset of
the fields in that key. For example, if the primary key for a dataset consists of three-
fields, a partial-key search can be conducted using only the first field in the key by
setting KeyFieldCount to 1. Setting KeyFieldCount to 0 allows the client dataset to search
on all key fields.
Note: Searches are only conducted based on consecutive key fields beginning with the
first field in the key. For example if a key consists of three fields, an application can set
KeyFieldCount to 1 to search on the first field, 2 to search on the first and second fields,
or 3 to search on all fields. By default KeyFieldCount is initially set to include all fields in
a search.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaClientDataSet.MasterFields
TAstaClientDataSet
Declaration
property MasterFields: string;
Description
The MasterFields property is used for setting up master/detail relationships. This property
must be used in conjunction with the MasterSource property and the detail table needs to
use a parameterized query. A master/detail relationship can also be used in Suitcase
mode using filters when the TAstaClientDataSet is disconnected from the server.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
TAstaClientDataSet.MasterSource
TAstaClientDataSet
Declaration
property MasterSource: string;
Description
The MasterSource property determines the master table in a master/detail relationship.
The property must be used in conjunction with the MasterFields property
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaClientDataSet.MetaDataRequest
TAstaClientDataSet
159 / 449
ASTA 3 for Delphi
Declaration
property MetaDataRequest: TAstaMetaData;
Description
The MetaDataRequest property allows you to specify whether you are running a normal
SQL query or are requesting specific meta data. See the ISQLDemo tutorial for examples
of using the MetaDataRequest property.
Note: MetaData result sets are not supported at design time. Only at runtime.
Tip: You can get a result set which contains AstaServersocket.UserList information by
setting the MetaDataRequest to mdUserList.
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAstaClientDataSet.NoSQLFields
TAstaClientDataSet
Declaration
property NoSQLFields: TStrings;
Description
Add any fields to NOSQLFields if you do not what those fields included in insert or update
SQL generated by ASTA. Previous versions of ASTA required those fields to be tagged as
read only.
TAstaClientDataSet.OldValuesDataSet
TAstaClientDataSet
Declaration
property OldValuesDataSet: TAstaDataSet;
Description
AstaClientDataSets maintain an internal FOldValuesDataSet which contains any deleted
rows, newly inserted rows or the original values of any edited rows. This
OldValuesDataSet allows support of CancelUpdates, RevertRecord and UpdatesPending.
TAstaClientDataSet.OracleSequence
TAstaClientDataSet
TAstaProvider
160 / 449
ASTA 3 for Delphi
Declaration
property OracleSequence: string;
Description
Oracle sequences are different than auto increment fields in that they must be fired
before an insert to retrieve a unique value. They can be set using the EditMode property
of the TAstaClientDataSet from the Refetch tab or on the TAstaProvider if you are using
server side SQL.
ASTA will use the OracleSequence string to call OracleSequence.NextValue before an
insert statement. It will then retrieve it after the insert statement has successfully fired
so that it can be fetched back to the client by calling OracleSequence.LastValue from the
OnInsertAutoIncrementFetch event on the TAstaServerSocket.
ASTA supports the refetching of AutoIncrement Values on inserts. To support this the
following steps must be taken:
You must then call ApplyUpdates(usmServerTransaction) to post the SQL to the server.
procedure TfrmMain.AstaServerSocket1InsertAutoIncrementFetch(Sender:
TObject; ClientSocket: TCustomWinSocket; AQuery: TComponent; TheDatabase,
TheTable, TheAutoIncField: string; var AutoIncrementValue: Integer);
begin
with AQuery as TOracleDataSet do begin
SQL.Clear;
//right here you will have to do an if statement to get the right
sequence based on TheTable
SQL.Add('select test_seq.CURRVAL from dual');
Close;
161 / 449
ASTA 3 for Delphi
Open;
if not Eof then AutoIncrementValue := Fields[0].AsInteger;
end;
end;
4. Another select is called using the sequence to get any other values fired from triggers
or default values that you had defined in the refetch on insert property on the client using
the autoinc value just returned from the AutoIncrementFetch.
5. On the client, the results are streamed back and matched up by bookmarks. They can
be retrieved immediately after their arrival in the AfterrefetchOnInsert of the
TAstaClientDataSet,
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
TAstaClientDataSet.OrderBy
TAstaClientDataSet
Declaration
property OrderBy: string;
Description
Use the OrderBy property to append an Order By clause onto your SQL statement. By
keeping a separate order by clause you can easily change your SQL order by statement
by changing this property, and then closing and opening the TAstaClientDataSet. By
default, the OrderBy property is tagged with ASC for sort ascending, but if you have the
Ascending property set to False, a DESC for descending will be applied.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
TAstaClientDataSet.Params
TAstaClientDataSet
Declaration
property Params: TAstaParamList;
Description
The Params property holds parameter information and can be populated a number of
different ways. AstaParamLists are fully streamable and are used extensively in the ASTA
messaging system.
1. With paramaterized queries eg. Select * from Customer where custid =
:CustomerNumber. :CustomerNumber will be extracted as a parameter
2. With stored procedures. When used this way the Params property will self populate as
defined by the database.
3. With ExecSQLWithParams(S: string) to allow for insert statements that include binary
or memo fields to be executed.
4. For use in general messaging using a TAstaClientSocket and TAstaServerSocket.
5. With ExecSQL.
Params are used in many different ways: with SQL that you provide, with stored
procedures or to send values to Server Methods or Providers. They were designed to work
just like the Delphi TQuery Params. The TAstaParamList is also an important part of the
Asta Messaging feature as TAstaParamLists are fully streamable and can contain any kind
of datatypes including datasets or other TAstaParamLists.
162 / 449
ASTA 3 for Delphi
The colon ":" is the token that the Params property keys off of to populate the parameter
list.
Note: To allow ASTA to populate a parameterized query you must input the data type for
each parameter. If you set the SQL to Select * from Customer, then set Active to True
and then change the query to the above parameterized query, ASTA would be able to
correctly run a query as it already had some field information. It knew that CustNo was a
type ftInteger. If you initially write a parameterized query, click on the Params Property
Editor and set the data type to the correct value, whenever the SQL statement is
changed, ASTA checks to see if any colons exist in the new SQL statement and internally
calls Prepare to create the parameters. The default data type at this point for each
parameter is ftString and the parameter type is set to ptInput.
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
TAstaClientDataSet.PrimeFields
TAstaClientDataSet
Declaration
property PrimeFields : TStrings;
Description
The PrimeFields property is used to provide information on the fields needed to fetch a
row using a unique value. In order to have ASTA generate SQL automatically on edits,
inserts and deletes, the PrimeFields must be defined. This is used by setting the
EditMode property to define auto SQL generation and also by the PrimeFieldsWhereString
method to return a Where statement for a given table that will apply to a unique row.
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaClientDataSet.ProviderBroadCast
TAstaClientDataSet
Declaration
property ProviderBroadCast: TProviderBroadCastOptions;
Description
The ProviderBroadCase property contains sub properties RegisterForBroadcast used to
register a client to receive broadcasts from a TAstaProvider, CachedBroadCastsWhenEdit,
updates the OldValuesDataSet on broadcasts and BroadCastAction which allows you to
control control what happens when a provider broadcast is received.
property AutoUpdate:Boolean
property BroadCastAction: TBroadCastAction;
property CacheBroadcastsWhenEdit: Boolean;
property MergeEditRowBroadCasts;
property ProviderFilter: string;
property RegisterForBroadCast: Boolean;
property RetrievePrimeKeyFields: Boolean;
163 / 449
ASTA 3 for Delphi
TAstaClientDataSet.ProviderBroadCast.BroadCastAction
TAstaClientDataSet.ProviderBroadcast
Declaration
property BroadCastAction: TBroadCastAction;
Description
BroadCastAction allows you to control how provider broadcast events are handled.
Value Meaning
baIgnore The OnReceiveProviderBroadCastEvent is not fired.
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAstaClientDataSet.ProviderBroadcast.AutoUpdate
TAstaClientDataSet.ProviderBroadcast
Declaration
property AutoUpdate:Boolean;
Description
If the AstaClientDataSet.ProviderBroadCast . AutoUpdate is set to true then the
AstaClientDataSet will automatically update itself from any broadcast if the primekey
fields are avaialble and even if the OnProviderBroadcastEvent is assigned.
Created with the Personal Edition of HelpNDoc: Generate EPub eBooks with ease
164 / 449
ASTA 3 for Delphi
TAstaClientDataSet.ProviderBroadCast.CachedBroadCastsWhenEdi
t
TAstaClientDataSet.ProviderBroadcast
Declaration
property CachedBroadCastsWhenEdit:Boolean;
Description
If the AstaClientDataSet.ProviderBroadCast . BroadCastAction is set to baAuto and
CachedBroadCastsWhenEdit is set to true then any broadcasts received during an actually
edit or insert operation will be cached by updating the OldValuesDataSet and not the
current dataset that is being edited or inserted into.
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
TAstaClientDataSet.ProviderBroadCast.MergeEditRowBroadCasts
TAstaClientDataSet.ProviderBroadcast
Declaration
property MergeEditRowBroadcasts: Boolean;
Description
If this property is set to true, then provider broadcasts received for a row that is currently
being edited will be automatically merged in. This merge will apply changes where the
current editing has not already changed the value of that field. To override this
functionality, define a ProviderBroadcastEditRow event handler. This property is only valid
when CacheBroadcastsOnEdit is set to true, or BroadcastAction = baCache.
NOTE: If the user has changed a field but has not posted those changes (eg focus is still
inside the TDBEdit control) then the value in the field they are currently editing will be
updating to the value that was in the broadcast. If you want to take alternate action here,
code the ProviderBroadcastEditRow event.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Encrypted, Password-Protected PDFs
TAstaClientDataSet.ProviderBroadCast.ProviderFilter
TAstaClientDataSet.ProviderBroadcast
Declaration
property ProviderFilter: string;
Description
Broadcasts can be an expensive operation so by adding the ability to filter any datasets
for broadcast can cut down on the amount of broadcasts. ProviderFilter:String supports
normal TDataset filtering but is applied on the server. So if another user changes a
dataset and updates a Cost Column, and a filter of Cost<10 is declared on the provider,
and the cost =>10 there will be no broadcast.
165 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaClientDataSet.ProviderBroadCast.RegisterForBroadcast
TAstaClientDataSet.ProviderBroadcast
Declaration
property ProviderBroadcast.RegisterForBroadcast: Boolean;
Description
Setting this property registers a client to receive broadcasts from TAstaProviders.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaClientDataSet.ProviderBroadCast.RetrievePrimeKeyFields
TAstaClientDataSet.ProviderBroadcast
Declaration
property RetrievePrimeKeyFields: Boolean;
Description
RetrievePrimekeyFields makes a call to SetPrimeKeyFields to retrieve primekey field info
at runtime. This allows for the bsAuto option to be used to automatically update
AstaClientDatasets receiving broadacasts.
In order to fetch primekey field information for any provider to allow the
Provider.ProviderBroadcast.BroadcastAction to function as baAuto primekey field
information must be available on the AstaClientDataSet. Setting RetrievePrimeKeyFields
to True is the same as manually calling SetPrimekeyFieldsFromProvider. The Primekey
field is used so a locate can be used to update any rows coming in from broadcasts.
if AstaClientDataSet1.PrimeFields.Count = 0 then
AstaclientDataSet1.SetPrimeKeyFieldsFromProvider;
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaclientDataSet.ProviderName
TAstaClientDataSet
Declaration
property ProviderName: string;
Description
It is NOT required that you code ASTA servers to deploy an ASTA application but if you
want to get more control over the SQL that ASTA generates or want to have access to
update, insert and delete statements when they are fired on the server, then perhaps you
need to use a TAstaProvider.
166 / 449
ASTA 3 for Delphi
The ProviderName property shows a list of TAstaProviders that exist on an ASTA server.
ASTA servers register their providers, server side datasets and
TAstaBusinessObjectManagers by calling AstaServerSocket.RegisterDataModule.
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
These Security Measures
TAstaClientDataSet.ReadOnly
TAstaClientDataSet
Declaration
property ReadOnly: Boolean;
Description
Use the ReadOnly property to prevent users from updating, inserting, or deleting data in
the dataset. By default, ReadOnly is False, meaning users can potentially alter the
dataset's data.
To guarantee that users cannot modify or add data to a dataset, set ReadOnly to True.
Created with the Personal Edition of HelpNDoc: Free help authoring environment
TAstaClientDataSet.RefetchOnInsert
TAstaClientDataSet
Declaration
property RefetchOnInsert: TStrings;
Description
The RefetchOnInsert property allows you to easily retrieve specific field values after an
Insert or Update statement. If you have an auto increment field or perhaps a timestamp
field that is inserted by a trigger, you can use this property to return those values. This
property will work for a single transaction or a group of transactions.
Specify the fields that you want to retrieve in the RefetchOnInsert property editor.
Whenever an Insert statement is fired, the values will be returned to the client. The
AfterRefetchOnInsert event will notify you when the values have been returned. Code
that event if you need to take immediate action with the returned value.
If an auto increment field is defined and included in this list of fields, then you must code
the OnInsertAutoIncrementFetch event on the TAstaServerSocket. For Paradox and
Access a call to Max (FieldName) is made. For SQLServer and SQL Anywhere you can
code a call to the variable @@identity to retrieve the last autoincrement value. The ASTA
server then uses this value, or the prime key fields values to fetch all of the fields as
specified in the RefetchOnInsert property. All of the server SQL is executed and when it is
completed, the RefetchOnInsert values are streamed from the ASTA server and matched
up to the appropriate rows in the TAstaClientDataSet.
Note: This property will not work if your database does not support transactions.
Refetch Discussion
Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily
167 / 449
ASTA 3 for Delphi
TAstaClientDataSet.ResetFieldsOnSQLChanges
TAstaClientDataSet
Declaration
property ResetFieldsOnSQLChanges: Boolean;
Description
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with
HelpNDoc's Stunning User Interface
TAstaClientDataSet.RowsAffected
TAstaClientDataSet
Declaration
property RowsAffected: Integer;
Description
ASTA 2.5 supports a public RowsAffected property on the AstaClientDataSet to be able to
return the rows affected by ExecSQL statements.
TAstaClientDataSet.RowsToReturn
TAstaClientDataSet
Declaration
property RowsToReturn: Integer;
Description
The RowsToReturn property specifies how many rows to return in the result set. The
default value is -1 which will return all rows. A value of 0 will return an empty DataSet.
Other values will limit the result set to the RowsToReturn value. You may also set the
number of rows that you want to populate at design time using the SQL WorkBench
Design time Populate tab.
Note: this does not affect the server's query, only the amount packed up and dispatched
by the ASTA server.
When an ASTA server runs in a threaded state using the Persistent Sessions Threaded
Model, the RowsToReturn property allows you to open up a cursor on the server. SQL
Options must have the soPackets set to True also. The initial fetch will return
RowsToReturn rows, and then the dataset on the server will stay active allowing calls to
GetNextPacket. You can close the Query on the server by calling CloseQueryOnServer.
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
168 / 449
ASTA 3 for Delphi
TAstaClientDataSet.ServerDataSet
TAstaClientDataSet
Declaration
property ServerDataSet: string;
Description
ASTA supports the use of datasets on the ASTA server also. The property ServerDataSet
pulls down a list of any TDataSet descendents in use on the connected ASTA server. If
you are not sure as to which type any of these datasets are, you can get more detailed
information from the SQLWorkbench tab ServerDataSets. This shows not only the list of
the TDataSets on the server but their Delphi 'type' also. A TQuery or a TTable or a
TAstaDataSet are examples of possible values. This would include any TDataSet
descendent that you use for your particular backend, like InfoPower TwwQueries or
ODBCExpress TOEDataSets.
The ASTAClientDataSet can act as mirror of any of these datasets sitting on the ASTA
server. Set the ServerDataSet property to the TDataSet descendent that you want to
fetch data from and then set the MetaDataRequest property to TACustomDataSets. Note:
design time population of ServerDataSets is not supported at this time. To populate the
TAstaClientDataSet with the data contained in the specified server side TDataSet, just set
the active property to True anytime after the TAstaClientSocket connects to the server.
The earliest you may do this, is in the TAstaClientSocket's OnConnect event.
When using the ASTA server side features as described above there are additional options
available that are not available when writing your own client side SQL.
You have the opportunity to trigger a ServerActionEvent and to pass values to the
ServerDataSet along with an Action Identifier. This will allow you to make decisions on
the server according to client requests. To trigger a server side event for a specific
dataset on the server, you must write two events, one on the client and one on the
server.
169 / 449
ASTA 3 for Delphi
Params.FastAdd(SysUtils.Now);
end;
end;
The above example sends an ActionInt integer value to the server so that the server can
trigger an event. By adding values to the Params property using the FastAdd method,
typed parameters can be sent to the server. In this example, a String, an Integer, a
Double and a TDateTime are sent to the server.
The following code is taken from the BDEServer example code found in the
\ASta\Servers\BDE\Code directory and is the actual code running on the BDE and ODBC
servers as supplied with the ASTA components.
The TAstaServerSocket has an OnServerDataSetAction event where you can compare the
dataset coming in with the client request, process the ActionID coming in as an integer
to key off of for any action you want to take, and also receive typed parameters coming
from the client. You may want to close and open the dataset, change the Order By or
Where clause or take any other kind of action. The parameters come in as a
TAstaParamList so you may use them as any kind of data type that you need. In the
above example, the incoming parameters are appended to the client requests memo on
the server.
With this kind of server and client communication, ASTA gives you the best of client side
AND server side development options. You decide how to write your 3-Tier application
and ASTA supports any model that you want to use.
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites
TAstaClientDataSet.ServerMethod
TAstaClientDataSet
Declaration
property ServerMethod: string;
Description
To create client applications that use no SQL with all of the business logic on the server,
170 / 449
ASTA 3 for Delphi
To invoke a server method at design time, pull down the ServerMethod property to see a
list of methods available on the server. Any parameters defined on the server will be
automatically created on the client. You can set these parameters at run time or at design
time. When the Active property is set to True, the dataset will populate and any method
"coded" on the server will be executed.
Created with the Personal Edition of HelpNDoc: Free Kindle producer
TAstaClientDataSet.ShowQueryProgress
TAstaClientDataSet
Declaration
property ShowQueryProgress: TShowQueryProgressType;
Description
The ShowQueryProgress property determines if a progress bar will appear when a
TAstaClientDataSet is packaging up result set information.
Note: Use of this property does affect performance. The default value is sqDontShow.
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
TAstaClientDataSet.SQL
TAstaClientDataSet
Declaration
property SQL: TStrings;
Description
The SQL property allows you to enter SQL Queries. It operates just like the TQuery.SQL
property. When used at design time, it will set the active property to False. To populate at
design-time just set the Active property to True. If your SQL is valid, and you have an
ASTAServer running, the AstaClientDataSet will populate. Once the dataset populates at
design time ASTA will not attempt to refetch FieldDef information or data unless you
change the SQL or you use the SQLWorkbench Property and click on the Design Populate
button. This is to minimize unnecessary communication between to the server.
Created with the Personal Edition of HelpNDoc: Free Web Help generator
TAstaClientDataSet.SQLGenerateLocation
TAstaClientDataSet
Declaration
property SQLGenerateLocation: TGenerateSQLLocation;
171 / 449
ASTA 3 for Delphi
Description
An AstaClientDataSet can generate SQL on either the client or on the server. If you want
complete control over the SQL generated by ASTA you can move the SQL generation to
the ASTA server and get "between" each row of SQL that ASTA generates. To make an
TAstaClientDataSet updatable that is connected to a TAstaProvider set the
SQLGenerateLocation to gsServer and the EditMode will be set to Cached. The EditMode
property editor is only used when using ClientSide SQL and not with TAstaProviders.
TAstaProviders only support Cached Edit mode and to simulate AfterPost edit Mode
behavior you can call ApplyUpdates from within the AfterPost event.
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TAstaClientDataSet.SQLOptions
TAstaClientDataSet
Declaration
property SQLOptions: TAstaSelectSQLOptionSet;
Description
When the soFetchMemos or soFetchBlobs subproperty is set to True, memo fields can be
automatically fetched from a select statement. There are performance considerations
when using this feature, particularly over a WAN connection, so please use it with
caution. Any field that is a TMemo will be streamed from the server to the client. Please
understand that overhead will be incurred when you use this feature. To activate the
automatic fetching of memo fields, set the AstaDataDataSet.SQLOptions.soFetchMemos
subproperty to True.
Tip: for performance purposes you may want to set soFetchMemos and soFetchBlobs to
false when you do your select but then activate them after the AstaClientDataSet is
opened so that any local edits and appends of blobs or memos are posted to the server in
a parameterized query.
Example
AstaClientDataset.SQLOptions := AstaClientDataSet.SQLOptions +
[soFetchMemos, soFetchBlobs];
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAstaClientDataSet.SQLWorkBench
TAstaClientDataSet
Declaration
property SQLWorkBench: string;
Description
The SQLWorkBench allows you to view the database's metadata while developing on the
client. The SQLWorkBench allows you to discover critical information about your database.
172 / 449
ASTA 3 for Delphi
This powerful property enables remote development; run an AstaServer at the remote
location and an AstaClient can expose key database information - whether it's down the
hallway, across town, or around the world.
Note: if you have added a field to a table on which you have right moused and defined
persistent fields at design time use the SQL Workbench to force an update by clicking on
the Design Populate button. Then Right Mouse from the AstaClientDataset at design time
and use the Fields Editor to add the new field.
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaClientDataSet.StoredProcedure
TAstaClientDataSet
Declaration
property StoredProcedure: string;
Description
The StoredProcedure property allows you to select predefined StoredProcs. When a Stored
Procedure is selected, the SQL and TableName properities will be cleared and the Params
will automatically populate based on the database stored procedure definition.
When a stored procedure returns a result set when executed, the data will populate the
TAstaClientDataSet. Any result parameters will be returned in the TAstaParamList. Stored
procedures can be used at run time by calling the Prepare method after you change the
StoredProcedure name so that ASTA can create the parameters for that stored procedure.
If your StoredProcedure does not return a result set then call ExecSQL. Calling ExecSQL
with a the StoredProcedure property set to to a valid StoredProcedure name adds an
soExecStoredProc to the SQLOptions of the AstaClientDataSet.SQLOptions property which
is transmitted to the AstaServer so that the OnStoredProcedure event of the
AstaServerSocket can be called with the NoResultSet:Boolean set to true. Setting the
AstaClientDataSet.Active to true with the soExecStoredProc property set is equivalent to
calling ExecSQL.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
TAstaClientDataSet.StreamOptions
TAstaClientDataSet
173 / 449
ASTA 3 for Delphi
Declaration
property StreamOptions: TAstaStreamSaveOptions;
Description
AstaDataSets are streamable. By default AstaDatasets use the ASTA binary format to
stream to disk and write all blobs. If ssIndexes is set to true then the Indexes are saved
also. If ssAggregates is true then the Aggregates are saved. If ssBlobOnlyStream is true
event an event is fired that passes any blob field so that it can be optionally compressed
or uncompressed in the OnStreamEvent. Otherwise the OnStreamEvent includes the
complete DataSet stream including blobs and any indexes or aggregates.
ASTA 3 datasets are not stream compatible with ASTA 2 datasets as they write a header
integer that includes the TAstaStreamSaveOptions. If ssExtendedFieldProperties are set
to true than any persistent field properties are saved to the stream also.
TAstaClientDataSet.SuitCaseData
TAstaClientDataSet
Declaration
property SuitCaseData: TSuitCaseData;
Description
The SuitCaseData property includes these three sub properites:
Active: Whether or not to use the suitcase model (Boolean).
FileName: The name of the file to which the dataset will be streamed to and from
(String).
SavedCachedUpdates: Whether or not to save the OriginalValueDataSet that ASTA uses
to implement cached updates (Boolean).
Active and FileName must be set in order for the suitcase model to be activated. Open
will call the LoadFromFile(SuitCaseData.FileName) to load the dataset from disk. You
must manually call the SaveToFile(SuitCaseData.FileName) to save the data to disk. If
you want a TAstaClientDataSet to be open and NOT fetch data automatically from the
server, set the SuitCaseData.Active property to True and FileName to NULL. OpenNoFetch
will temporarily set the SuitCaseData.Active property to True to allow a
TAstaClientDataSet to be opened without going to the server.
TAstaClientDataSet.TableName
TAstaClientDataSet
174 / 449
ASTA 3 for Delphi
Declaration
property TableName: string;
Description
The TableName property should be set to the table that you are targeting. This is not
needed if you are writing an SQL query using the SQL property. Using the TableName
property with the MetaDataRequest set to taNormalQuery creates an SQL statement of
"SELECT * FROM [TableName]" (where TableName is your selection).
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
TAstaClientDataSet.UpdateMethod
TAstaClientDataSet
Declaration
property UpdateMethod: TAstaUpdateMethod;
Description
Determines when SQL is posted to the server. umAfterPost will fire after a record is
posted. umCached requires the ApplyUpdates method to be called.
Created with the Personal Edition of HelpNDoc: Full-featured Documentation generator
TAstaClientDataSet.UpdateMode
TAstaClientDataSet
Declaration
property UpdateMode: TAstaUpdateMode;
Description
This property specifies the way that ASTA generates the Where clause on update and
delete statements when applying updates.
Value Meaning
upWhereAll Uses all the fields as they existed before the row was
edited as found in the OldValuesDataSet.
upUpdateWhereKeyOnly Uses just the primary key fields for the update statement.
upWhereChanged Uses the primary key fields and the original value of fields
that have changed for the where clause.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
175 / 449
ASTA 3 for Delphi
TAstaClientDataSet.UpdateObject
TAstaClientDataSet
Declaration
property UpdateObject: TAstaUpdateSQL;
Description
Use UpdateObject to specify the TAstaUpdateSQL component to use in an application that
must be able to update a result set using the extended abilities of this component.
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaClientDateSet.UpdateTableName
TAstaClientDataSet
Declaration
property UpdateTableName: string;
Description
In order for ASTA to generate SQL on update, insert and delete statements, the
UpdateTableName property must be set. To change the UpdateTableName of an
AstaClientDataSet at run time use the SetEditMode method.
Related Topics
Asta SQL Generation
Multi Table Updates from Joins
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
Methods
TAstaClientDataSet
AddBookmarkIndex
AddParameterizedQuery
ApplyBulkUpdates
ApplyRange
AddIndex
AddIndexFields
CancelRange
CancelUpdates
CleanCloneFromDataSet
ClearParameterizedQuery
CloneCursor
CloneFieldsFromDataSet
CloneFieldsFromDataSetPreserveFields
CloseQueryOnServer
DataTransfer
DeleteNoCache
DeltaAsSQL
176 / 449
ASTA 3 for Delphi
DeltaChanged
EditKey
EditRangeEnd
EditRangeStart
Empty
EmptyCache
ExecQueryInTransaction
ExecSQL
ExecSQLString
ExecSQLTransaction
ExecSQLWithInputParams
ExecSQLWithParams
FastFieldDefine
FetchBlob
FetchBlobString
FieldNameSendBlobToServer
FindNearest
FormatFieldforSQL
GetNextPacket
GetNextPacketLocate
GetRefetchStatus
GotoKey
GotoNearest
LoadFromFile
LoadFromFileWithFields
LoadFromStream
LoadFromStreamWithFields
LoadFromString
LoadFromXML
NukeAllFieldInfo
OpenNoFetch
OpenWithBlockingSocket
ParamByName
ParamQueryCount
PopSQLFromParser
Prepare
PrimeFieldsWhereString
PushSQLToParser
RefireSQL
RefireSQLBookmark
RefreshFromServer
RegisterProviderForUpdates
RemoveSortOrder
RevertRecord
SaveSuitCaseData
SaveToFile
SaveToStream
SaveToXML
SendBlobToServer
SendParameterizedQueries
SendSQLStringTransaction
SendSQLTransaction
SendStringAsBlobToServer
SendStringListToServer
SetEditMode
SetKey
SetPrimeKeyFieldsFromProvider
SetRange
SetRangeEnd
SetRangeStart
177 / 449
ASTA 3 for Delphi
SetSQLString
SetToConnectedMasterDetail
SetToDisConnectedMasterDetail
SortDataSetByFieldName
SortDataSetByFieldNames
SortOrderSort
UnRegisterClone
UnRegisterProviderForUpdates
UpdatesPending
178 / 449
ASTA 3 for Delphi
Translate
UpdateCursorPos
UpdateRecord
UpdateStatus
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaClientDataSet.AddBookmarkIndex
TAstaClientDataSet
Declaration
procedure AddBookmarkIndex;
Description
When an index is defined with no fields defined, the internal bookmarks will be indexed.
This may increase performance with large DataSets using bookmarks.
Created with the Personal Edition of HelpNDoc: Easily create EPub books
TAstaClientDataSet.AddIndex
TAstaClientDataSet
Declaration
procedure AddIndex(FieldName: string; Descending: Boolean);
Description
Call AddIndex to create a new index for the client dataset based on a single field.
FieldName is the field to use for the index. Descending specifies the sort order of the
index.
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaClientDataSet.AddIndexFields
TAstaClientDataSet
Declaration
procedure AddIndexFields(TheIndexName: string; const FieldNames: array of
string; const Descending: array of Boolean);
Description
Call AddIndexFields to create a new index for the client dataset.
TheIndexName is the name of the new index. FieldNames is an array of field names to
include in the index. Descending is an array of Boolean values to define the sort order for
each field in FieldNames. Descending must include the same number of values as
FieldNames does.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
179 / 449
ASTA 3 for Delphi
TAstaClientDataSet.AddParameterizedQuery
TAstaClientDataSet
Declaration
procedure AddParameterizedQuery(TheSQL: string; P: TAstaParamList);
Description
When sending parameterized queries to be executed within on transaction on the server,
AddParameterizedQuery adds a Query to the List to be executed.
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
TAstaClientDataSet.ApplyBulkUpdates
TAstaClientDataSet
Declaration
procedure ApplyBulkUpdates(RowsToApply: Integer)
Description
ApplyUpdates generates the SQL that has been generated for any edit, insert or delete
activity since the last call to ApplyUpdates. If your server supports transactions, you may
call ApplyUpdates(usmServerTransactions). If you have done a lot of updates and want to
apply a subset of them you can use ApplyBulkUpdates. Note a separate transaction will
be used for each call to this method.
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
TAstaClientDataSet.ApplyRange
TAstaClientDataSet
Declaration
procedure ApplyRange;
Description
Call ApplyRange to cause a range established with SetRangeStart and SetRangeEnd, or
EditRangeStart and EditRangeEnd, to take effect. When a range is in effect, only those
records that fall within the range are available to the application for viewing and editing.
After a call to ApplyRange, the cursor is left on the first record in the range.
Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor
TAstaClientDataSet.ApplyUpdates
TAstaClientDataSet
Declaration
function ApplyUpdates(TransactionMethod: TUpdateSQLMethod): string;
Description
180 / 449
ASTA 3 for Delphi
ApplyUpdates generates the SQL that has been generated for any edit, insert or delete
activity since the last call to ApplyUpdates. If your server support transactions, you may
call ApplyUpdates(usmServerTransactions). Any error is returned as the function result
but will also raise an exception. It is a function since it is used internally by other ASTA
methods which require the error returned as a string from the server.
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaClientDataSet.CancelRange
TAstaClientDataSet
Declaration
procedure CancelRange;
Description
Call CancelRange to remove a range currently applied to a client dataset. Canceling a
range reenables access to all records in the dataset.
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TAstaClientDataSet.CancelUpdates
TAstaClientDataSet
Declaration
procedure CancelUpdates;
Description
When EditMode is set to anything other than Read Only; any edits, appends or deletes
are recorded in a cache. Calling CancelUpdates rolls back any changes made, and puts
the TAstaClientDataSet back in the same state it was in when it was first opened, or after
ApplyUpdates was called last, and clears the cache. AstaClientDataSets use an internal
OldValuesDataSet to implement this.
Created with the Personal Edition of HelpNDoc: Full-featured EPub generator
TAstaClientDataSet.CleanCloneFromDataSet
TAstaClientDataSet
Declaration
procedure CleanCloneFromDataSet(D: TDataSet);
Description
This method clears the current field definitions and copies the field definitions and data
from the dataset D.
Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor
181 / 449
ASTA 3 for Delphi
TAstaClientDataSet.ClearParameterizedQuery
TAstaClientDataSet
Declaration
procedure ClearParameterizedQuery;
Description
The AstaClientDataSet maintains an internal AstaParamList that contains the
Parameterized Queries created with AddParameterizedQuery. ClearParameterizedQuery
clears this internal list.
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaClientDataSet.CloneCursor
TAstaClientDataSet
Declaration
procedure CloneCursor(Source: TAstaCustomDataSet; KeepFilter: Boolean);
Description
TAstaClientDataSets may be cloned. This is a process where the field definitions are
copied to another TAstaClientDataSet and then linked to each other. Any edits, deletes or
inserts will affect all clone linked datasets. The KeepFilter argument decides whether the
Filter property and the OnFilterRecord event are used by the clone. You can remove all
clone links by calling RemoveCloneLinks or just a specific one by calling UnRegisterClone.
TAstaClientDataSet.CloneFieldsFromDataSet
TAstaClientDataSet
Declaration
procedure CloneFieldsFromDataSet(D: TDataSet; AddData, IncludeBlobs,
CallFirst: Boolean);
Description
This method clears the current field definitions and copies the field definitions from the
SourceDataSet and allows Data to optionallaly be added as well as Blob Data.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaClientDataSet.CloneFieldsFromDataSetPreserveFields
TAstaClientDataSet
Declaration
procedure CloneFieldsFromDataSetPreserveFields(D: TDataSet; AddData,
IncludeBlobs, CallFirst: Boolean);
Description
182 / 449
ASTA 3 for Delphi
Copies a dataset but does not clear out any previously defined fields.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
TAstaClientDataSet.CloseQueryOnServer
TAstaClientDataSet
Declaration
procedure CloseQueryOnServer;
Description
When fetching a result set with the AstaServer running in PersistentSessions mode, this
will close the open cursor on the server.When an AstaClientDataset is destroyed
CloseQueryOnServer is always called if all the rows have not been returned or it has not
been previously called.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaClientDataSet.CompareFields
TAstaClientDataSet
Declaration
function CompareFields(key1, key2: TAstaDBlistItem; AField: TField;
APartialComp, ACaseInsensitive: Boolean): Integer;
Description
Used internally for ASTA index support.
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaClientDataSet.DataTransfer
TAstaClientDataSet
Declaration
procedure DataTransfer(D: TDataSet; IncludeBlobs: Boolean);
Description
This method appends the current dataset with data from D. If blob data is required, then
set IncludeBlobs to True.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TAstaClientDataSet.DeleteNoCache
TAstaClientDataSet
Declaration
procedure DeleteNoCache;
183 / 449
ASTA 3 for Delphi
Description
If EditMode is set to Cached this will delete a record and not post it to the server.
Created with the Personal Edition of HelpNDoc: Free Kindle producer
TAstaClientDataSet.DeltaAsSQL
TAstaClientDataSet
Declaration
function DeltaAsSQL: TStringList;
Description
DeltaAsSQL returns a TStringList that contains the SQL statements that ASTA generates
for any edit, insert or delete activity. You are responsible for freeing the TStringList. This
is used internally by ASTA's SQL generation and it is not something you would normally
need to use.
TAstaClientDataSet.DeltaChanged
TAstaClientDataSet
Declaration
function DeltaChanged: Integer;
Description
Used internally by the TAstaClientDataSet and not normally something that needs to be
used.
If you edit, insert or delete rows in a TAstaClientDataSet, ASTA keeps track of the status
of any changes so that it knows whether or not to generate and post SQL to an ASTA
server.
DeltaChanged returns an integer equivalent to the orginal values of the TDeltaType. If
there is no change then DeltaChange returns -1.
TAstaClientDataSet.EditKey
TAstaClientDataSet
Declaration
procedure EditKey;
Description
Call EditKey to put the client dataset in dsSetKey state while preserving the current
contents of the current search key buffer. To determine current search keys, you can use
the IndexFields property to iterate over the fields used by the current index.
EditKey is especially useful when performing multiple searches where only one or two
field values among many change between each search.
184 / 449
ASTA 3 for Delphi
TAstaClientDataSet.EditRangeEnd
TAstaClientDataSet
Declaration
procedure EditRangeEnd;
Description
Call EditRangeEnd to change the ending value for an existing range. To specify an end
range value, call FieldByName after calling EditRangeEnd. After assigning a new ending
value, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's Project Analyzer
TAstaClientDataSet.EditRangeStart
TAstaClientDataSet
Declaration
procedure EditRangeStart;
Description
Call EditRangeStart to change the starting value for an existing range. To specify a start
range value, call FieldByName after calling EditRangeStart. After assigning a new ending
value, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator
TAstaClientDataSet.Empty
TAstaClientDataSet
Declaration
procedure Empty;
Description
The Empty method deletes all records from the dataset. If the dataset is filtered, then
only those rows that meet the filter condition as defined by the filter property or the
OnFilterRecord event will be deleted.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaClientDataSet.EmptyCache
TAstaClientDataSet
Declaration
procedure EmptyCache;
Description
If EditMode is in Cached this will clear the OldValuesDataSet.
185 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
TAstaClientDataSet.ExecQueryInTransaction
TAstaClientDataSet
Declaration
procedure ExecQueryInTransaction(pQuery: TAstaClientDataSet);
Description
Executes a parameterized query in a transaction using the passed in DataSet.
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaClientDataSet.ExecSQL
TAstaClientDataSet
Declaration
procedure ExecSQL;
Description
This is similar to the TQuery.ExecSQL for use with an SQL statement that does not return
a result set. An exception will be raised if the ExecSQL was not successful. See
ExecSQLWithParams and ExecSQLString if you do not want to change the SQL that you
have used in your select statement.
To execute stored procedures that do not return result sets you can call ExecSQL.
Created with the Personal Edition of HelpNDoc: Easily create EBooks
TAstaClientDataSet.ExecSQLString
TAstaClientDataSet
Declaration
procedure ExecSQLString(S: string);
Description
This is similar to the TQuery.ExecSQL for use with an SQL statement that does not return
a result set. An exception will be raised if the ExecSQLString procedure was not
successful. This allows you to issue some SQL to be executed on the server that doesn't
use the Select SQL or the Params. To use Params and NOT use the Select SQL see
ExecSQLWithParams. If you want to use the SQL in the SQL property use ExecSQL {linkN
==TAstaClientDataSet.ExecSQLString}
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with
HelpNDoc's built-in SEO
TAstaClientDataSet.ExecSQLTransaction
TAstaClientDataSet
Declaration
186 / 449
ASTA 3 for Delphi
procedure ExecSQLTransaction;
Description
Same as ExecSQL but a transaction is started on the server with Commit called if
successful and Rollback if not.
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
TAstaClientDataSet.ExecSQLWithInputParams
TAstaClientDataSet
Declaration
procedure ExecSQLWithInputParams(S: string; P: TAstaParamList);
Description
This allows the execution of ExecSQLwithParams with an AstaParamList that you must supply. Multiple SQL
STatements can also also be executed in transactions without Parameters by calling SendSQLTransaction
or SendSQLStringTransaction. If you need to send multiple Paramerized Queries in one Transaction you
can call AddparamerizedQuery
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
TAstaClientDataSet.ExecSQLWithParams
TAstaClientDataSet
Declaration
procedure ExecSQLWithtParams(S: string);
Description
This allows you to execute insert statements with binary and memo fields. Use this if you
don't want to change the SQL of your select statement.
187 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaClientDataSet.FastFieldDefine
TAstaClientDataSet
Declaration
procedure FastFieldDefine(FieldName: string; FType: TFieldType; Size:
Integer);
Description
A fast way to add a new field to a TAstaClientDataSet. Just supply the field name, type
and size and you new field will be created and added to the dataset.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
TAstaClientDataSet.FetchBlob
TAstaClientDataSet
Declaration
procedure FetchBlob(ATableName, FieldName, WhereString: string);
Description
When you call FetchBlob a TMemoryStream will be returned in the OnReceiveBlobStream
event. Use FetchBlobString to return a blob as a string, directly forcing the
TAstaClientDataSet to wait for the server to respond.
TAstaClientDataSet.FetchBlobString
TAstaClientDataSet
Declaration
function FetchBlobString(ATableName, FieldName, WhereString: string): string;
Description
FetchBlobString returns a string directly from an ASTA server. You can use this for memo
fields or even for binary fields like ftBlob by calling StringToStream or NewStringToStream
from the AstaUtils unit.
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
188 / 449
ASTA 3 for Delphi
TAstaClientDataSet.FieldNameSendBlobToServer
TAstaClientDataSet
Declaration
procedure FieldNameSendBlobToServer(FieldName: string; TMS: TMemoryStream);
Description
Sends a blob to an ASTAServer to be updated. PrimeFields and UpdateTablename must be
defined in order for ASTA to be able to create the SQL Statement.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
TAstaClientDataSet.FilterCount
TAstaClientDataSet
Declaration
function FilterCount: integer;
Description
FilterCount returns the count of all rows that meet the filter condition as defined by the
Filter property and the OnFilterRecord event.
Created with the Personal Edition of HelpNDoc: Don't be left in the past: convert your WinHelp HLP help
files to CHM with HelpNDoc
TAstaClientDataSet.FindKey
TAstaClientDataSet
Declaration
function FindKey(const KeyValues: array of const): Boolean;
Description
Call FindKey to search for a specific record in a dataset. KeyValues contains a comma-
delimited array of field values, called a key. Each value in the key can be a literal, a
variable, a NULL, or nil. If the number of values passed in KeyValues is less than the
number of columns in the index used for the search, the missing values are assumed to
be NULL
If a search is successful, FindKey positions the cursor on the matching record and returns
True. Otherwise the cursor is not moved, and FindKey returns False.
Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced
Customization Options
TAstaClientDataSet.FindNearest
TAstaClientDataSet
Declaration
procedure FindNearest(const KeyValues: array of const);
189 / 449
ASTA 3 for Delphi
Description
Call FindNearest to move the cursor to a specific record in a dataset or to the first record
in the dataset that matches or is greater than the values specified in the KeyValues
parameter. If there are no records that match or exceed the specified criteria,
FindNearest positions the cursor on the last record in the table. The KeyExclusive
property controls whether matching values are considered.
KeyValues contains a comma-delimited array of field values, called a key. If the number
of values passed in KeyValues is less than the number of columns in the index used for
the search, the missing values are assumed to be NULL.
TAstaClientDataSet.FormatFieldforSQL
TAstaClientDataSet
Declaration
function FormatFieldforSQL(DS: TDataSet; FieldName: string): string;
Description
This returns a field formatted for an SQL statement according to the SQL settings in the
TAstaClientSocket. Used internally by ASTA for SQL generation.
Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation:
The Benefits of a Help Authoring Tool
TAstaClientDataSet.GetNextPacket
TAstaClientDataSet
Declaration
function GetNextPacket: Integer;
Description
GetNextPacket attempts to return the next RowsToReturn number of rows, and will return
a integer value representing the number of rows actually returned. If RowsToReturn is set
to 50 and GetNextPacket returns any value less than 50, there are no more rows available
on the server. When a TAstaClientDataSet is closed, or the TAstaClientSocket disconnects,
all open server cursors are destroyed. If you want to explicity close a server cursor you
may call CloseQueryOnServer. After this call, GetNextPacket will always return a zero
value.
ASTA will internally attempt to fetch the next packets on demand even without an explicit
call to GetNextPacket.
PacketFetches
Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily
TAstaClientDataSet.GetNextPacketLocate
TAstaClientDataSet
190 / 449
ASTA 3 for Delphi
Declaration
function GetNextPacketLocate(const KeyFields: string; const KeyValues:
Variant; Options: TLocateOptions): Integer;
Description
GetNextPacketLocate works like the TDataSet.Locate but it will use the query created
from step #1. Depending on your database on the server, this can be a very fast
operation. Using a file server database like DBISAM, locates will use indexes if the SQL
does not include a join. The GetNextPacketLocate will call a TDataSet.Locate on the server
and return RowsToReturn rows, and place the server side cursor on the position where the
locate has positioned it. This can result in very fast fetches on large tables. Your mileage
will vary depending on how the database component used on the server handles this.
Packet Fetches
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaClientDataSet.GetRefetchStatus
TAstaClientDataSet
Declaration
function GetRefetchStatus: TRefetchStatus;
Description
Shows if the dataset is set to return field values after insert statements are executed on
the server in a transaction.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
TAstaClientDataSet.GotoKey
TAstaClientDataSet
Declaration
function GotoKey: Boolean;
Description
Use GotoKey to move to a record specified by key values assigned with previous calls to
SetKey or EditKey and actual search values indicated in the search key buffer.
If GotoKey finds a matching record, it positions the cursor on the record and returns True.
Otherwise the current cursor position remains unchanged, and GotoKey returns False.
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaClientDataSet.GoToNearest
TAstaClientDataSet
Declaration
procedure GotoNearest;
Description
191 / 449
ASTA 3 for Delphi
Call GotoNearest to position the cursor on the record that is either the exact record
specified by the current key values in the key buffer, or on the first record whose values
exceed those specified. If there is no record that matches or exceeds the specified
criteria, GotoNearest positions the cursor on the last record in the dataset.
Note: KeyExclusive determines which records are considered part of a search range.
Before calling GotoNearest, an application must specify key values by calling SetKey or
EditKey to put the dataset is dsSetKey state, and then use FieldByName to populate the
buffer with search values.
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaClientDataSet.LastNamedSort
TAstaClientDataSet
Declaration
function LastNamedSort: string;
Description
This method has been deprecated in Asta 3. See Indexes instead.
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TAstaClientDataSet.LoadFromFile
TAstaClientDataSet
Declaration
procedure LoadFromFile(const FileName: string);
Description
Loads a TAstaClientDataSet from a file. The fields should already have been defined. If
the fields have NOT been defined then use LoadFromFileWithFields.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaClientDataSet.LoadFromFileWithFields
TAstaClientDataSet
Declaration
procedure LoadFromFileWithFields(const FileName: string);
Description
When TAstaClientDataSets are loaded from a file, it is normally expected that the fields
have already been defined. If fields have NOT been defined then use
LoadFromFileWithFields.
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
192 / 449
ASTA 3 for Delphi
TAstaClientDataSet.LoadFromStream
TAstaClientDataSet
Declaration
procedure LoadFromStream(Stream: TStream);
Description
Loads a TAstaClientDataSet from a stream. Assumes that the fields have already been
defined. If the fields have NOT been defined call LoadFromStreamwithFields .
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAstaClientDataSet.LoadFromStreamWithFields
TAstaClientDataSet
Declaration
procedure LoadFromStreamWithFields(Stream: TStream);
Description
Although TAstaClientDataSets are saved with field information, when loading, the fields
are normally thought as to have been already defined with an SQL select statement. Use
LoadFromStreamWithFields if you want the fields to be loaded from the stream.
Created with the Personal Edition of HelpNDoc: Ensure High-Quality Documentation with HelpNDoc's
Hyperlink and Library Item Reports
TAstaClientDataSet.LoadFromString
TAstaClientDataSet
Declaration
procedure LoadFromString(S: string);
Description
This loads just the data from a string into the dataset. The field definitions are not loaded
with this method. The dataset should already contain matching field definitions.
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
TAstaClientDataSet.LoadFromXML
TAstaClientDataSet
Declaration
procedure LoadFromXML(const FileName: string);
Description
Loads a dataset from an XML file supporting ADO or Midas formats.
Created with the Personal Edition of HelpNDoc: Effortlessly Edit and Export Markdown Documents
193 / 449
ASTA 3 for Delphi
TAstaClientDataSet.NukeAllFieldInfo
TAstaClientDataSet
Declaration
procedure NukeAllFieldInfo;
Description
Removes all field definitions from a dataset.
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaClientDataSet.OpenNoFetch
TAstaClientDataSet
Declaration
procedure OpenNoFetch;
Description
OpenNoFetch allows a TAstaClientDataSet to be opened empty without going to the
server. To use this procedure you must have first opened the dataset at design time. This
can be used for disconnected users allowing them to populate and edit a dataset, and
then apply updates to a server at a later time.
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
TAstaClientDataSet.OpenWithBlockingSocket
TAstaClientDataSet
Declaration
procedure OpenWithBlockingSocket(TimeOut: Integer; RaiseException: Boolean);
Description
Since ASTA uses Non-blocking and event driven sockets which require windows
messaging using ASTA Client components in an ISAPI dll has been problematic and we
have supplied AstaWinManagement.pas in order to add a message pump to an ISAPI DLL
but the results have not been consistent. So we have added some calls to allow the ASTA
client socket to be used in blocking mode. To allow the ASTAClientDataSet to be used
under ASTA 2.5 we have added routines to "cache" dataset calls if the
AstaClientSocket.ClientType must be set to ctBlocking.
This means that once the AstaclientSocket is set to block you can call normal
AstaclientDataSet calls and they will be cached until you say
TAstaClientSocket.SendAndBlock(100). Where 100 is a timeout value of how long to wait
(see TWinSocketStream for details on this in the Delphi Help). Any error is returned as
the function result.
194 / 449
ASTA 3 for Delphi
try
AstaclientDataSet1.OpenWithBlockingsocket(500, True);
Response.Content := '</HTML> RecordCount is ' +
IntTostr(AstaClientDataSet1.RecordCount) + ' </HTML>';
except
Response.Content := '<HTML>' + Exception(ExceptObject).Message +
'</HTML>';
end;
Handled := True;
end;
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TAstaClientDataSet.ParamByName
TAstaClientDataSet
Declaration
function ParamByName(ParamName: string): TAstaParamItem;
Description
This is equivalent to calling TAstaParamList.ParamByName.
Created with the Personal Edition of HelpNDoc: Make CHM Help File Creation a Breeze with HelpNDoc
TAstaClientDataSet.ParamQueryCount
TAstaClientDataSet
Declaration
function ParamQueryCount: Integer;
Description
Returns the count of the internal AstaParamList used after calling
AddParameterizedQuery.
195 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaClientDataSet.PopSQLFromParser
TAstaClientDataSet
Declaration
procedure PopSQLFromParser;
Description
Uses the SQL previously sent to the AstaSQLParser.
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaClientDataSet.Prepare
TAstaClientDataSet
Declaration
procedure Prepare;
Description
Used at run time to create parameters on the fly from SQL or stored procedures. ASTA
attempts to internally call prepare on SQL changes or a stored procedure name change.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
TAstaClientDataSet.PrimeFieldsWhereString
TAstaClientDataSet
Declaration
function PrimeFieldsWhereString: string;
Description
This method will return a string that will fetch a unique row from a table.
If a customer table had a unique primary field on a CustNO: Integer column, the
PrimeFieldsWhereString would return a string of 'WHERE Custno = 1000' if the current
row had a CustNo value of 1000.
The primefields must be set first, usually using the EditMode property.
Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle
TAstaClientDataSet.PushSQLToParser
TAstaClientDataSet
Declaration
procedure PushSQLToParser;
Description
Takes the existing SQL and pushes it to an AstaSQLParser.
196 / 449
ASTA 3 for Delphi
TAstaClientDataSet.ReadField
TAstaClientDataSet
Declaration
function ReadField(key: TAstaDBlistItem; AField: TField): Variant;
Description
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
TAstaClientDataSet.RefireSQL
TAstaClientDataSet
Declaration
procedure RefireSQL;
Description
RefireSQL calls DisableControls before it closes and opens the dataset so that there is no
flicker to refetch data from an ASTA Server.
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaClientDataSet.ReFireSQLBookMark
TAstaClientDataSet
Declaration
procedure ReFireSQLBookMark;
Description
Calls RefireSQL and tries to go to the same bookmark which may or may not be valid.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
TAstaClientDataSet.RefreshFromServer
TAstaClientDataSet
Declaration
procedure RefreshFromServer(SelectSQL: string); overload;
procedure RefreshFromServer(SelectSQL, WhereSQL: string); overload;
Description
If Primefields and UpdateTableName have been defined, RefreshFromServer will do a one
row fetch to update the current row. Note: there is a performance cost to this as a Select
statement is actually being performed on the server. ASTA will use the PrimeFields to
buid the SQL where predicate but if you want to customize this even further you can use
197 / 449
ASTA 3 for Delphi
TAstaClientDataSet.RegisterProviderForUpdates
TAstaClientDataSet
Declaration
procedure RegisterProviderForUpdates(Activate: Boolean);
Description
RegisterProviderForUpdates registers an AstaClientDataSet to be notified of any changes
to a remote AstaProvider. By default, an AstaClientDataset will not be notified of any
changes made by itself unless the AstaProvider.BroadCastsToOriginalClient property is set
to True.
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAstaClientDataSet.RemoveSortOrder
TAstaClientDataSet
Declaration
procedure RemoveSortOrder(SortName: string);
Description
This method is now deprecated in Asta 3. Use Indexes instead.
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaClientDataSet.ResetFieldsOnSQLChanges
TAstaClientDataSet
Declaration
property ResetFieldsOnSQLChanges: Boolean;
Description
At design time or run time AstaClientDataSets reset their internal fields list on any
change in SQL. If you are using persistent fields and know that the fields in any changed
SQL will not change, set to this False. The default is True.
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TAstaClientDataSet.RevertRecord
TAstaClientDataSet
198 / 449
ASTA 3 for Delphi
Declaration
procedure RevertRecord;
Description
If you make any change to specific row, and have already posted it, you can call
RevertRecord to undo those changes if the EditMode of the AstaClientDataSet has been
set to umCached. AstaClientDataSets use an internal OldValuesDataSet to implement
this.
Created with the Personal Edition of HelpNDoc: Maximize Your CHM Help File Capabilities with HelpNDoc
TAstaClientDataSet.SaveSuitCaseData
TAstaClientDataSet
Declaration
procedure SaveSuitCaseData;
Description
This is equivalent to calling SaveToFile(SuitCaseData.FileName).
Created with the Personal Edition of HelpNDoc: Transform Your CHM Help File Creation Process with
HelpNDoc
TAstaClientDataSet.SaveToFile
TAstaClientDataSet
Declaration
procedure SaveToFile(const FileName: string);
Description
This saves a dataset to disk along with all field definitions and data.
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaClientDataSet.SaveToStream
TAstaClientDataSet
Declaration
procedure SaveToStream(Stream: TStream);
Description
Saves a TAstaDataSet to a stream, including the field definitions.
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
HTML5 template
TAstaClientDataSet.SaveToString
TAstaClientDataSet
Declaration
199 / 449
ASTA 3 for Delphi
Description
DataSets can be saved to a string and stored in blob fields.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's Project Analyzer
TAstaClientDataSet.SaveToXML
TAstaClientDataSet
Declaration
procedure SaveToXML(const FileName: string; XMLFormat: TAstaXMLDataSetFormat);
overload;
procedure SaveToXML(Stream: TStream; XMLFormat: TAstaXMLDataSetFormat);
overload;
Description
Use SaveToXML to save your dataset to either a file or stream in XML format. Specify an
XMLFormat of taxADO for the XML format used by ADO, or taxMidas for the XML format
used by MIDAS.
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
TAstaClientDataSet.SendBlobToServer
TAstaClientDataSet
Declaration
procedure SendBlobToServer(ATableName, FieldName, WhereString: string;
TMS: TMemoryStream);
Description
This sends a blob to an ASTA server and executes an update statement on the server. A
more simpler approach would be to just create a TAstaClientDataSet and set the
SQLOptions to soFetchBlobs and/or soFetchMemos, set the EditMode property and just
use normal VCL methods to populate the dataset. To send a string to the server as a blob
see SendBlobAsStringToServer.
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
TAstaClientDataSet.SendParameterizedQueries
TAstaClientDataSet
Declaration
function SendParameterizedQueies: TAstaParamList;
Description
Sends the list of Parameterized Queries created with AddParamaterizedQuery and
exececutes it on an ASTA server in a transaction. The returning TAstaParamList will
contain the SQL in the name of the Param and the RowsAffected AsInteger of the Param
if the SQL is successful or the server Exception Message if the SQL was unsuccessful.
200 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
TAstaClientDataSet.SendSQLStringTransaction
TAstaClientDataSet
Declaration
function SendSQLStringTransaction(TransactionName: string; L: array of
String): string;
Description
This sends a const array of Strings of SQL to the server and executes them in a
transaction using the AstaServerSocket.OnTransactionStart call. An exception is raised if
not successful and the string returned contains the exception message. You can also send
multiple parameterized queries in a transaction to the server.
SendSQLTransaction
Created with the Personal Edition of HelpNDoc: Free help authoring environment
TAstaClientDataSet.SendSQLTransaction
TAstaClientDataSet
Declaration
function SendSQLTransaction(TransactionName: string; List: TStrings): string;
Description
This sends a TStrings list of SQL to the server and executes them in a transaction using
the AstaServerSocket.OnTransactionStart call. An exception is raised if not successful and
the string returned contains the exception message. Each item in the List:TStrings must
contain a valid ExecSQL Statement. If you want to send Parameterized Queries use
AddParamterizedQueries.
SendSQLStringTransaction
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
TAstaClientDataSet.SendStringAsBlobToServer
TAstaClientDataSet
Declaration
procedure SendStringAsBlobToServer(ATableName, FieldName, WhereString, S:
string);
Description
This sends a blob to an ASTA server and executes an update statement on the server . A
more simpler approach would be to just create a TAstaClientDataSet and set the
SQLOptions to soFetchBlobs and/or soFetchMemos, set the EditMode property and just
use normal VCL methods to populate the dataset. To send a stream to the server see
SendBlobToServer.
201 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Create Encrypted, Password-Protected PDFs
TAstaClientDataSet.SendStringListToServer
TAstaClientDataSet
Declaration
procedure SendStringListToServer(ATableName, FieldName, WhereString: string;
S: TStrings);
Description
This sends a TStrings to an ASTA Server and executes an update statement on the
server. A more simpler approach would be to just create a TAstaClientDataSet and set the
SQLOptions to soFetchBlobs and/or soFetchMemos, set the EditMode property and just
use normal VCL methods to populate the dataset. To send a stream to the server see
SendBlobToServer. To send a string to the server as a blob see
SendBlobAsStringToServer.
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TAstaClientDataSet.SetEditMode
TAstaClientDataSet
Declaration
procedure SetEditMode(const Primes: array of string; TheUpdateTable: string;
TheUpdateMethod: TAstaUpdateMethod);
Description
The SetEditMode method can be used to enable editing on an AstaClientDataSet at run
time.
uses AstaDBTypes;
Note: AstaClientDataSets can be enabled for edits at design time using the EditMode
property.
Created with the Personal Edition of HelpNDoc: Revolutionize Your CHM Help File Output with HelpNDoc
TAstaClientDataSet.SetKey
TAstaClientDataSet
Declaration
procedure SetKey;
Description
202 / 449
ASTA 3 for Delphi
Call SetKey to put the dataset into dsSetKey state and clear the current contents of the
search key buffer. Use FieldByName to supply the buffer then with a new set of values
prior to conducting a search.
TAstaClientDataSet.SetPrimeKeyFieldsFromProvider
TAstaClientDataSet
Declaration
procedure SetPrimeKeyFieldsFromProvider;
Description
Goes to the server or internal metadata cache and returns the primekey value for
providers. Called internally if ProviderBroadcast.RetrievePrimekeyFields is set to true.
if AstaClientDataSet1.PrimeFields.Count = 0 then
AstaclientDataSet1.SetPrimeKeyFieldsFromProvider;
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
TAstaClientDataSet.SetRange
TAstaClientDataSet
Declaration
procedure SetRange(const StartValues, EndValues: array of const);
Description
Call SetRange to specify a range and apply it to the dataset. The new range replaces the
currently specified range, if any.
StartValues indicates the field values that designate the first record in the range.
EndValues indicates the field values that designate the last record in the range.
After a call to SetRange, the cursor is left on the first record in the range.
203 / 449
ASTA 3 for Delphi
If either StartValues or EndValues has fewer elements than the number of fields in the
current index, then the remaining entries are set to NULL.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaClientDataSet.SetRangeEnd
TAstaClientDataSet
Declaration
procedure SetRangeEnd;
Description
Call SetRangeEnd to put the dataset into dsSetKey state, erase any previous end range
values, and set them to NULL. Subsequent field assignments made with FieldByName
specify the actual set of ending values for a range.
After assigning end-range values, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
TAstaClientDataSet.SetRangeStart
TAstaClientDataSet
Declaration
procedure SetRangeStart;
Description
Call SetRangeStart to put the dataset into dsSetKey state, erase any previous start range
values, and set them to NULL. Subsequent field assignments to FieldByName specify the
actual set of starting values for a range.
After assigning start-range values, call ApplyRange to activate the modified range.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaClientDataSet.SetSQLString
TAstaClientDataSet
Declaration
procedure SetSQLString(S: string);
Description
SetSQLString is a shortcut for setting the SQL property. It encapsulates the following
two calls:
SQL.Clear;
SQL.Add(S);
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease
204 / 449
ASTA 3 for Delphi
TAstaClientDataSet.SetToConnectedMasterDetail
TAstaClientDataSet
Declaration
procedure SetToConnectedMasterDetail(SQLStr: string);
Description
This has the effect of setting up a detail parameterized query to allow a master/detail
relationship to be used with the TAstaClientDataSet. Use this call at run time to toggle
back and forth between a master/detail relationship that fetches the detail data from the
remote server on each row change of the master table or when using filters on the detail
table after fetching the complete detail dataset.
Example
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
TAstaClientDataSet.SetToDisConnectedMasterDetail
TAstaClientDataSet
Declaration
procedure SetToDisconnectedMasterDetail(FullSelectString, DetailLinkField:
string);
Description
This allows a master/detail relationship to be implemented by fetching the complete
detail table and using local filters. Often performance can be improved using this
technique.
Example
with DetailDataSet do
if Button.Tag = 0 then begin
205 / 449
ASTA 3 for Delphi
TAstaClientDataSet.SortDataSetByFieldName
TAstaClientDataSet
Declaration
procedure SortDataSetByFieldName(FieldName: string; Descending: Boolean);
Description
Creates a temporary index on FieldName so that the DataSet appears in the order
defined.
Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation
TAstaClientDataSet.SortDataSetByFieldNames
TAstaClientDataSet
Declaration
procedure SortDataSetByFieldNames(const AFieldNames: array of string; const
ADescending: array of Boolean);
Description
Creates a temporary index so that the DataSet appears in the order defined.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with a Help
Authoring Tool
TAstaClientDataSet.SortOrderSort
TAstaClientDataSet
Declaration
procedure SortOrderSort(SortName: string);
Description
This method has been deprecated in Asta 3. Use Indexes now.
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
206 / 449
ASTA 3 for Delphi
assistant
TAstaClientDataSet.UnRegisterClone
TAstaClientDataSet
Declaration
procedure UnRegisterClone(Source: TAstaCustomDataSet);
Description
Call UnRegisterClone to remove a single cloned dataset's link to a source dataset. Clone
linking is a process where the field definitions are copied to another Asta dataset and
then linked to each other. Any edits, deletes or inserts will affect all clone linked datasets.
To clone a dataset call CloneCursor.
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with
HelpNDoc's built-in SEO
TAstaClientDataSet.UnRegisterProviderForUpdates
TAstaClientDataSet
Declaration
procedure UnRegisterProviderForUpdates;
Description
Unregisters a provider for updates. See also RegisterProviderForUpdates.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Encrypted, Password-Protected PDFs
TAstaClientDataSet.UpdatesPending
TAstaClientDataSet
Declaration
function UpdatesPending:Boolean;
Description
AstaClientDataSets maintain an internal OldValuesDataSet which contains any deleted
rows, newly inserted rows or the original values of any edited rows. A call to
UpdatesPending, while EditMode is set to Cached, will check the OldValuesDataset and
return true if any rows exist.
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaClientDataSet.ValidBookmark
TAstaClientDataSet
Declaration
function ValidBookMark(BM: string): Boolean;
207 / 449
ASTA 3 for Delphi
Description
Determines if a string is a valid dataset bookmark string.
Created with the Personal Edition of HelpNDoc: Converting Word Documents to eBooks: A Step-by-Step
Guide with HelpNDoc
Events
TAstaClientDataSet
AfterRefetchOnInsert
OnAfterBroadcastHandling
OnAfterPopulate
OnBeforeBroadcastHandling
OnCommitAnySuccessError
OnProviderBroadcast
OnProviderBroadcastAfterApplyRow
OnProviderBroadcastAfterDeleteRow
OnProviderBroadCastEditRow
OnReceiveBlobStream
OnReceiveParams
OnStreamEvent
Created with the Personal Edition of HelpNDoc: Effortlessly create a professional-quality documentation
website with HelpNDoc
TAstaClientDataSet.AfterRefetchOnInsert
TAstaClientDataSet
Declaration
property AfterRefetchOnInsert: TNotifyEvent;
208 / 449
ASTA 3 for Delphi
Description
The OnRefetchOnInsert event fires after ASTA has done an insert on the server and any
fields that were configured to be refetched are returned. For instance, if you have a
master/detail set up and have the master table configured to refetch an auto increment
field, you can fetch the auto increment field value as created on the server in the
AfterRefetchOnInsert event and then use this value to append the detail table.
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaClientDataSet.OnAfterBroadcastHandling
TAstaClientDataSet
Declaration
property OnAfterBroadcastHandling: TNotifyEvent;
Description
Called after any incoming Provider Broadcast.
When provider broadcasts are handled internally by ASTA the internal EditMode is set to
umManual so that broadcast changes are not resubmitted to the server. The event above
is called after editMode is set to umManual.
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
TAstaClientDataSet.OnAfterPopulate
TAstaClientDataSet
Declaration
property OnAfterPopulate: TNotifyEvent;
Description
The OnAfterPopulate event handler is called after the AstaClientDataSet has been
populated.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaClientDataSet.OnBeforeBroadcastHandling
TAstaClientDataSet
Declaration
property OnBeforeBroadcastHandling: TNotifyEvent;
Description
Called before any incoming provider broadcast.
When provider broadcasts are handled internally by ASTA the internal EditMode is set to
umManual so that broadcast changes are not resubmitted to the server. The event above
is called before editMode is set to umManual.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
209 / 449
ASTA 3 for Delphi
TAstaClientDataSet.OnCommitAnySucessError
TAstaClientDataSet
Declaration
property OnCommitAnySucessError: TAnyCommitAnySuccessEvent;
Description
Will return the error for any rows that raised an exception on the server when calling
ApplyUpdates(usmCommitAnysuccess).
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TAstaClientDataSet.OnCustomServerAction
TAstaClientDataSet
Declaration
property OnCustomServerAction: TCustomServerActionEvent
Description
Created with the Personal Edition of HelpNDoc: Effortlessly upgrade your WinHelp HLP help files to CHM
with HelpNDoc
TAstaClientDataSet.OnProviderBroadCast
TAstaClientDataSet
Declaration
type TProviderBroadCastEvent = procedure(Sender: TObject; D: TDataSet; var
DisposeOfDataSet: Boolean) of object; property OnProviderBroadCast:
TProviderBroadCastEvent
Description
When AstaClientDataSets are registered to receive broadcasts from providers, they will
receive notification of any insert, delete or update activity from ASTA servers via a
TAstaDataSet arriving in the OnProviderBroadCast event. This DataSet will have two
additional fields. There will be a bookmark field that should be ignored as it will contain
the bookmark of the original client dataset that made the change. It will also contain a
Delta field that represents an integer as an ordinal of a TDeltaType
type TDeltaType = (dtEdit, dtDelete, dtAppend, dtAppendAndDelete);
Example
The incoming D: TDataSet is from the server and has the broadcast info. You can do
anything you want to with the incoming dataset but ASTA will dispose of it if you don't
set DisposeOfDataSet to False.
210 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Import and export Markdown documents
TAstaClientDataSet.OnProviderBroadCastAfterApplyRow
TAstaClientDataSet
Declaration
property OnProviderBroadCastAfterApplyRow: TProviderBroadCastNotifyEvent;
Description
Called after any row has been edited. Edit mode is umManual at this time.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Creation with a Help
Authoring Tool
TAstaClientDataSet.OnProviderBroadCastBeforeApplyRow
TAstaClientDataSet
Declaration
property OnProviderBroadCastBeforeApplyRow:
TProviderBroadCastBeforeApplyRowEvent;
Description
Called before any row has been edited. Edit mode is umManual at this time.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's User-Friendly UI
TAstaClientDataSet.OnProviderBroadCastDeleteEditRow
TAstaClientDataSet
Declaration
property OnProviderBroadCastDeleteEditRow:
TProviderBroadCastDeleteEditRowEvent;
Description
Called after any row has been deleted. Edit mode is umManual at this time.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaClientDataSet.OnProviderBroadcastEditRow
TAstaClientDataSet
Declaration
property OnProviderBroadCastEditRow: TProviderBroadCastEditRowEvent
211 / 449
ASTA 3 for Delphi
Description
When MergeEditRowBroadcasts is set to true this event will be fired before the broadcast
changes are applied to the current edit row.
NOTE: If the user has changed a field but has not posted those changes
(eg focus is still inside the TDBEdit control) then EditChanged will be
false even though the user may have changed the field. If you want to
cater for this case you need to code this event and perhaps take action
based on TForm.ActiveControl.
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework
TAstaClientDataSet.OnReceiveBlobStream
TAstaClientDataSet
Declaration
property OnReceiveBlobStream: TReceiveBlobEvent;
Description
The OnRevceiveBlobStream provides the mechanism to recieve a TMemoryStream when
FetchBlob is called. The more accepted method of fetching a blob is to use
FetchBlobString.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
TAstaClientDataSet.OnReceiveParams
TAstaClientDataSet
Declaration
property OnReceiveParams: TNotifyEvent;
Description
When using StoredProcedures or ServerMethods an Params defined as
212 / 449
ASTA 3 for Delphi
ptOutput,ptInputOutPut and ptResult ParamTypes come back from ASTA servers. They
will arrive in the OnReceiveParams Event.
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAstaClientDataSet.OnStreamEvent
TAstaClientDataSet
Declaration
property OnStreamEvent: TAstaStreamEvent;
Description
Allows for streams to be encrypted/compressed or when SaveToStream and LoadToStream
is called.
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaClientSocket
TAstaClientSocket
Properties : Methods : Events
Unit
AstaClientSocket
Declaration
type TAstaClientSocket = class(TAstaCustomClientSocket);
Description
The ASTA client to the ASTA server. All communcation between client and server is
facilitated by the AstaClientSocket. ASTA supports a sophisticated messaging layer as
well as database calls. In Database terms think of the TAstaClientSocket as a Database
Connection to the Server. AstaClientSocket's are async and event driven so there is no
threading.
The Address and Port properties on the ASTA client must match the Address and Port
properties on the ASTA server. The AstaClientSocket can be used with several protocols:
tcp/ip, http or blocking sockets from withing an ISAPI DLL.
The AstaClientSocket is the component that connects the client to the AstaServer or
middle-tier. It descends from a combination of the VCL's socket objects. The
AstaClientSocket is the client end of the "pipe". All data sent to or from the application
passes through this component. The AstaClientSocket's Address and Port properties need
to match the server's Address and Port properties (the Host and Port properties can be
used if you are using the Domain Naming System [DNS]).
The AstaClientSocket, is also a place where "global" characteristics can be assigned to the
client piece of the application. If you wish to use compression or encryption, for instance,
you would set those at the AstaClientSocket.
See also: Sockets and TCP/IP Issues and a step by step walk though of the Login Process.
See the Developer's Abstract to see how the AstaClientSocket fits into the ASTA
architecture.
213 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
Properties
TAstaClientSocket
Active
Address
AnchorStatus
ApplicationName
ApplicationVersion
AstaServerVersion
AutoLoginDlg
ClientSocketParams
ClientType
Compression
ConnectAction
Connected
ConnectionString
CursorOnQueries
DataSetCount
DataSets
DTPassword
DTUserName
EncryptKeyIn
EncryptKeyOut
Encryption
Host
KeysExchange
Password
Port
ProgressBar
SocksServerAddress
SocksServerPort
SocksUserName
SQLDialect
SQLErrorHandling
SQLOptions
SQLTransactionEnd
SQLTransactionStart
StatusBar
UpdateSQLSyntax
UserName
WebServer
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
TAstaClientSocket.Active
TAstaClientSocket
Declaration
property Active: Boolean;
214 / 449
ASTA 3 for Delphi
Description
When the Active property is set to True, a connection to the Asta server is established. In
order for the connection to complete properly, the Address (or Host) and the Port
properties must point to a running Asta server.
If the ASTA server is running at IP address 208.234.120.25 and at port 9000, then the
AstaClientSocket Address property should be set to 208.230.120.25 and the Port
property should be set to 9000.
Early Connect
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
TAstaClientSocket.Address
TAstaClientSocket
Declaration
property Address: string;
Description
The Address property must be set to the IP address of the Asta server. For instance, if
you are developing on a single machine, you would set the address to 127.0.0.1 (the
local loopback address). If your server is on a second system then you should use the IP
Address of that system.
If you are using DNS (the Domain Naming System), and can address your systems by
name ("MYSERVER.MYCOMPANY.COM"), then you should use the Host property and leave
the Address property blank. If you set the Address and the Host, the Host property will
take precedence.
IMPORTANT: This property must be used in conjunction with the Port property.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaClientSocket.AnchorStatus
TAstaClientSocket
Declaration
property AnchorStatus: TClientAnchorStatus;
Description
Shows the current state of an AstaClientSocket if it uses an Asta Anchor Server.
215 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaClientSocket.ApplicationName
TAstaClientSocket
Declaration
property ApplicationName :string;
Description
Allows you to specify an application name to send to the server. You might wish to use
this property if your ASTA server is serving several different client applications at the
same time.
This property is also used by ASTA's Automatic Client Update feature. It is used in
conjunction with the ApplicationVersion property. This property will be passed to the
TUserRecord.AppName on the server in the Login Process.
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAstaClientSocket.ApplicationVersion
TAstaClientSocket
Declaration
property ApplicationVersion: string;
Description
This ApplicationVersion is used with the ApplicationName property to enable ASTA's
Automatic Client Update feature.
Starting with ASTA v 1.91, if you have distributed 50 copies of an Asta client as version
1.0, you can automatically update them by registering a later Asta client version, say 1.1
or 2.0, at the server. When a user of version 1.0 logins into the server, he or she will be
automatically updated to the latest version of your software.
To enable an automatic update, provide a version number like "1.0" in your initial release.
When you are ready for the next release, increment the ApplicationVersion property to
"1.1" or "2.0" and recompile your program. The resulting executable file should then be
registered at the server. After you have registered the program, any 1.0 client that logs
in will be automatically updated to the version registered at the server. It is critically
important that you remember to increment the ApplicationVersion or no update will
occur.
TAstaClientSocket.AstaServerVersion
TAstaClientSocket
Declaration
property AstaServerVersion: Double;
Description
216 / 449
ASTA 3 for Delphi
TAstaClientSocket.AutoLoginDlg
TAstaClientSocket
Declaration
property AutoLoginDlg: TLoginType;
Description
AutoLoginDlg is the foundation for automating client logins. There are three options:
Value Meaning
ltLoginDlg Displays a user name and password dialog,
must be verified at the server.
ASTA clients by default do not Login to the server. You must set the AutoLoginDlg to
secure your ASTA server. Note: A Login is required to trigger Automatic Client Updates.
Use ltLoginDlg or ltLoginNoDlg for projects that need verification. ltLoginDlg raises a
dialog that prompts for the clients user name and password. The inputs are assigned to
the UserName and Password properties. The values can be checked at the server in the
OnClientAuthenticate event. If the value is acceptable, set the verified parameter to True.
ltLoginNoDlg sends the values assigned the UserName and Password properties and
passes the information to the server. If the user is to be logged into the system, the
OnClientAuthenticate event must set the verified parameter to True.
Use ltNoChallenge when you simply don't want to screen the users at the server. No
verification is required in the OnClientAuthenticate event. The user is automatically
accepted at the server.
Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced
Customization Options
TAstaclientSocket.ClientSocketParams
TAstaClientSocket
Declaration
property ClientSocketParams: TAstaParamList;
Description
The ClientSocketParams is a "scratch" TAstaParamList that you can fill with any kind of
information that will then be transported to the AstaServerSocket and added to the
AstaServerSocket.UserList.GetUserParamList. By using the ClientSocketParams you can
have any kind of additional information available on the AstaServer.
217 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Keep Your Sensitive PDFs Safe with These Easy Security
Measures
TAstaClientSocket.ClientType
TAstaClientSocket
Declaration
property ClientType: TClientType;
type TClientType = (ctNonBlocking, ctBlocking);
Description
In ASTA applications, this property should be set to "ctNonBlocking". See the Delphi help
under TClientSocket for background.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
TAstaClientSocket.Compression
TAstaClientSocket
Declaration
property Compression: TAstaCompression;
Description
This property determines if compression will be employed by your application. It works in
conjunction with the OnCompress and OnDecompress events.
NOTE: This property must have the SAME SETTING on the ServerSocket AND the
ClientSocket.
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaClientSocket.ConnectAction
TAstaClientSocket
Declaration
property ConnectAction: TAstaConnectAction;
Description
Specify the dialog, if any, that the user will see when starting the program and trying to
connect to the ASTA server.
Value Meaning
caFastConnectCombo Select from several servers, allows new
server entry.
218 / 449
ASTA 3 for Delphi
Many developers want to create a custom login screen for their users. A custom login
provides you with the opportunity to present a promotional splash screen or even an
advertising opportunity. If you select the caCustomConnect option of the
AstaClientSocket's ConnectAction property, then you can customize a login screen. If you
select this option, you can display your login screen from within the OnCustomConnect
event handler. In that event handler, you have access to the AstaClientSocket and all of
its properties. You must set the Address and Port properties or the Host and Port
properties. Those properties become your responsibility when implementing a custom
login.procedure.
TForm1.AstaClientSocket1CustomConnect(Sender: TObject);
begin
//CALL YOUR CUSTOM LOGIN SCREEN HERE
//SET USERNAME, PASSWORD, AND OTHER PROPERTIES
// YOU MUST SET THE ADDRESS (OR HOST) AND PORT
AstaClientSocket1.Address := '206.210.19.131';
AstaClientSocket1.Port := 8080;
end;
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaClientSocket.Connected
TAstaClientSocket
Declaration
function Connected: Boolean;
Description
Checks the AnchorStatus property and responds True if equal to tacConnectedToServer.
This should only be used when the AstaAnchorServer is running.
TAstaClientSocket.ConnectionString
TAstaClientSocket
Declaration
function ConnectionString: string;
Description
Returns an English phrase to describe the current status of the socket in relation to an
ASTA server, the Anchor server or a SOCKS server.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
219 / 449
ASTA 3 for Delphi
TAstaClientSocket.CursorOnQueries
TAstaClientSocket
Declaration
property CursorOnQueries: TAstaCursorActivity;
Description
Allows you to display "waiting" cursors while waiting for a result set -- see
AstaClientDataSet.ShowQueryProgress.
Created with the Personal Edition of HelpNDoc: Full-featured Help generator
TAstaClientSocket.DataSetCount
TAstaClientSocket
Declaration
property DataSetCount: Integer;
Description
Whenever AstaClientDataSets communicate with remote ASTA servers they use the
AstaclientSocket and are assigned a unique identifier. Any AstaClientDataSet that has
communciated with an ASTA server can be accessed in the DataSets property. The
number of DataSets is available using the DataSetCount property. In this way, when
Providers or other server side processes need to communicate with the AstaclientDataSet
on the client, there is a path back to them from the server.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
TAstaClientSocket.DataSets
TAstaClientSocket
Declaration
property DataSets[Index: Integer]: TDataSet;
Description
Whenever AstaClientDataSets communicate with remote ASTA servers they use the
AstaClientSocket and are assigned a unique identifier. Any AstaClientDataSet that has
communciated with an ASTA server can be accessed in the DataSets property. The
number of DataSets is available using the DataSetCount property. In this way, when
Providers or other server side processes need to communicate with the AstaClientDataSet
on the client, there is a path back to them from the server.
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
TAstaClientSocket.DTPassword
TAstaClientSocket
Declaration
property DTPassword: string;
220 / 449
ASTA 3 for Delphi
Description
ASTA provides powerful design time features by allowing a developer to access currently
running Asta servers. This access does not require a password, a convenience that allows
you to have easy access to your design time data without having to type in user names
and passwords at every turn. It also opens up a potential security hole. Other ASTA
developers, if they knew the IP address and the port of your AstaServer, would be able to
gain access to your database if they were so inclined. One simple step that you can take
to help avoid this problem is to switch your AstaServers from the default Port of 9000 to
a different number above 1024.
To close the door completely, ASTA provides server-side and client-side properties that
allow you to control who accesses the servers at design time. The AstaClientSocket and
the AstaServerSocket both have DTUserName and DTPassword properties. Those
properties are controlled by the AstaServerSocket's DTAccess property. DTAccess is
defaulted to True. For maximum security, you should set DTAccess to false and then
assign matching UserName and Passwords to the AstaClientSocket and AstaServerSocket
DTUserName and DTPassword properties. If you set DTAccess to False, you must provide
DTUserName and DTPassword values. Null values will not be accepted and the client will
be terminated.
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaClientSocket.DTUserName
TAstaClientSocket
Declaration
property DTUserName: string;
Description
ASTA provides powerful design time features by allowing a developer to access currently
running Asta servers. This access does not require a password, a convenience that allows
you to have easy access to your design time data without having to type in user names
and passwords at every turn. It also opens up a potential security hole. Other ASTA
developers, if they knew the IP address and the port of your ASTA server, would be able
to gain access to your database if they were so inclined. One simple step that you can
take to help avoid this problem is to switch your ASTA servers from the default port of
9000 to a different number above 1024.
To close the door completely, ASTA provides server-side and client-side properties that
allow you to control who accesses the servers at design time. The AstaClientSocket and
the AstaServerSocket both have DTUserName and DTPassword properties. Those
properties are controlled by the AstaServerSocket's DTAccess property. DTAccess is
defaulted to True. For maximum security, you should set DTAccess to false and then
assign matching user name and password to the AstaClientSocket and AstaServerSocket
DTUserName and DTPassword properties. If you set DTAccess to False, you must provide
DTUserName and DTPassword values. Null values will not be accepted and the client will
be terminated.
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
221 / 449
ASTA 3 for Delphi
TAstaClientSocket.Encryption
TAstaClientSocket
Declaration
property Encryption: TEncryption;
TAstaEncryption=(etNoEncryption,etAstaEncrypt,etUserDefined,
etAESEncrypt,etDESEncrypt);
Description
This property determines the encryption, if any, that will be employed by your
application. Used in conjunction with the EncryptKeyIn and EncryptKeyOut property or
OnEncrypt and OnDecrypt events. For strongest encryption AES is used with RSA public
Key exchange.
Value Meaning
aeAstaEncrypt Simple encryption -- set client and server
properties. DES encryption is now
recommended. Kept for backwards
compatibility
NOTE: This property must have the SAME SETTING on the ServerSocket AND the
ClientSocket.
NOTE: This property is used in conjunction with the Client's OnEncrypt and OnDecrypt
events and the Server's corresponding OnEncrypt and OnDecrypt events.
Created with the Personal Edition of HelpNDoc: Easily create EPub books
TAstaClientSocket.EncryptKeyIn
TAstaClientSocket
Declaration
property EncryptKeyIn: String;
Description
Used as the key for DES Encryption or with AES Encryption which optionally has 2 keys.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
222 / 449
ASTA 3 for Delphi
TAstaClientSocket.EncryptKeyOut
TAstaClientSocket
Declaration
property EncryptKeyOut : String;
Description
Used as out key for AES Encryption which optionally has 2 keys.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
TAstaClientSocket.Host
TAstaClientSocket
Declaration
property Host: string;
Description
The Host property accepts the domain name of the ASTA server (see detailed property
desc). The Host or Address property must be set or the ASTA client will not connect. Use
the Host property if you want to use the DNS system and enter addresses like
"My.Company.Com", use the Address property if you wish to set IP addresses, like
"204.200.220.25". Whether you use the Host or the Address property, the value entered
must be the IP address of your target server.
NOTE: The Port property must also be set. If your server is at 204.200.120.2 and the
ASTA server is running at Port 4000 then your client Address should be set to
204.200.120.2 and the Port should be set to 4000. If you set the Host and the Address,
the Host property takes precedence.
See Address
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
TAstaClientSocket.KeepAlivePing
TAstaClientSocket
Declaration
property KeepAlivePing: Integer;
Description
On some dialup accounts uses will be disconnected after some period of inactivity. In the
past, we have recommended that AstaClients call SendCodedMessage every couple of
minutes using a timer. If your client is disconnected from an ASTA server it may be that
the ISP is closing the connection after some period of inactivity. Use the
KeepAlivePing:Integer property to set the number of minutes that the AstaclientSocket
will send a empty string to the server to act as a "keep alive".
223 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaClientSocket.KeysExchange
TAstaClientSocket
TAstaServerSocket
Declaration
property KeysExchange: TAStaKeysExchange
TAstaKeysExchange=(keNoKeysExchange,keRSA);
Description
When set to keRSA RSA public key exchange is performed.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Project Analyzer
TAstaClientSocket.LoginMaxAttempts
TAstaClientSocket
Declaration
property LoginMaxAttempts: Integer;
Description
The number of attempts that a client can attempt to login to a server before the
application terminates.
Login Process
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
TAstaClientSocket.Password
TAstaClientSocket
Declaration
property Password: string;
Description
Specify a password to pass to the server. See AutoLoginDlg property.
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
TAstaClientSocket.Port
TAstaClientSocket
Declaration
property Port: Word;
224 / 449
ASTA 3 for Delphi
Description
The Port property specifies the port that will be used in conjunction with the address or
host property to create a "socket" connection to the AstaServer. A socket is the
combination of an address and port. If your server is running at port 3500 and the
server's address is 204.128.148.2 then you will fill in the ClientSocket Port and Address
properties with those respective values.
Sometimes, in corporate environments, you may have to coordinate with the system
administrator to ensure that TCP/IP traffic can pass through the port number that you
would like to use.
Created with the Personal Edition of HelpNDoc: Generate EPub eBooks with ease
TAstaClientSocket.ProgressBar
TAstaClientSocket
Declaration
property ProgressBar: Boolean;
Description
A progress bar can be used to give visual feedback to socket reads. If you would like the
user to be able to see the progress of a large amount of data being read, turn on the
ProgressBar property and then update your progress bar via the OnReadProgress event
handler.
There is a slight performance penalty when using the OnReadProgress event, use it when
the visual feedback is more important then the response time (it is more useful when
receiving a large amount of data). The feature can be used selectively by toggling the
ProgressBar property True or False.
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
TAstaClientSocket.SocksServerAddress
TAstaClientSocket
Declaration
property SocksServerAddress: string;
Description
Use this property to set the address of the SOCKS server you want to connect to through
your ASTA server.
Created with the Personal Edition of HelpNDoc: Free help authoring tool
TAstaClientSocket.SocksServerPort
TAstaClientSocket
Declaration
property SocksServerPort: Word;
Description
Use this property to set the port of the SOCKS server usually 1080.
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents
225 / 449
ASTA 3 for Delphi
TAstaClientSocket.SocksUserName
TAstaClientSocket
Declaration
property SocksUserName: string;
Description
Use this property to set the user name that will be passed through to the SOCKS server
you want to connect through to your ASTA server.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaClientSocket.SQLDialect
TAstaClientSocket
Declaration
property SQLDialect: TSQLDialect;
type TSQLDialect = (sqlNone, sqlLocalSQL, sqlAccess, sqlMSSQLServer,
sqlOracle, sqlSQLAnywhere, sqlInterbase, sqlDBISAM, sqlCustom);
Description
This will set the SQLOptions to a best fit for the target backend.
ASTA clients and servers can be configured a variety of ways to provide the SQL syntax
used for your database. For a full discussion see SQL Generation.
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites
TAstaClientSocket.SQLErrorHandling
TAstaClientSocket
Declaration
property SQLErrorHandling: TAstaSQLErrorSet;
TAstaSQLErrorSet = set of TAstaSQLErrorType;
TAstaSQLErrorType = (seToStatusBar, seAsExceptions, seNoExceptionOnDisconnect,
seRouteCookieErrorsToLogin, seSocketErrorNoException,
seExceptionsinMessaging);
Description
Although the name is deceptive, as it's roots go back to ASTA 1.0, this property
allows you to customize the way the AstaClientSocket handles errors.
Value Meaning
seToStatusBar Displays the errors in the middle panel of an
AstaStatusBar.
226 / 449
ASTA 3 for Delphi
See the OnSQLError event handler if you are interested in working with the error strings.
Created with the Personal Edition of HelpNDoc: Ensure High-Quality Documentation with HelpNDoc's
Hyperlink and Library Item Reports
TAstaClientSocket.SQLOptions
TAstaClientSocket
Declaration
property SQLOptions: TAstaServerSQLOptions;
Description
The SQLOptions property of the TAstaClientSocket on the client allows for full
customization of the SQL that ASTA generates. The SQLOptions set is automatically filled
if the UpdateSQLSyntax property is changed.
ASTA clients and servers can be configured a variety of ways to provide the SQL syntax
used for your database. For a full discussion see SQL Generation.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaClientSocket.SQLTransactionEnd
TAstaClientSocket
Declaration
property SQLTransactionEnd: string;
Description
Some databases allow transactions to be started and ended using SQL commands. Under
ODBC, you can use Begin Transaction and COMMIT. If your database has these types of
commands and you call AstaClientDataSet.ApplyUpdates(usmUseSQL) then the
SQLTransactionStart and SQLTransactionEnd string properties will be used.
TAstaClientSocket.SQLTransactionStart
TAstaClientSocket
Declaration
property SQLTransactionStart: string;
Description
Some databases allow transactions to be started and ended using SQL commands. Under
227 / 449
ASTA 3 for Delphi
ODBC, you can use Begin Transaction and COMMIT. If your database has these types of
commands and you call AstaClientDataSet. ApplyUpdates(usmUseSQL) then the
SQLTransactionStart and SQLTransactionEnd string properties will be used.
TAstaClientSocket.StatusBar
TAstaClientSocket
Declaration
property StatusBar: TStatusBar;
Description
Allows you to drop an AstaStatusBar component with basic connection status information.
The AstaStatusBar will show SQL error messages when the SQLErrorHandling property is
set to seToStatusBar.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's Project Analyzer
TAstaClientSocket.UpdateSQLSyntax
TAstaClientSocket
Declaration
property UpdateSQLSyntax: TAstaUpdateSQL;
Description
There is no SQL standard for date and time syntax. UpdateSQLSyntax allows you to set
set the way dates and datetime fields are represented in the SQL statments generated by
ASTA.
Value Meaning
usAccess Handles date and time data according to
Access syntax rules.
usBDE Uses the BDE syntax for data and time data.
See SQLGeneration for a full discussion on the SQL that ASTA can generate.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
228 / 449
ASTA 3 for Delphi
TAstaClientSocket.UserName
TAstaClientSocket
Declaration
property UserName: string;
Description
Used to specify a user name to pass to the server. See AutoLoginDlg property.
Created with the Personal Edition of HelpNDoc: Make CHM Help File Creation a Breeze with HelpNDoc
TAstaClientSocket.WebServer
TAstaClientSocket
Declaration
property WebServer: TAstaWebServer;
Description
ASTA supports HTTP clients using the AstaClientSocket. The AstaClientSocket.WebServer
property is a property that allows the configuration and control of HTTP settings. The
AstaClientSocket can optionally use the Microsoft WinInet.dll that comes with Internet
Explorer. WinInet uses any registry settings defined for Internet Explorer which include
any proxy and Socks settings. Setting the WebServer.WinInet property (Boolean) to true
is the recommended way to traverse firewalls with ASTA. If Internet explorer can browse
the Internet, your ASTA WinInet enabled client will be able to communicate with your
remote ASTA server through a web server and Astahttp.dll
Methods
TAstaClientSocket
CloseTheSocket
CommandLinePortCheck
ExpressWayDataSetSelect
FastConnect
FastConnectCombo
FieldIsRegisteredForTrigger
GetCodedParamList
Loaded
OpenTheSocket
RegisterTrigger
RequestUtilityInfo
SendAndBlock
SendAndBlockException
SendBlobMessage
SendChatEvent
SendChatPopup
SendCodedMessage
SendCodedParamList
229 / 449
ASTA 3 for Delphi
SendCodedStream
SendGetCodedParamList
SendDataSetTransactions
SendMasterDetailAutoIncTransaction
SendMasterDetailOrderedTransactions
SendProviderTransactions
SetForIsapiUse
SetForProxyUse
SetupForSocks5Server
SocksConnect
TimerReconnect
UnRegisterTrigger
WaitingForServer
Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily
TAstaClientSocket.AddDataSet
TAstaClientSocket
Declaration
function AddDataSet(D: TDataSet): Integer;
Description
Adds a dataset to the AstaclientSocket.DataSetList and returns a unique identifier.
Normally not called directly.
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
TAstaClientSocket.CloseTheSocket
TAstaClientSocket
Declaration
procedure CloseTheSocket;
Description
This sets the AstaClientSocket.Active to false and does an Application.ProcessMessage
call until it is actually closed.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
TAstaClientSocket.CommandLinePortcheck
TAstaClientSocket
Declaration
procedure CommandLinePortCheck;
Description
CommandLinePortCheck will respond to the following command line switches, none of
which are case sensitive:
Value Meaning
230 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Don't be left in the past: convert your WinHelp HLP help
files to CHM with HelpNDoc
TAstaClientSocket.ExpressWayDataSetSelect
TAstaClientSocket
Declaration
procedure ExpressWayDataSetSelect(const DS: array of TDataSet);
Description
Allows multiple ASTAClientDataSet selects to be returned from an ASTA server in one trip
to the server.
Example
AstaClientSocket1.ExpressWayDataSetSelect([AstaClientDataSet1,
AstaClientDataSet2, AstaClientDataSet3]);
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaClientSocket.FastConnect
TAstaClientSocket
Declaration
procedure FastConnect;
Description
Used by the AstaClientSocket.ConnectionAction property to connect to a design time
address. This is the same as setting the ConnectAction property to caUseDesignAddress.
Created with the Personal Edition of HelpNDoc: Easily convert your WinHelp HLP help files to CHM with
HelpNDoc's step-by-step guide
TAstaClientSocket.FastConnectCombo
TAstaClientSocket
231 / 449
ASTA 3 for Delphi
Declaration
procedure FastConnectCombo;
Description
This brings up a connection dialog box with IP address choices.
Created with the Personal Edition of HelpNDoc: Elevate Your Help Documentation with a Help Authoring
Tool
TAstaClientSocket.FieldIsRegisteredForTrigger
TAstaClientSocket
Declaration
function FieldIsRegisteredForTriggger(TableName, FieldName: string): Boolean;
Description
Returns true if the TableName.FieldName has been previously registered with
RegisterTrigger.
Created with the Personal Edition of HelpNDoc: Produce electronic books easily
TAstaClientSocket.GetCodedParamList
TAstaClientSocket
Declaration
function GetCodedParamList(MsgID: Integer): TAstaParamList;
Description
GetCodedParamList allows you to use SendGetCodedParamList without having to send a
ParamList to the server when you want to just return something from the server.
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaClientSocket.GetDataSet
TAstaClientSocket
Declaration
function GetDataSetID(DSID: Integer): TObject;
Description
Returns the TAstaClientDataSet for any id passed in. Used internally. See DataSetCount
and DataSets.
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
TAstaClientSocket.HostToIPAddress
TAstaClientSocket
Declaration
function HostToIpAddress(const Host: string): string;
232 / 449
ASTA 3 for Delphi
Description
DNS lookup returning ip address when passed in a host string.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TAstaClientSocket.IsBlocking
TAstaClientSocket
Declaration
function IsBlocking: Boolean;
Description
Returns True if the AstaClientSocket is setup for blocking calls.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
TAstaClientSocket.IsHTTP
TAstaClientSocket
Declaration
function IsHTTP: Boolean;
Description
Returns True if the ClientSocket is running over HTTP.
Created with the Personal Edition of HelpNDoc: Bring your WinHelp HLP help files into the present with
HelpNDoc's easy CHM conversion
TAstaClientSocket.IsStateless
TAstaClientSocket
Declaration
function IsStateless: Boolean;
Description
Returns True if the ClientSocket is running stateless (either blocking or HTTP).
TAstaClientSocket.Loaded
TAstaClientSocket
Declaration
procedure Loaded;
Description
The Loaded method triggers the ConnectionAction of the AstaClientSocket
233 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Save time and frustration with HelpNDoc's WinHelp HLP
to CHM conversion feature
TAstaClientSocket.OpenTheSocket
TAstaClientSocket
Declaration
procedure OpenTheSocket;
Description
This sets the AstaClientSocket.Active to true and does an Application.ProcessMessage call
until the socket is actually active.
Early Connect
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TAstaClientSocket.RegisterTrigger
TAstaClientSocket
Declaration
procedure RegisterTrigger(TableName, FieldName: string);
Description
ASTA alllows you to define default values that will be obtained from the server when SQL
transactions are executed on the server from client side ApplyUpdate calls.Use the
AstaClientSocket.RegisterTrigger method to register those Tablename.FieldNames that
require a default value different for each client. These values must be supplied from the
remote client or by the ASTA server so that they are available on the server from the
AstaServerSocket.UserList and fired on the server from the
AstaServerSocket.OnFireTrigger.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaClientSocket.RequestUtilityInfo
TAstaClientSocket
Declaration
procedure RequestUtilityInfo(UtilInfo: TUtilInfoType; ParamString: string);
Description
Information about client EXEs that have been registered on ASTA servers for version
updates can now be obtained from remote clients using the new RequestUtilityInfo call
from the AstaClientSocket. This is an asyncronous request that will bring back a
TAstaDataSet containing information about current client EXEs that have been registered
on an ASTA server for the automatic client update feature.
234 / 449
ASTA 3 for Delphi
astadrv2.pas), but you are then responsible for freeing the dataset.
Example
235 / 449
ASTA 3 for Delphi
TAstaClientSocket.SendAndBlock
TAstaClientSocket
Declaration
function SendAndBlock(TimeOut: Integer): string;
Description
The AstaClientSocket are by non-blocking event driven sockets. There are times however
when you require blocking calls like within Isapi DLL's where is now windows message
pump. In those situations you can use the SendAndBlock method after first setting the
ClientType to ctblocking. This allows you to make any number of AstaclientDataSet calls
and they will be cached until you cal the SendAndBlock method. Any errors will be
returned in the String function result. To open a single AstaClientDataSet with a blocking
call use AstaclientDataSet1.OpenWithBlockingSocket(500,True). ASTA uses tcp/ip by
default but can also run stateless using HTTP to defeat firewalls if necessary.
var
Error: string;
begin
AstaclientSocket1.Clienttype := ctblocking;
AstaClientDataSet1.Open;
AstaclientDataSet2.Open;
Error:=AstaclientSocket1.SendAndBlock(1000);
AstaClientDataSet1.SuitCaseData.Active := True;
AstaclientDataSet2.SuitCaseData.Active := True;
AstaClientDataSet1.Open;
AstaclientDataSet2.Open;
end;
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaClientSocket.SendAndBlockException
TAstaClientSocket
Declaration
procedure SendAndBlockException(TimeOut: Integer);
Description
The AstaClientSocket are by non-blocking event driven sockets. There are times however
when you require blocking calls like within Isapi DLL's where is now windows message
pump. In those situations you can use the SendAndBlockException method after first
setting the ClientType to ctblocking. This allows you to make any number of
AstaclientDataSet calls and they will be cached until you cal the SendAndBlock method.
Any errors will be returned in the String function result. To open a single
236 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaClientSocket.SendBlobMessage
TAstaClientSocket
Declaration
procedure SendBlobMessage(TheClientStream: TMemoryStream);
Description
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
TAstaClientSocket.SendChatEvent
TAstaClientSocket
Declaration
procedure SendChatEvent(S: string);
Description
SendChatEvent broadcasts a message from the sending client to all other clients
connected to the same server, but it is not intrusive.like SendChatPopup. This message
must be intercepted and handled in the OnChatMessage event handler. If you do not
assign the event handler, then the message will NOT be displayed.
This code broadcasts a message from the client to all the other clients.
The following code writes the message to a TMemo component named MChatEvent. When
the message is received at the client, the event is fired and the code below records the
chat message in the memo.
237 / 449
ASTA 3 for Delphi
TAstaClientSocket.SendChatPopup
TAstaClientSocket
Declaration
procedure SendChatPopup(S: string);
Description
This method will broadcast a message from the sending client to all the other clients
connected to the same server. This message is intrusive and it will stop the other clients
from working while the message is displayed in a modal dialog that halts the other
clients' progress. See SendChatEvent for an alternative.
The following code reads the input from a Memo named mChatMessage and broadcasts it
to all the clients (including the sending client) in a popup dialog box.
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAstaClientSocket.SendCodedMessage
TAstaClientSocket
Declaration
procedure SendCodedMessage(ClientSocket: TCustomWinSocket;
MsgID: Integer; Msg: string);
Description
SendCodedMessage allows you to send a message to the server, and then make a custom
response back to the client. The SendCodedMessage method allows you to roll your own
protocol where certain MsgIDs have specific meaning to your application. The ability to
create your own protocol in this fashion is a simple yet powerful technique. See the
Simple Business Objects code below.
The simple code below sends a message to the server, but the message is sent with two
different MsgIDs. The server will handle the message differently depending on which of
the MsgIDs, 1700 or 1750, accompanies the message.
238 / 449
ASTA 3 for Delphi
procedure TForm1.AstaServerSocket1CodedMessage(ClientSocket:
TCustomWinSocket; Sender: TObject; MsgID: Integer; Msg: string);
begin
case MsgID of
1700: AstaServerSocket1.SendCodedMessage(ClientSocket,
MsgID, UpperCase(Msg));
1750: AstaServerSocket1.SendCodedMessage(Clientsocket,
MsgID, LowerCase(Msg));
end;
end;
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaClientSocket.SendCodedParamList
TAstaClientSocket
Declaration
procedure SendCodedParamList(MsgId: Integer; Params:TAstaParamList);
Description
The SendCodedParamList method is one of the more powerful methods in ASTA. It allows
you to send mixed data types easily. For a fuller discussion see ASTA Messaging.
The following example is taken from the CodedParams Tutorial. It shows how to open a
text file and send the file name, file size, the file itself and the current date and time to
the server which then displays it in the ASTA server request memo that normally shows
incoming SQL requests.
239 / 449
ASTA 3 for Delphi
The next bit of code shows how an AstaParamList can be created and packed with any
kind of data including binary data. It uses an AstaParamList call "FastAdd" that adds an
AstaParam, gives it a generic name, and sets the data type according to the type of data
fed to it.
FastAdd('MyString');
FastAdd(45);
Params.Add;
Params[0].AsString := 'My String';
Params.Add;
Params[1].AsInteger := 45;
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
TAstaClientSocket.SendCodedStream
TAstaClientSocket
Declaration
procedure SendCodedStream(MsgID: Integer; MS: TMemoryStream);
Description
The SendCodedStream compliments the SendCodedMessage method. It can be used to
send streams to the server and then the server can respond with a custom action. The
following code demonstrates the usage.
The server responds by loading a memo into a stream and sending it to the client.
240 / 449
ASTA 3 for Delphi
var
MS : TMemoryStream;
begin
case MsgID of
2000: begin
MS := TMemoryStream.Create;
mSelectSend.Lines.SaveToStream(MS);
AstaServerSocket1.SendCodedStream(2000, MS);
MS.Free;
end;
end;
end;
The client receives the stream and displays it in a memo and saves it to a file.
TAstaClientSocket.SendDataSetTransactions
TAstaClientSocket
Declaration
function SendDataSetTransactions(TransactionName: string; const DataSets:
array of TDataSet): string;
Description
This is used in conjunction with CachedUpdates of the TAstaClientDataSet.
SendDataSetTransactions allows you to send an ApplyUpdates command for any number
of TAstaClientDataSets.
Example
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaClientSocket.SendDataSetTransactionsList
TAstaClientSocket
Declaration
function SendDataSetTransactionsList(TransactionName: string; DataSetList:
TList; RaiseException: Boolean): string;
241 / 449
ASTA 3 for Delphi
Description
Allows any number of AstaClientDataSets to be sent to the server in one transaction as a
TList. For client side SQL only. Use SendProviderTransactions for Providers or
ServerMethods. Transaction name is informational only.
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
TAstaClientSocket.SendGetCodeDBParamList
TAstaClientSocket
Declaration
function SendGetCodedDBParamList(MsgId: Integer; Params: TAstaParamList):
TAstaParamList;
Description
ASTA messaging has been used in more and more ways over the years and ASTA 3
introduces a fast and easy way to use ASTA messaging with the new call of
SendGetCodedDBParamList.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaClientSocket.SendGetCodedParamList
TAstaClientSocket
Declaration
function SendGetCodedParamList(MsgId: Integer; Params: TAstaParamList):
TAstaParamList;
Description
The SendGetCodedParamList method is one of the more powerful methods in ASTA. It
allows you to send mixed data types easily. SendGetCodedParamList will wait for the
server to receive and send a reply and a TAstaParamList will be returned which you are
242 / 449
ASTA 3 for Delphi
The following example shows how to open a text file and send the file name, file size, the
file itself and the current date and time to the server which then displays it in the ASTA
server request memo that normally shows incoming SQL requests and returns back a
ParamList. On the server the OnCodedParamList event must be coded. On the server the
OnCodedParamList event must be coded by:
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease
TAstaClientSocket.SendMasterDetailAutoIncTransaction
TAstaClientSocket
Declaration
function SendMasterDetailAutoIncTransaction(const DataSets: array of
TDataSet): string;
Description
This method allows for Master/Detail transactions to be executed where the
MasterDataSet uses an AutoIncrement field that is tagged to be refetched and the
DetailDataSet will use this value as well. This means that in one server round trip a
MasterDataset can insert a row, and the AutoIncrement value created on the server will
be used by the DetailDataSet.
243 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files
TAstaClientSocket.SendMasterDetailOrderedTransactions
TAstaClientSocket
Declaration
function SendMasterDetailOrderedTransactions(TransactionName: string;
MasterDataSet: TDataSet const DetailDataSets: array of TDataSet;
RaiseException: Boolean): string;
Description
In normal MasterDetail support, a new query is done for the detail dataset on each
master change. In order to support fully deletes of detail and master you must use
ASTA's disconnected master detail support so that all detail rows are fetched from the
server.
In order to support the deletion of Master rows as well as detail rows, use
SendMasterDetailOrderedTransactions so that the SQL will be generated in the order of:
TAstaClientSocket.SendNamedUserCodedParamList
TAstaClientSocket
Declaration
procedure SendNamedUserCodedParamList(TheUserName: string; MsgId: Integer;
Params: TAstaParamList);
Description
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's Project Analyzer
TAstaClientSocket.SendProviderTransactions
TAstaClientSocket
Declaration
function SendProviderTransactions(TransactionName: string;
const DataSets: array of TDataSet): string;
244 / 449
ASTA 3 for Delphi
Description
This is used in conjunction with CachedUpdates of the TAstaClientDataSet which are set
using the SQLGenerateLocation of the AstaClientDataSet. the EditMode property is NOT
used with provider Cached Updates. SendProviderTransactions allows you to send an
ApplyUpdates command for any number of TAstaClientDataSets that do NOT use SQL but
use TAstaProviders or TAstaBusinessObjects on the server. The
AstaClientDataSet.ExtraParams and AstaClientSocket.ClientSocketParams will also be
transferred to the server side provider when using SendProviderTransactions.
Example
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
TAstaClientSocket.SendUserNameCodedParamList
TAstaClientSocket
Declaration
function SendUserNameCodedParamList(AUserName: string; MsgID: Integer; Params:
TAstaParamList): TAstaParamList;
Description
Sends a CodedParamList to a named user. See IMA (Instant Messaging API).
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
These Security Measures
TAstaClientSocket.ServerHasResponded
TAstaClientSocket
Declaration
procedure ServerHasResponded(Forceit: Boolean);
Description
Stops AstaSmartWait. This normally does not have to be called manually. When a request
goes to the server ASTA goes into a wait state. When there is an error or exception on the
server the wait must be stopped. ServerHasResponded allows you to programmtically
stop the wait.
Created with the Personal Edition of HelpNDoc: Free help authoring environment
TAstaClientSocket.SetAESKeys
TAstaClientSocket
Declaration
procedure SetAESKeysString(const InKey, OutKey: string);
Description
245 / 449
ASTA 3 for Delphi
AES encryption (currently US and Canada only to source code users) uses 2 keys. This
call sets the InKey and OutKey. Note: the InKey on the server is the outkey to the client.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaClientSocket.SetDESStringKey
TAstaClientSocket
Declaration
procedure SetDESStringKey(const AStringKey: string);
Description
Sets the Key used for DES encryption.
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaClientSocket.SetForIsapiUse
TAstaClientSocket
Declaration
procedure SetForIsapiUse(WebServerAddress, AstaServerAddress, AstaIsapiDll:
string; WebServerPort, AstaServerPort: Word);
Description
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaClientSocket.SetForNormalTCPIP
TAstaClientSocket
Declaration
procedure SetForNormalTcpip(AstaServerAddress: string; AstaServerPort: Word);
Description
Sets the protocol to tcp/ip from HTTP.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TAstaClientSocket.SetForProxyUse
TAstaClientSocket
Declaration
procedure SetForProxyUse(AstaServerAddress, ProxyIPAddress: string;
AstaServerPort, ProxyPort: Word);
Description
246 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's Project Analyzer
TAstaClientSocket.SetupForSocks5Server
TAstaClientSocket
Declaration
procedure SetupForSocks5Server(AstaServerAddress, TheSocks5ServerAddress,
TheSocksUserName, TheSocksPassword: string; AstaServerPort,
TheSocksServerPort: Word);
Description
Sets the client socket up for SOCKS 5 transport. See SOCKS Support.
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad
TAstaClientSocket.SocksConnect
TAstaClientSocket
Declaration
procedure SocksConnect;
Description
Use SocksConnect to connect through a SOCKS server rather than using Active := True;
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's
Advanced Features
TAstaClientSocket.TimerReconnect
TAstaClientSocket
Declaration
procedure TimerReconnect(Delay: Integer)
Description
TimerReconnect uses an internal timer to trigger an Active := True call to reconnect to an
ASTA server. You cannot set the Active property to true within the OnDisconnect event of
the AstaClientSocket as the event must be allowed to complete. Use the TimerReconnect
to trigger a reconnect to the server so that the active will execute after the OnDisconnect
event has terminated. The Delay value is passed to the Timer as the Internal.
TimerReconect is used internally when connecting to an ASTA Anchor Server for Load
Balancing and Fail Over Support.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaClientSocket.UnRegisterTrigger
TAstaClientSocket
Declaration
procedure UnRegisterTrigger(TableName,FieldName:String);
247 / 449
ASTA 3 for Delphi
Description
ASTA alllows you to define default values that will be obtained from the server when SQL
transactions are executed on the server from client side ApplyUpdate calls.Use the
AstaClientSocket.RegisterTrigger method to register those Tablename.FieldNames that
require a default value different for each client. UnRegisterTrigger removes any registered
Tablename.FieldNames previously registered with RegisteredTrigger. To see if a Trigger
exists call FieldIsRegisteredForTrigger.
Created with the Personal Edition of HelpNDoc: Don't be left in the past: convert your WinHelp HLP help
files to CHM with HelpNDoc
TAstaClientSocket.WaitingForServer
TAstaClientSocket
Declaration
function WaitingForServer: Boolean;
Description
By nature, sockets are asyncronous. This means that a request is made and then a
response gets fired to an event. Normal database development depends on a more
procedural mode where you can write sequential lines of code. In order to "simulate" this
procedural model, ASTA clients go into a "wait" state when requests are made from
TAstaClientDataSets. You may check to see if the TAstaClientSocket is in this wait state
by calling the WaitingForServer function.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help
Authoring Tool
TAstaClientSocket.WebServerCheck
TAstaClientSocket
Declaration
procedure WebServerCheck;
Description
Uses settings from AstaClientSocket.WebServer to set for HTTP if applicable.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
TAstaClientSocket.WinINetActive
TAstaClientSocket
Declaration
function WinInetActive: Boolean;
Description
Returns True if the ClientSocket is running HTTP stateless with WinInet. Used internally.
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
248 / 449
ASTA 3 for Delphi
Events
TAstaClientSocket
OnChatMessage
OnCodedMessage
OnCodedParamList
OnCodedStream
OnCompress
OnConnect
OnConnecting
OnConnectStatusChange
OnCustomConnect
OnCustomParamSyntax
OnCustomSQLSyntax
OnDecompress
OnDecrypt
OnDisconnect
OnEncrypt
OnError
OnLoginAttempt
OnLoginParamsAttempt
OnLookup
OnRead
OnReadProgress
OnServerBroadcast
OnServerUtilityInfoEvent
OnSQLError
OnTerminateMessageFromServer
OnWrite
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaClientSocket.OnChatMessage
TAstaClientSocket
Declaration
property OnChatMessage: TAstaClientDataEvent;
Description
Add code to this event handler to when you wish to have your application respond to the
SendChatEvent method.
The following code responds to a chat message by displaying the messag in a TMemo
component named mChatEventLines.
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
249 / 449
ASTA 3 for Delphi
TAstaClientSocket.OnCodedMessage
TAstaClientSocket
Declaration
property OnCodedMessage: TAstaClientCodedDataEvent;
Description
The OnCodedMessage event handler allows you to take customized application action
according to your own custom messages that have been sent via SendCodeMessage
method.
The following code shows how the client socket might respond upon receiving certain
messages.
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaClientSocket.OnCodedParamList
TAstaClientSocket
Declaration
property OnCodedParamList: TCodedParamEvent;
Description
The OnCodedParamList event handles messages sent with the SendCodedParamList
method. Clients and servers have access to the SendCodedParamList method and the
OnCodedParamList event. This event allows you to retrieve the data that was sent. On the
server, the OnCodedParamList event has the client socket passed to it while the client
version of OnCodedParamList implicitly knows the server socket.
Here is the example code that comes with the AstaBDEServer example and the
AstaODBCServer example. It corresponds to the code in the sample document in
SendCodedParamList.
250 / 449
ASTA 3 for Delphi
for I := 0 to Params.Count - 1 do
mRequests.Lines.Add(' Params[' + IntToStr(i) + '] ->' +
Params[i].AsString);
end;
When this code is called it parses each item that was sent and displays it in a memo.
Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor
TAstaClientSocket.OnCodedStream
TAstaClientSocket
Declaration
property OnCodedStream: TCodedStreamEvent;
Description
The OnCodedStream event handler is raised in response to a SendCodedStream message.
In the example below, the client is responding to one of two SendCodedStream messages
sent by the server. If the client receives a stream coded with MsgID 900 it loads the
stream into a bitmap. If the client receives a 2000 in the MsgID it loads the stream into
a memo and it launches the default editor associated with ".txt" extension.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
TAstaClientSocket.OnCompress
TAstaClientSocket
Declaration
property OnCompress: TAstaClientDataStringEvent;
Description
This event handler allows you to add code to compress messages before they are sent
across the network. It should be noted that compression/decompression routines will
have performance considerations. Compressing large messages before they are sent over
slow network connections is sensible. Compressing small messages before transmission
over fast LANs may actually impede performance -- it might take longer to
251 / 449
ASTA 3 for Delphi
compress/decompress the data then it takes for the data to travel across the network.
NOTE: If you add compression routines, you must add decompression routines. You must
place your code in the appropriate even handlers (OnCompress and OnDecompress) of
the AstaClientSocket and the AstaServerSocket.
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TAstaClientSocket.OnConnect
TAstaClientSocket
Declaration
property OnConnect: TSocketNotifyEvent;
Description
See the Delphi help file for TClientSocket OnConnect. If you want to use any messaging
or database methods this is the earliest you can call those methods as the socket needs
to be connected to the server.
Note: You cannot open TAstaAstaClientDataSet in the FormCreate method as the socket
may not be connected at that time!
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
TAstaClientSocket.OnConnecting
TAstaClientSocket
Declaration
property OnConnecting: TSocketNotifyEvent;
Description
Occurs for a client socket after the server socket has been located, but before the
connection is established.
TAstaClientSocket.OnConnectStatusChange
TAstaClientSocket
Declaration
property OnConnectStatusChange: TAstaClientStatechangeEvent;
Description
This event allows you to access the changing states of the client connection. Use this
event to publish the connection state to the user interface if you don't want to use an
AstaStatusBar.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
252 / 449
ASTA 3 for Delphi
TAstaClientSocket.OnCustomConnect
TAstaClientSocket
Declaration
property OnCustomConnect: TCustomConnectEvent;
Description
The OnCustomConnect event handler provides the opportunity for you to provide a
custom login experience for your end users. This property is used in conjunction with the
ConnectAction property.
A custom login provides you with the opportunity to present a promotional splash screen
or even an advertising opportunity. If you select the caCustomConnect option of the
AstaClientSocket's ConnectAction property, then you can customize a login screen. If you
select this option, you can display your login screen from within the
OnCustomConnectevent handler. In that event handler, you have access to the
AstaClientSocket and all of its properties. If you elect to code this event handler, you
must set the Address and Port properties or the Host and Port properties. Those
properties become your responsibility when implementing a custom login.procedure.
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAstaClientSocket.OnCustomParamSyntax
TAstaClientSocket
Declaration
type TSQLCustomParamsEvent = procedure(Sender: TObject;
Item: TAstaParamItem; var TheResult: string; var Handled: Boolean);
Description
OnCustomParamSyntax allows you to customize the way that parameters are formatted
in the Select statement when using parameterized queries. Remember to set the Handled
argument to True when coding this event.
See SQLGeneration for a full discussion of how ASTA generates SQL for insert, update and
253 / 449
ASTA 3 for Delphi
deletes.
Created with the Personal Edition of HelpNDoc: Full-featured Help generator
TAstaClientSocket.OnCustomSQLError
TAstaClientSocket
Declaration
property OnCustomSQLError:
Description
Used in blocking socket support to trap error messages from a remote server.
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with
HelpNDoc's built-in SEO
TAstaClientSocket.OnCustomSQLSyntax
TAstaClientSocket
Declaration
type TSQLCustomFormatEvent = procedure(Sender: TObject; DS: TDataSet;
FieldName: string; var TheResult: string; var Handled: Boolean) of object;
property OnCustomSQLSyntax: TSQLCustomFormatEvent;
Description
This event allows you to format any field to your specifications. Note that you MUST set
the Handled argument to True if you are overriding the default format that ASTA uses. It
is up to you to format the argument TheResult to your specifications.
TAstaClientSocket.OnDecompress
TAstaClientSocket
Declaration
property OnDecompress: TAstaClientDataStringEvent;
Description
This event handler allows you to add code to decompress messages after they have been
sent, in an encrypted form, across the network. It should be noted that
254 / 449
ASTA 3 for Delphi
TAstaClientSocket.OnDecrypt
TAstaClientSocket
Declaration
property OnDecrypt: TAstaClientDataStringEvent;
Description
The OnDecrypt event handler allows you to add code for decrypting an encrypted
message.
Note: If you add encryption routines to the OnEncrypt event handlers, then you must
add decryption routines to the OnDecrypt event handlers. You must place your code in
the appropriate even handlers (OnEncrypt and OnDecrypt) of the AstaClientSocket and
the AstaServerSocket.
TAstaClientSocket.OnDisconnect
TAstaClientSocket
Declaration
property OnDisconnect: TSocketNotifyEvent;
Description
Occurs just before a client socket closes the connection to a server socket. See the Delphi
help file for TClientSocket OnDisconnect.
Note:You cannot set the AstaClientSocket.Active to true in the OnDisconnect even but
you must use a timer so that the setting of the Active property occurs after the event has
fired. Use the TimerReconnect method from within the OnDisconnect event if you want to
trigger a reconnect.
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
255 / 449
ASTA 3 for Delphi
TAstaClientSocket.OnEncrypt
TAstaClientSocket
Declaration
property OnEncrypt: TAstaClientDataStringEvent;
Description
The OnEncrypt event handler allows you to add code for encrypting a message before
transmitting it across a network.
Note: If you add encryption routines to the OnEncrypt event handlers, then you must add
decryption routines to the OnDecrypt event handlers. You must place your code in the
appropriate even handlers (OnEncrypt and OnDecrypt) of the AstaClientSocket and the
AstaServerSocket.
TAstaClientSocket.OnError
TAstaClientSocket
Declaration
property OnError: TSocketErrorEvent;
Description
This event allows you to trap for TCP errors occuring in your application. See the Delphi
help file for TClientSocket OnErrorEvent.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaClientSocket.OnLoginAttempt
TAstaClientSocket
Declaration
property OnLoginAttempt: TAstaLoginEvent;
type TAstaLoginEvent = procedure(Sender: TObject; ClientVerified: Boolean) of
object;
Description
Note: This event is decprecated in ASTA 3 but is kept in for backwards compatibility with
ASTA 2.6. It is recommended that you use the OnLoginParamsAttempt Event
The OnLoginAttempt is used to control the login process at the client side of the
connection. The event allows you control how many times the user is allowed to enter a
user name and password combination. This is a good place to perform initialization as
well.
The login process is controlled by a number of server and client side properties and
events. The TAstaServerSocket has an OnClientAuthenticate event that controls whether
256 / 449
ASTA 3 for Delphi
TAstaClientSocket.OnLoginParamsAttempt
TAstaClientSocket
Declaration
property OnLoginParamsAttempt: TAstaLoginParamsEvent;
TAstaLoginParamsEvent = procedure(Sender: TObject; ClientVerified: Boolean;
ServerParams:TAstaParamList) of object;
Description
The OnLoginParamsAttempt is used to receive Authentication information as part of the
login process at the client side of the connection. If the client has been Authenticated
then the ClientVerified will be True and the ServerParms will contain any params added to
the ClientParams presented on the server in the TAstaServerSocket.OnClientAuthenticate
Event.
This event is the point that your application can really be launched as it represents the earliest that a client
can safely communicate with a remote server. To insure that a client cannot fetch data from a remote
server before proper authentication set the TAstaServerSocket.SecureServer to true. To control the number
of times a user can attempt a login to the server use the TAstaclientSocket.LoginMaxAttempts
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaClientSocket.OnLookup
TAstaClientSocket
Declaration
property OnLookup: TSocketNotifyEvent;
Description
Occurs when a client socket is about to look up the server socket with which it wants to
connect. See the Delphi help file entry for TClientSocket.OnLookup event.
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
257 / 449
ASTA 3 for Delphi
TAstaClientSocket.OnRead
TAstaClientSocket
Declaration
property OnRead: TSocketNotifyEvent;
Description
Occurs when a client socket should read information from the socket connection. See the
Delphi help file entry for TAstaClientSocket.OnRead event.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
TAstaClientSocket.OnReadProgress
TAstaClientSocket
Declaration
property OnReadProgress: TAstaSmartReadEvent;
Description
The OnReadProgress event handler allows you to assign values to a ProgressBar. Use it in
conjunction with the ProgressBar property in order to provide the user with visual
feedback on large data reads.
There is a slight performance penalty when using the OnReadProgress event, use it when
the visual feedback is more important then the response time (it is more useful when
receiving a large amount of data). The feature can be used selectively by toggling the
ProgressBar property True or False.
TAstaClientSocket.OnReceiveFieldDefs
TAstaClientSocket
Declaration
property OnReceiveFieldDefs: TAstaClientDataStringEvent;
Description
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaClientSocket.OnReceiveResultSet
TAstaClientSocket
258 / 449
ASTA 3 for Delphi
Declaration
property OnReceiveResultSet: TAstaClientDataStringEvent;
Description
Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy
TAstaClientSocket.OnServerBroadcast
TAstaClientSocket
Declaration
property OnServerBroadcast: TAstaClientDataEvent;
Description
This event handler is raised when a message is sent from the server's SendBroadCast
method. The server's SendBroadCastPopUp method displays client messages in a dialog.
The SendBroadcast method allows you to choose how you would like to display the
message.
When an OnServerBroadcase event is raised, the following code activates a specific page
from a PageControl object and displays the message in a Memo field.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaClientSocket.OnServerUtilityInfoEvent
TAstaClientSocket
Declaration
property OnServerUtilityInfoEvent: TCodedParamEvent;
Description
This event receives a TAstaParamList after a request to RequestUtilityInfo
The following is an example of how to receive requests from an ASTA server in the
OnServerUtilityInfoEvent.
259 / 449
ASTA 3 for Delphi
TAstaClientSocket, Params[3].AsString);
end;
end;
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaClientSocket.OnSQLError
TAstaClientSocket
Declaration
property OnSQLError: TAstaClientDataEvent;
Description
The OnSQLError event handler provides you with access to the SQL Error returned from
the database. The SQLErrorHandling property can be set to show the error as an
exception or to the status bar, but in some environments it might be useful to write those
errors to a log file or perhaps send them to an administrative application.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Creation with a Help
Authoring Tool
TAstaClientSocket.OnTerminateMessageFromServer
TAstaClientSocket
Declaration
property OnTerminateMessageFromServer: TAstaClientTerminatedEvent;
type TAstaClientTerminatedEvent = procedure (Sender: TObject; MsgFromServer:
string var Handled: Boolean) of object;
Description
When a kill message is sent from an AstaServer the client application will terminate
unless the OnTerminateMessageFromServer is coded and the var Handled:Boolean is set
to true signifying that the event has been handled. For more secure servers don't send
KillMessages but disconnect the remote client.
NOTE: the OnDisconnect event needs to be coded so that an exception is not raised.
Security Issues
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
TAstaClientSocket.OnWrite
TAstaClientSocket
Declaration
property OnWrite: TSocketNotifyEvent;
Description
Occurs when a client socket should write information to the socket connection. See the
Delphi help file entry for TAstaClientSocket.OnWrite event.
260 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
TAsta2AuditDataSet
TAsta2AuditDataSet
Properties : Methods
Unit
AstaDrv2
Declaration
type TAsta2AuditDataset = class(TAsta2CustomAuditDataSet)
Description
The Asta2AuditDataSet is an In memory dataset that can "track" changes allowing
CancelUpdates and RevertRecord to be supported. It uses an internal AstaDataSet as the
OldValuesDataSet so that any updates, inserts or deletes can be "tracked" or audited.
It is this dataset that TAstaClientDataSet inherits from. The Asta2AuditDataSet does not
connect to a remote ASTA Server.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
Properties
TAsta2AuditDataSet
OldValuesDataSet
StreamOldValuesDataSet
UpdateMethod
261 / 449
ASTA 3 for Delphi
DataSource
DefaultFields
Designer
Eof
FieldCount
FieldDefList
FieldDefs
FieldList
Fields
FieldValues
Filter
Filtered
FilterOptions
Found
Modified
ObjectView
RecordCount
RecNo
RecordSize
SparseArrays
State
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAsta2AuditDataSet.OldValuesDataSet
TAsta2AuditDataSet
Declaration
property OldValuesDataSet: TAstaDataSet;
Description
TAsta2AuditDataSet maintain an internal FOldValuesDataSet which contains any deleted
rows, newly inserted rows or the original values of any edited rows. This
OldValuesDataSet allows support of CancelUpdates, RevertRecord and UpdatesPending.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TAsta2AuditDataSet.StreamOldValuesDataSet
TAsta2AuditDataSet
Declaration
property StreamOldValuesDataset: Boolean;
Description
Set StreamOldValuesDataSet to True if you want to save the OldValuesDataSet used to
track deltas or changes to a dataset.
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
262 / 449
ASTA 3 for Delphi
TAsta2AuditDataSet.UpdateMethod
TAsta2AuditDataSet
Declaration
property UpdateMethod: TAstaUpdateMethod;
Description
Determines when SQL is posted to the server. umAfterPost will fire after a record is
posted. umCached requires the ApplyUpdates method to be called.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
Methods
TAsta2AuditDataSet
CancelUpdates
EmptyCache
RevertRecord
TrackDeltas
UpdatesPending
263 / 449
ASTA 3 for Delphi
LoadFromString
NukeAllFieldInfo
RemoveSortOrder
SaveToFile
SaveToStream
SaveToString
SetKey
SetRange
SetRangeEnd
SetRangeStart
SortOrderSort
UnRegisterClone
ValidBookmark
264 / 449
ASTA 3 for Delphi
Prior
Refresh
Resync
SetFields
Translate
UpdateCursorPos
UpdateRecord
UpdateStatus
Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor
TAsta2AuditDataSet.CancelUpdates
TAsta2AuditDataSet
Declaration
procedure CancelUpdates;
Description
When EditMode is set to anything other than Read Only; any edits, appends or deletes
are recorded in a cache. Calling CancelUpdates rolls back any changes made, and puts
the dataset back in the same state it was in when it was first opened, or after
ApplyUpdates was called last, and clears the cache.
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAsta2AuditDataSet.EmptyCache
TAsta2AuditDataSet
Declaration
procedure EmptyCache;
Description
If EditMode is in Cached this will clear the OldValuesDataSet.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
TAsta2AuditDataSet.RevertRecord
TAsta2AuditDataSet
Declaration
function RevertRecord: Boolean;
Description
If you make any change to specific row, and have already posted it, you can call
RevertRecord to undo those changes if the UpdateMethod of the dataset has been set to
umCached.
Created with the Personal Edition of HelpNDoc: Free EPub producer
265 / 449
ASTA 3 for Delphi
TAsta2AuditDataSet.UpdatesPending
TAsta2AuditDataSet
Declaration
function UpdatesPending: Boolean;
Description
Asta datasets maintain an internal OldValuesDataSet which contains any deleted rows,
newly inserted rows or the original values of any edited rows. A call to UpdatesPending,
while UpdateMethod is set to Cached, will check the OldValuesDataset and return True if
any rows exist.
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
Events
TAsta2AuditDataSet
TAstaCloneDataSet
TAstaCloneDataSet
Properties : Methods : Events
Unit
AstaCloneDataSet
Declaration
266 / 449
ASTA 3 for Delphi
Description
The TAstaCloneDataset allows for Fields and Data of any TDataSet to be "cloned" or
copied at design time or runtime.
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Process with HelpNDoc's
Project Analyzer
Properties
TAstaCloneDataSet
AddData
CallFirst
CloneDataSource
CloneIt
FieldsToSkip
267 / 449
ASTA 3 for Delphi
Filtered
FilterOptions
Found
Modified
ObjectView
RecordCount
RecNo
RecordSize
SparseArrays
State
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
TAstaCloneDataSet.AddData
TAstaCloneDataSet
Declaration
property AddData: Boolean;
Description
Set AddData to True if you want to bring over data in addition to fields.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
TAstaCloneDataSet.CallFirst
TAstaCloneDataSet
Declaration
property CallFirst: Boolean;
Description
When callFirst is true, the DataSet connected to the CloneDatasource will call First
otherwise any data copying will start at the current row.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaCloneDataSet.CloneDataSource
TAstaCloneDataSet
Declaration
property CloneDataSource: TDataSet;
Description
The CloneDataSource should be set to the TDataSet that you want to copy.
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
268 / 449
ASTA 3 for Delphi
TAstaCloneDataSet.CloneIt
TAstaCloneDataSet
Declaration
property CloneIt: Boolean;
Description
Set to true when you want to exectute the cloning action. Internally the CloneIt property
calls the TAstaDataSet overloaded CleanCloneFromDataSetPrimative method.
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaCloneDataSet.FieldsToSkip
TAstaCloneDataSet
Declaration
property FieldsToSkip: TStrings;
Description
Add the fields you want to skip to the FieldsToSkip:Tstrings and those fields will not be
cloned
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
Methods
TAstaCloneDataSet
269 / 449
ASTA 3 for Delphi
FilterCount
FindKey
FindNearest
GetRecordSize
GotoKey
GotoNearest
IsBlobField
LastNamedSort
LoadFromFile
LoadFromFileWithFields
LoadFromStream
LoadFromStreamwithFields
LoadFromString
NukeAllFieldInfo
RemoveSortOrder
SaveToFile
SaveToStream
SaveToString
SetKey
SetRange
SetRangeEnd
SetRangeStart
SortOrderSort
UnRegisterClone
ValidBookmark
270 / 449
ASTA 3 for Delphi
Insert
InsertRecord
IsEmpty
IsLinkedTo
IsSequenced
Last
Locate
Lookup
MoveBy
Next
Open
Post
Prior
Refresh
Resync
SetFields
Translate
UpdateCursorPos
UpdateRecord
UpdateStatus
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Process with HelpNDoc's
Project Analyzer
Events
TAstaCloneDataSet
271 / 449
ASTA 3 for Delphi
TAstaNestedDataSet
TAstaNestedDataSet
Properties : Methods : Events
Unit
AstaDrv2
Declaration
type TAstaNestedDataSet = class(TAsta2AuditDataSet)
Description
Use TAstaNestedDataSet to access data contained in a nested dataset. A nested dataset
provides much of the functionality of a TAstaClientTable component, except that the data
it accesses is stored in a nested table.
Set the DataSetField property to point to the persistent TField that represents the nested
dataset to encapsulate.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
Properties
TAstaNestedDataSet
ContentDefined
ParentDataSet
PrimeFields
UpdateTableName
272 / 449
ASTA 3 for Delphi
CanModify
Constraints
DataSetField
DataSource
DefaultFields
Designer
Eof
FieldCount
FieldDefList
FieldDefs
FieldList
Fields
FieldValues
Filter
Filtered
FilterOptions
Found
Modified
ObjectView
RecordCount
RecNo
RecordSize
SparseArrays
State
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaNestedDataSet.ContentDefined
TAstaNestedDataSet
Declaration
property ContentDefined: Boolean;
Description
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
TAstaNestedDataSet.ParentDataSet
TAstaNestedDataSet
Declaration
property ParentDataSet: TAstaCustomDataset;
Description
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaNestedDataSet.PrimeFields
TAstaNestedDataSet
273 / 449
ASTA 3 for Delphi
Declaration
property PrimeFields: TStrings;
Description
The PrimeFields property is used to provide information on the fields needed to fetch a
row using a unique value. In order to have ASTA generate SQL automatically on edits,
inserts and deletes, the PrimeFields must be defined. This is used by setting the
UpdateMethod property to define auto SQL generation.
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
TAstaNestedDataSet.UpdateTableName
TAstaNestedDataSet
Declaration
property UpdateTableName: string;
Description
In order for ASTA to generate SQL for update, insert and delete statements, the
UpdateTableName property must be set to the table that SQL updates should be applied
to.
Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy
Methods
TAstaNestedDataSet
274 / 449
ASTA 3 for Delphi
GotoKey
GotoNearest
IsBlobField
LastNamedSort
LoadFromFile
LoadFromFileWithFields
LoadFromStream
LoadFromStreamwithFields
LoadFromString
NukeAllFieldInfo
RemoveSortOrder
SaveToFile
SaveToStream
SaveToString
SetKey
SetRange
SetRangeEnd
SetRangeStart
SortOrderSort
UnRegisterClone
ValidBookmark
275 / 449
ASTA 3 for Delphi
IsSequenced
Last
Locate
Lookup
MoveBy
Next
Open
Post
Prior
Refresh
Resync
SetFields
Translate
UpdateCursorPos
UpdateRecord
UpdateStatus
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
Events
TAstaNestedDataSet
276 / 449
ASTA 3 for Delphi
TAstaUpdateSQL
TAstaUpdateSQL
Properties : Methods : Events
Unit
AstaUpdateSQL
Declaration
TAstaUpdateSQL = class(TComponent);
Description
Allows for the SQL that ASTA generatates to be supplemented.
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
Properties
TAstaUpdateSQL
DeleteSQL
InsertSQL
ModifySQL
Params
Created with the Personal Edition of HelpNDoc: Converting Word Documents to eBooks: A Step-by-Step
Guide with HelpNDoc
TAstaUpdateSQL.DeleteSQL
TAstaUpdateSQL
Declaration
property DeleteSQL: TStrings;
Description
Set DeleteSQL to the SQL DELETE statement to use when applying a deletion to a record.
Statements can be parameterized queries. To create a DELETE statement at design time,
use the UpdateSQL editor to create statements, such as:
At run time, an application can write a statement directly to this property to set or
change the DELETE statement.
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TAstaUpdateSQL.InsertSQL
TAstaUpdateSQL
277 / 449
ASTA 3 for Delphi
Declaration
property InsertSQL: TStrings;
Description
Set InsertSQL to the SQL INSERT statement to use when applying an insertion to a
dataset. Statements can be parameterized queries. To create a INSERT statement at
design time, use the UpdateSQL editor to create statements, such as:
(country, currency)
At run time, an application can write a statement directly to this property to set or
change the INSERT statement.
Created with the Personal Edition of HelpNDoc: Leave the tedious WinHelp HLP to CHM conversion
process behind with HelpNDoc
TAstaUpdateSQL.ModifySQL
TAstaUpdateSQL
Declaration
property ModifySQL: TStrings;
Description
Set ModifySQL to the SQL UPDATE statement to use when applying an updated record to
a dataset. Statements can be parameterized queries. To create a UPDATE statement at
design time, use the UpdateSQL editor to create statements, such as:
UPDATE "country"
At run time, an application can write a statement directly to this property to set or
change the UPDATE statement.
TAstaUpdateSQL.Params
TAstaUpdateSQL
Declaration
property Params: TAstaParamList;
Description
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
278 / 449
ASTA 3 for Delphi
Passwords
Methods
TAstaUpdateSQL
GetSQL
ParseParams
Created with the Personal Edition of HelpNDoc: Maximize Your CHM Help File Capabilities with HelpNDoc
TAstaUpdateSQL.GetSQL
TAstaUpdateSQL
Declaration
function GetSQL(UpdateKind: TDeltaType): TStrings;
Description
GetSQL is used to obtain the SQL statement for a specific type of update. GetSQL returns
the SQL statement in the ModifySQL, InsertSQL, or DeleteSQL property, depending on the
setting of the UpdateKind index.
Value Meaning
dtEdit Return the query text used to execute
UPDATE statements (ModifySQL)
Created with the Personal Edition of HelpNDoc: Revolutionize Your CHM Help File Output with HelpNDoc
TAstaUpdateSQL.ParseParams
TAstaUpdateSQL
Declaration
procedure ParseParams(TheParseSQL: string);
Description
Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents
279 / 449
ASTA 3 for Delphi
Events
TAstaUpdateSQL
AfterSQLBatchInsert
AfterSQLItemInsert
BeforeSQLBatchInsert
BeforeSQLItemInsert
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAstaUpdateSQL.AfterSQLBatchInsert
TAstaUpdateSQL
Declaration
property AfterSQLBatchInsert: TAfterSQLBatchInsertEvent;
Description
After all SQL statements are generated, the application can insert extra SQL statements
to send to the server. Only used for cached updates.
AddSQL contains the SQL statement to add to the list of SQL statements.
AddParams can be used to extend the AddSQL statement. Do NOT dispose AddParams.
Created with the Personal Edition of HelpNDoc: Free help authoring environment
TAstaUpdateSQL.AfterSQLItemInsert
TAstaUpdateSQL
Declaration
property AfterSQLItemInsert: TAfterSQLItemInsertEvent;
Description
After every SQL item is generated, the application can insert an extra SQL statement to
send to the server.
280 / 449
ASTA 3 for Delphi
TAstaUpdateSQL.BeforeSQLBatchInsert
TAstaUpdateSQL
Declaration
property BeforeSQLBatchInsert: TBeforeSQLBatchInsertEvent;
Description
Before the SQL statement generatuion starts, the application can insert extra SQL
statements to send to the server. Only used for cached updates.
AddSQL contains the SQL statement to add to the list of SQL statements.
AddParams can be used to extend the AddSQL statement. Do NOT dispose AddParams.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's Efficient
User Interface
TAstaUpdateSQL.BeforeSQLItemInsert
TAstaUpdateSQL
Declaration
property BeforeSQLItemInsert: TBeforeSQLItemInsertEvent;
Description
Before each SQL item is generated, the application can insert an extra SQL statement to
send to the server.
SQL contains the newly created SQL statement. SQL can be modified.
Params contain the newly created params. Params can be modified.
DeltaType contains the type of SQL generated.
AddSQL contains the SQL statement to add to the list of SQL statements.
AddParams can be used to extend the AddSQL statement. Do NOT dispose AddParams.
BeforeSQLItemInsert enables the application to modify the SQL statement and/or params
which will be send to the server.
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
TAstaStatusBar
TAstaStatusBar
Unit
AstaStatusBar
Declaration
type TASTAStatusBar = class(TStatusBar)
281 / 449
ASTA 3 for Delphi
Description
TAstaStatusBar is a descendent of Delphi's TStatusBar used to display connection status
between your Asta client and server. To use it, place one on your form and make sure
that the StatusBar property of your TAstaClientSocket points to this new component.
By default the TAstaStatusBar contains 3 panels, the first of which will show the Asta
connection status messages and the third displays the text "Asta Technology Group".
These panels can be modified at design time or run time by accessing the Panels
property.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
Like many ASTA features, this one is a tandem implementation, you must coordinate
actions on the server and the client sides or the feature will not operate properly.
To set up a server, you must drop a TAstaServerDirectory object onto the server
application. Then you must assign the object to the AstaServerSocket.DirectoryPublisher
property. Once that property is assigned, you can call the
AstaServerSocket.PubishServerDirectories method.
282 / 449
ASTA 3 for Delphi
Server Side
TAstaServerSocket
TAstaProvider
TAstaBusinessObjectsManager
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAsta2MetaData
TAsta2MetaData
Properties : Methods : Events
Unit
Asta2MetaData
Declaration
type TAsta2MetaData = class(TComponent);
Description
Because Asta supports so many different 3rd party database components, many of the
Asta servers have been coded to return different field names for the metadata. For
example, one server returns FieldSize and another server returns Size. If a client
application makes use of the field names returned by the metadata events, it is very
difficult to use that same client against different Asta servers.
The Asta2Metadata component standardizes the field names returned for all metadata
events. The component also ensures that even if a server does not implement certain
metadata calls, it always returns a valid dataset. In the case where the server does not
implement a certain metadata call, the dataset will be empty. But at least the client
application will not fail because it can not find any metadata fields.
283 / 449
ASTA 3 for Delphi
OwnerName ftString 30
Description ftString 30
If any other fields or more fields are required, they can be added in the individual events.
The idea of this component is that it gives you a dataset in the event code, that already
contains the dataset fields. All you have to do is to populate it with your data values.
Usage:
try
AstaServerSocket1.MetaDataSet:=AstaMetaData.GetMetaData(Sender,ClientSocket,
MetaRequest, DatabaseStr, Arg1);
except
LogException(ClientSocket, 'Stored MetaData Error: ' +
EDataBaseError(ExceptObject).Message, True);
end;
Each event must be individually coded. Below are some examples from the IBX server:
/* The FibInfo dataset below is an Asta component that just returns the metadata values.
This event populates the MetaDataSet dataset, which will be returned to the client
application */
284 / 449
ASTA 3 for Delphi
MetaDataSet.AppendRecord([Trim(FIbInfo.DataSet.Fields[0].AsString),
Ord(FIbInfo.IBTypeToVCLFieldType(FIbInfo.DataSet.Fields[1].AsInteger))
,
FIbInfo.DataSet.Fields[2].AsInteger]);
FIbInfo.DataSet.Next;
end;
end;
If you need more or other fields in the metadata dataset, you have to close the
MetaDataSet, nuke the fields, add new fields and open the dataset again. The dataset
MUST be opened at the end of the event.The example below is from the AstaCTLibServer:
ord(SybTypeToVCLFieldType(CTInfo.ColSybType[i])),
CTInfo.ColLen[i],
CTInfo.ColSybType[i],
CTInfo.ColPrecision[i],
CTInfo.ColScale[i]
]);
end;
finally
CTInfo.FreeBasicColumns;
end;
end;
end;
285 / 449
ASTA 3 for Delphi
Using the Asta2Metadata component, you do not need to code ANY of the metadata
events. The metadata will then only return an empty dataset.
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
Properties
TAsta2MetaData
AliasFileName
AstaServerSocket
DataModule
MetaData
MetaDataList
Created with the Personal Edition of HelpNDoc: Effortlessly Edit and Export Markdown Documents
TAsta2MetaData.MetaData
TAsta2MetaData
Declaration
property MetaData[MetaDataRequest: TAstaMetaData]: TMetaData;
Description
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAsta2MetaData.MetaDataList
TAsta2MetaData
Declaration
property MetaDataList: TList;
Description
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
Methods
TAsta2MetaData
AdjustAlias
InitDataSet
GetMetaData
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
286 / 449
ASTA 3 for Delphi
TAsta2MetaData.AdjustAlias
TAsta2MetaData
Declaration
procedure AdjustAlias(ClientSocket: TCustomWinSocket; Database: string; Query:
TComponent; DBAction: TThreadDbAction);
Description
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TAsta2MetaData.InitDataSet
TAsta2MetaData
Declaration
procedure InitDataSet(MetaDataRequest: TAstaMetaData);
Description
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with a Help
Authoring Tool
TAsta2MetaData.GetMetaData
TAsta2MetaData
Declaration
function GetMetaData(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; DatabaseName: string;
TableName: string): TAstaDataSet;
Description
GetMetaData is the main call to fetch the metadata from the server. Supply the type of
metadata in MetaDataRequest.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
Events
TAsta2MetaData
AfterMetaData
BeforeMetaData
OnDBMSName
OnFields
OnForeignKeys
OnIndexes
OnOtherMetaData
287 / 449
ASTA 3 for Delphi
OnPrimeFields
OnStoredProcColumns
OnStoredProcs
OnSystemTables
OnTables
OnTriggers
OnVCLFields
OnViews
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework
TAsta2MetaData.AfterMetaData
TAsta2MetaData
Declaration
property AfterMetaData: TAfterMetaDataEvent;
TAfterMetaDataEvent = procedure(Sender: TObject; MetaDataRequest:
TAstaMetaData; DatabaseName: string; TableName: string) of object;
Description
This event is called directly after GetMetData is called.
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
TAsta2MetaData.BeforeMetaData
TAsta2MetaData
Declaration
property BeforeMetaData: TBeforeMetaDataEvent;
TBeforeMetaDataEvent = procedure(Sender: TObject; MetaDataRequest:
TAstaMetaData; DatabaseName: string; TableName: string) of object;
Description
This event is called directly before GetMetData is called.
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework
TAsta2MetaData.OnDBMSName
TAsta2MetaData
Declaration
property OnDBMSName: TOnDBMSNameEvent;
TOnDBMSNameEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataSet: TAstaDataSet) of object;
Description
Used to respond to mdDBMSName. Used when the server supports multiple aliases.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of HelpNDoc for
CHM Help File Generation
288 / 449
ASTA 3 for Delphi
TAsta2MetaData.OnFields
TAsta2MetaData
Declaration
property OnFields: TOnFieldsEvent;
TOnFieldsEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet; DatabaseName:
string; TableName: string) of object;
Description
Response to mdFields returns Fieldname, Fieldtype and size info.
Created with the Personal Edition of HelpNDoc: Maximize Your Reach: Convert Your Word Document to
an ePub or Kindle eBook
TAsta2MetaData.OnForeignKeys
TAsta2MetaData
Declaration
property OnForeignKeys: TOnForeignKeysEvent;
TOnForeignKeysEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; MetaDataRequest: TAstaMetaData; MetaDataSet:
TAstaDataSet; DatabaseName: string; TableName: string) of object;
Description
Fires when returning foreign key info.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TAsta2MetaData.OnIndexes
TAsta2MetaData
Declaration
property OnIndexes: TOnIndexesEvent;
TOnIndexesEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet; DatabaseName:
string; TableName: string) of object;
Description
Fires when returning Index info.
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAsta2MetaData.OnOtherMetaData
TAsta2MetaData
Declaration
property OnOtherMetaData: TOnOtherMetaDataEvent;
TOnOtherMetaDataEvent = procedure(Sender: TObject; ClientSocket:
289 / 449
ASTA 3 for Delphi
Description
Fires when returning other metadata info.
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator
TAsta2MetaData.OnPrimeKeys
TAsta2MetaData
Declaration
property OnPrimeKeys: TOnPrimeKeysEvent;
TOnPrimeKeysEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet; DatabaseName:
string; TableName: string) of object;
Description
Fires when returning primary key key info.
Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation:
The Benefits of a Help Authoring Tool
TAsta2MetaData.OnStoredProcColumns
TAsta2MetaData
Declaration
property OnStoredProcColumns: TOnStoredProcColumnsEvent;
TOnStoredProcColumnsEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; MetaDataRequest: TAstaMetaData; MetaDataSet:
TAstaDataSet; DatabaseName: string; TableName: string) of object;
Description
Fires when returning stored procedure column info.
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAsta2MetaData.OnStoredProcs
TAsta2MetaData
Declaration
property OnStoredProcs: TOnStoredProcsEvent;
TOnStoredProcsEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; MetaDataRequest: TAstaMetaData; MetaDataSet:
TAstaDataSet; DatabaseName: string; TableName: string) of object;
Description
Fires when returning stored procedure info.
290 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAsta2MetaData.OnSystemTables
TAsta2MetaData
Declaration
property OnSystemTables: TOnSystemTablesEvent;
TOnSystemTablesEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; MetaDataRequest: TAstaMetaData; MetaDataSet:
TAstaDataSet; DatabaseName: string; TableName: string) of object;
Description
Fires when returning system table info.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAsta2MetaData.OnTables
TAsta2MetaData
Declaration
property OnTables: TOnTablesEvent;
TOnTablesEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet;
DatabaseName: string; TableName: string) of object;
Description
Fires when returning table info.
Created with the Personal Edition of HelpNDoc: Bring your WinHelp HLP help files into the present with
HelpNDoc's easy CHM conversion
TAsta2MetaData.OnTriggers
TAsta2MetaData
Declaration
property OnTriggers: TOnTriggersEvent;
TOnTriggersEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet; DatabaseName:
string; TableName: string) of object;
Description
Fires when returning trigger info.
Created with the Personal Edition of HelpNDoc: Effortlessly Support Your Windows Applications with
HelpNDoc's CHM Generation
291 / 449
ASTA 3 for Delphi
TAsta2MetaData.OnVCLFields
TAsta2MetaData
Declaration
property OnVCLFields: TOnVCLFieldsEvent;
TOnVCLFieldsEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet; DatabaseName:
string; TableName: string) of object;
Description
Fires when returning VCL field info.
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAsta2MetaData.OnViews
TAsta2MetaData
Declaration
property OnViews: TOnViewsEvent;
TOnViewsEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
MetaDataRequest: TAstaMetaData; MetaDataSet: TAstaDataSet; DatabaseName:
string; TableName: string) of object;
Description
Fires when returning View info.
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaBDEInfoTable
TAstaBDEInfoTable
Properties
Unit
AstaBDEInfo
Declaration
type TAstaBDEInfoTable = class(TTable)
Description
Use TAstaBDEInfoTable to retrieve database metadata information using the BDE. Set the
BDEInfo property to the type of information to retrieve and then set the Active property
to True.
You can use TAstaBDEInfoTable just like a standard TTable once it is populated with the
metadata information that you requested.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
292 / 449
ASTA 3 for Delphi
Properties
TAstaBDEInfoTable
BDEInfo
Created with the Personal Edition of HelpNDoc: Don't be left in the past: convert your WinHelp HLP help
files to CHM with HelpNDoc
TAstaBDEInfoTable.BDEInfo
TAstaBDEInfoTable
Declaration
property BDEInfo: BDEInfoType;
type BDEInfoType = (BDENOInfo, BDEUserInfo, BDEFieldInfo, BDEIndexInfo,
BDELockList, BDEOpenTables, BDEStoredProcParams, BDEStoredProcedures,
BDESystemStoredProcedures);
Description
Sets the type of info that will be returned.
Value Meaning
BDENOInfo Does not return any BDE specific information.
Identical to TTable.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
293 / 449
ASTA 3 for Delphi
TAstaBusinessObjectManager
TAstaBusinessObjectManager
Properties : Methods
Unit
AstaMethodManager
Declaration
type TAstaBusinessObjectManager = class(TComponent);
Description
The TAstaBusinessObjectManager allows you to define server side Methods as
TAstaActionItems with optional parameters that can then be used by ASTA clients using
the TAstaClientDataSet.ServerMethod. This allows you to deploy ASTA client applications
that require NO SQL on the client. See Server Side vs. Client Side SQL for a complete
discussion. Each ServerMethod equires a TDataSet be attached to it either directly or
through a TAstaProvider. The Method can have any number of Parameters defined which
will be streamed down to the TAstaClientDataSet when a ServerMethod is chosen, either
at design time or run time. When a TAstaClientDataSet is activated using a ServerMethod
the Params are transported to the server and the OnAction event of the BusinessMethod
is fired. It is your responsibility to use the incoming client params here for the TDataSet
attached to the ServerMethod or for any other reason. To make a ServerMethod
updatable, a TAstaProvider must be used.
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
Properties
TAstaBusinessObjectManager
Actions
Created with the Personal Edition of HelpNDoc: Effortlessly upgrade your WinHelp HLP help files to CHM
with HelpNDoc
TAstaBusinessObjectManager.Actions
Applies to
TAstaBusinessObjectsManager
Declaration
property Actions: TAstaActionItems;
Description
The Actions property holds a list of TAstaItems.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
Methods
TAstabusinessObjectsManager
GetActionFromName
294 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaBusinessObjectsmanager.GetActionFromName
Applies to
TAstaBusinessObjectsManager
TAstaActionItem
Declaration
Function GetActionFromName(MethodName:String):TAstaActionItem;
Description
Each ServerMethod contains a pointer to the remote client socket that made the request. Use the
ClientSocket property if you want to do any messaging from withing a ServerMethod.
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaActionItem
Properties : Events
Applies to
TAstaBusinessObjectsManager
Unit
AstaMethodManager
Declaration
type TAstaActionItem = class(TCollectionItem)
Description
TAstaActionItems are the actual methods of the TAstaBusinessObjectsManager and
appear in TAstaClientDataSets as ServerMethods. Typically an ActionItem requires a
TDataSet either through a TAstaProvider or any TDataSet descendent on the server. Set
the UseNoDataSet property to true if you are not returning a result set but are only using
the Params. SkyWire Clients can call servermethods through the SkyWire API.
SQL is not required for the Dataset of course and TTables can be used or just plain old
TAstaDataSets (in memory). Any persistent field properties of the attached TDataset can
be streamed down to the client if the SendFieldProperties property is set to True
(default). This includes calculated fields.
Parameters can be defined for the TAstaActionItem and TAstaClientDataSets will see
these parameters whenever the ServerMethod name is set, either at runtime or design
time. If a TAstaProvider is used then the parameters of the dataset that the TAstaProvider
is connected to can be used if the GetParamsFromProvider property is set to true.
TAstaProviders can transmit their parameters if they are TParams OR the the Param
Helper events are coded.
295 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
Properties
TAstaActionItem
AstaProvider
ClientSocket
DataSet
DelayedProcess
GetParamsFromProvider
Method
Params
SendFieldProperties
ServerSocket
UseNoDataSet
Created with the Personal Edition of HelpNDoc: Effortlessly create a professional-quality documentation
website with HelpNDoc
TAstaActionItem.ServerSocket
TAstaActionItem
Declaration
property ServerSocket: TAstaServerSocket;
Description
Each ServerMethod contains a pointer to the AstaServerSocket. Use the ServertSocket
property if you want to do any messaging from within a ServerMethod. By using the
ServerSocket form the ServerMethod the method remains thread safe so that you do not
have to access the actual form that the AstaServerSocket resides on.The Sender:TObject
of the OnAction Event points to the ActionItem itself so it can be type cast to use the
ServerSocket property and also to access the ClientSocket property.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of HelpNDoc for
CHM Help File Generation
TAstaActionItem.DelayedProcess
TAstaActionItem
Declaration
property DelayedProcess: Boolean;
Description
When using the TAstaClientDataSet in ASTA client applications, the normal procedural
character of database applications is preserved. Code is executed sequentially. The
DelayedProcess property of a ServerMethod allows a server side method to be triggered
and action then returning immediately to the TAstaclientDataSet so that other datasets or
processing can be executed on the client while the server side method is executing.
When the server side process is complete the dataset that is connected to the server
method will be streamed back to the TAstaClientDataSet.
296 / 449
ASTA 3 for Delphi
This is useful for triggering long running server side reports or processes and allow the
client to continue with other work. Note: the ASTA Server must be running Threaded in
order for this to work.
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
TAstaActionItem.ClientSocket
TAstaActionItem
Declaration
property ClientSocket: TCustomWinSocket;
Description
Each ServerMethod contains a pointer to the remote client socket that made the request.
Use the ClientSocket property if you want to do any messaging from withing a
ServerMethod. The Sender:TObject of the OnAction Event points to the ActionItem itself
so it can be type cast to use the ClientSocket property or the ServerSocket property.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
TAstaActionItem.UseNoDataSet
TAstaActionItem
Declaration
property UseNoDataSet: Boolean;
Description
Setting this property to true allows you to write a server side method that needs no
dataset attached. ASTA will internally create an empty one row/one column dataset to
return to the client.
Created with the Personal Edition of HelpNDoc: Full-featured Documentation generator
TAstaActionItem.Params
TAstaActionItem
Declaration
property Params: TAstaParamList
Description
ServerMethods can have any number of Params defined. These params will be streamed
back to AstaClientDataSets when a server method is choosen at runtime or design time.
Params can be input or output params as defined in the TAstaParamList.
If a TAstaProvider is used, then the params from the Provider can be optionally used for
the Params of the ServerMethod by setting the UseParamsFromProvider property to true.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
297 / 449
ASTA 3 for Delphi
TAstaActionItem.GetParamsFromProvider
TAstaActionItem
Declaration
property GetParamsFromProvider: Boolean;
Description
A server side method or ActionItem must be attached to a TDataSet. If
theTAstaProviderproperty is set, then the TDataSet connected to the TAstaProvider will be
used by the server method. If the attached Provider has params then this property
optionally allows those params to be streamed back to the TAstaClientDataSet.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaActionItem.Method
TAstaActionItem
Declaration
property Method: string;
Description
This is the name of the BusinessObject that will be seen on the
TAstaClientDataSetServerMethod property.
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
TAstaActionItem.SendFieldProperties
TAstaActionItem
Declaration
property SendFieldProperties: Boolean;
Description
Set this property to true if you want to send extended field properties like DisplayWidth
and DisplayLabel to AstaClientDataSets. This allows you also to add calculated fields on
the server and send them to the client. By default, ServerDataSets will automatically
send their Field properties to AstaClientDataSets.
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
TAstaActionItem.AstaProvider
TAstaActionItem
Declaration
property AstaProvider: TAstaProvider
Description
A server side method or ActionItem must be attached to a TDataSet. If
theTAstaProviderproperty is set, then the TDataSet connected to the TAstaProvider will be
used by the server method.
298 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Easily create Help documents
TAstaActionItem.DataSet
TAstaActionItem
Declaration
property DataSet: TDataSet
Description
A server side method or ActionItem must be attached to a TDataSet. If
theTAstaProviderproperty is set, then the TDataSet connected to the TAstaProvider will be
used by the server method.
Events
events
TAstaActionItem
OnAction
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaActionItem.OnAction
TAstaActionItem
Declaration
type TAstaMethodActionEvent = procedure(Sender: TObject; ADataSet: TDataSet;
ClientParams: TAstaParamList) of object;
Description
This event is triggered when a TAstaClientDataSet is opened on the client and
ClientParams are streamed to the server. If the connected Dataset requires any of the
client params it must be coded as well as updating any of the return params of type
ptInputOutput, ptOutput or ptResult.
The Sender:TObject is the ActionItem itself and gives you access to the ServerSocket and
ClientSocket if you need to send any messages from within the OnActionEvent.
Example
TAstaActionItem(Sender).ServerSocket.SendcodedMessage(TAstaActionItem(Sende
r).ClientSocket, 1000, 'From a server method');
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
299 / 449
ASTA 3 for Delphi
TAstaProvider
TAstaProvider
Properties : Events
Unit
AstaProvider
Declaration
type TAstaProvider = class(TComponent);
Description
The TAstaProvider is a server side component that allows ASTA clients to be deployed
using NO SQL. Using a TAstaProvider and server side SQL generation, you will have
access to each Insert, Update and Delete statement before they are to be executed on
the server. This allows you to customize the SQL or even to ignore any rows that you
choose not to update, insert or delete on the server. When using a TAstaClientDataSet
connected to a Provider only Cached EditMode is supported. After Post editmode is not
supported but posting each row change to the server can be simulated by calling
ApplyUpdates in the AfterPost event. When an AstaClientDataSet's SQLGenerated location
is changed to gsServer the AstaClientDataSet is automatically put in Cached Edit Mode.
The Edit Mode property editor is not functional when using TAstaProviders.
TAstaProviders can also be used to monitor table changes on the server and those
changes can be broadcasted to interested clients.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
Properties
TAstaProvider
Active
AstaServerSocket
AutoIncrementField
BroadCastsToOriginalClient
ClientDataSetExtraParams
ClientSocketParams
CompareCurrentServerValuesOnUpdates
Dataset
OracleSequence
Params
PrimeFields
RefetchOnUpdates
RetainCurrentValuesDataset
SendFieldProperties
ServerSideBroadcastFilter
UpdateTableName
300 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
TAstaProvider.Active
TAstaProvider
Declaration
property Active: Boolean;
Description
The Active property will get passed through to the dataset that is connected to the
AstaProvider.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaProvider.AstaServerSocket
TAstaProvider
Declaration
property AstaServerSocket: TObject;
Description
This provides a pointer back to the AstaServerSocket in case you want to make any
thread safe ASTA messaging calls using the TAstaProvider on the server DataModule. The
property can be type cast back to a TAstaServerSocket.
Example
TAstaServerSocket(MyProvider).AstaServerSocket.SendCodedMessage(ClientSocke
t, 100, 'Hello From the Provider');
Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents
TAstaProvider.BroadCastsToOriginalClient
TAstaProvider
Declaration
property BroadCastsToOriginalClient: Boolean;
Description
When an AstaClientDataSet is set to receive Provider Broadcasts, this property will
determine whether inserts, updates or deletes from the originating client will be
broadcast back to the original client. The default is False.
Provider BroadCasts
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
301 / 449
ASTA 3 for Delphi
TAstaProvider.ClientDataSetExtraParams
TAstaProvider
Declaration
property ClientDataSetExtraParams: TAstaParamList;
Description
The AstaClientDataSet has a public ExtraParams:TAstaParamList property that will be
transfered to server side TAstaProviders with any call to SendProviderTransactions along
with the AstaclientSocket.ClientSocketParams which will appear on the
AstaProvider.ClientSocketParams.
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
TAstaProvider.ClientSocketParams
TAstaProvider
Declaration
property ClientSocketParams: TAstaParamList;
Description
The AstaClientDataSet has a public ClientSocketParams:TAstaParamListproperty that will
be transfered to server side TAstaProviders with any call to SendProviderTransactions that
will contain anything in the AstaClientSocket.ClientSocketParams along with the
AstaclientDataSet.ExtraParams which will appear on the
AstaProvider.ClientDataSetExtraParams. This allows you to transfer disparate information
to AstaProviders.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
TAstaProvider.CompareCurrentServerValuesOnUpdates
TAstaProvider
Declaration
property CompareServerValuesOnUpdates: Boolean;
Description
If set to True the CompareServerValuesOnUpdates will do a server side select before the
BeforeUpdate is fired so that the ServerDataSet of the OnBeforeupdate is populated with
current values from the server.
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAstaProvider.Dataset
TAstaProvider
Declaration
302 / 449
ASTA 3 for Delphi
Description
AstaProviders require a TDataSet descendent whose contents will be streamed back to
TAstaClientDataSets.
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
TAstaProvider.Params
TAstaProvider
Declaration
property Params: TAstaParamList;
Description
The datasets attached to AstaProviders usually provide a Params property in order to
support parameterized queries. If that property is of type TParams, these parameters will
be automatically streamed back to the TAstaClientDataSet pointing toward the
AstaProvider.
Often however, the TDataSet descendant used on an ASTA server will not use a TParams
property but have their own class similar to TParams. ASTA must be able to transalate
any Params to a TAstaParamList so it can be safely streamed across process boundries. To
do this there are Param Helper Events on the TAstaProvider.
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
TAstaProvider.ParamsSupport
TAstaProvider
Declaration
Description
TAstaProviders require a TDataSet be attached to it. If that TDataSet has a Params
property that is type TParams, these params will be automatically streamed back to
TAstaClientDataSets and be populated from the client before the provider's TDataSet is
opened.
In order to support all the unknown Params that are used on third party TDataSet
descendents, the TAstaServerSocket has two methods that require coding in order to
achieve transparent and complete Param support for the TAstaClientDataSet.
OnProviderConvertParams
OnProviderSetParams
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help
Authoring Tool
TAstaProvider.PrimeFields
TAstaProvider
303 / 449
ASTA 3 for Delphi
Declaration
property PrimeFields: TStrings;
Description
The PrimeFields property is used to provide information on the fields needed to fetch a
row using a unique value. In order to be able to have ASTA generate SQL automatically
on edits, inserts and deletes the PrimeFields must be defined.
Related Topics
ASTA SQL Generation
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaProvider.RefetchOnUpdates
TAstaProvider
Declaration
property RefetchOnUpdates: Boolean;
Description
The RefetchOnInsert property allows you to easily retrieve specific field values after an
Insert or Update statement. If you have an auto increment field or perhaps a timestamp
field that is inserted by a trigger, you can use this property to return those values. This
property will work for a single transaction or a group of transactions.
Specify the fields that you want to retrieve in the RefetchOnInsert property editor.
Whenever an Insert statement is fired, the values will be returned to the client. The
AfterRefetchOnInsert event will notify you when the values have been returned. Code
that event if you need to take immediate action with the returned value.
If an auto increment field is defined and included in this list of fields, then you must code
the OnInsertAutoIncrementFetch event on the TAstaServerSocket. For Paradox and
Access a call to Max(FieldName) is made. For SQLServer and SQL Anywhere you can code
a call to the variable @@identity to retrieve the last autoincrement value. The ASTA
server then uses this value, or the prime key fields values to fetch all of the fields as
specified in the RefetchOnInsert property. All of the server SQL is executed and when it is
completed, the RefetchOnInsert values are streamed from the ASTA server and matched
up to the appropriate rows in the TAstaClientDataSet.
Note: this property will not work if your database does not support transactions.
Refetch Discussion
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAstaProvider.RetainCurrentValuesDataSet
TAstaProvider
Declaration
property RetainCurrentValuesDataSet: Boolean;
Description
Set RetainCurrentValuesDataSet to True if you want the TAstaProvider to hold onto or
maintain the CurrentValuesDataSet presented in the OnBeforeUpdate and onBeforeInsert
304 / 449
ASTA 3 for Delphi
events. this can be useful in manual broadcasts or if you want to code the
OnProviderCompleteTransationEvent.
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaProvider.SendFieldProperties
TAstaProvider
Declaration
property SendFieldProperties: Boolean;
Description
Set this property to true if you want to send extended field properties like DisplayWidth
and DisplayLabel to AstaClientDataSets. This allows you also to add calculated fields on
the server and send them to the client along with other extended field properties. There
is a cost do doing this. By default this is set to true. This means that persistent fields for
remote AstaClientDataSets are defined on the server if SendFieldProperties is set to true.
If you want to define persistent field properities on the client, set SendFieldProperties to
false.
See also
TAstaActionItem.SendFieldProperties
TAstaServerSocket.PersistentFieldTranslateEvent
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaProvider.ServerSideBroadcastFilter
TAstaProvider
Declaration
property ServerSideBroadcastFilter: string;
Description
Broadcasts can be an expensive operation so by adding the ability to filter any datasets
for broadcast can cut down on the amount of broadcasts. ASTA providers both client and
server side filtering. The ServerSideBroadFilter, which supports all the expressions in the
TDataSet Filter:String property, allows for broadcasts to be only made on certain
conditions. combined with the AstaclientDataSet.ProviderFilter:String property broadcasts
can be customized to be made extremely efficient and targetted only specific data
changes.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaProvider.UpdateTableName
TAstaProvider
Declaration
property UpdateTableName: string;
Description
In order for ASTA to generate SQL on update, insert and deletes, the UpdateTableName
305 / 449
ASTA 3 for Delphi
property must be set. See Asta SQL Generation for a full discussion.
Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily
Events
TAstaProvider
AfterInsert
AfterDelete
AfterRefetch
AfterUpate
BeforeInsert
BeforeDelete
BeforeOpen
BeforeUpdate
OnAfterTransaction
OnBeforeTransaction
OnBroadCastDecideEvent
OnRefetchDataSet
OnRefetchSQL
Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation:
The Benefits of a Help Authoring Tool
TAstaProvider.AfterOpen
TAstaProvider
Declaration
property AfterOpen: TAstaProviderOpenEvent;
type TAstaProviderOpenEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinsocket; ClientParams: TAstaParamList) of object;
Description
Fires after a TAstaProvider is opened.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaProvider.AfterDelete
TAstaProvider
Declaration
property AfterDelete: TAstaAfterDeleteEvent;
type TAstaAfterDeleteEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; ExecQuery: TComponent; OrigianlValueDataSet,
ServerValueDataSet: TDataset) of object;
Description
This event will fire after a delete using server side SQL and allows you to execute
additional SQL statements using the scratch ExecQuery that is passed through by this
event. The OrginalValueDataSet will contain will contain the values from the client
dataset and the ServerValueDataset will contain current Values on the server before the
306 / 449
ASTA 3 for Delphi
TAstaProvider.AfterInsert
TAstaProvider
Declaration
property AfterInsert: TAstaInsertEvent;
type TAstaAfterInsertEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; ExecQuery: TComponent; CurrentValueDataSet: TDataset) of
object;
Description
This event will fire after an insert using server side SQL and allows you to execute
additional SQL statements using the scratch ExecQuery that is passed through by this
event. The CurrentValueDataSet will contain the values from the client dataset.
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
TAstaProvider.AfterRefetch
TAstaProvider
Declaration
property AfterRefetch: TAstaProviderAfterRefetchEvent;
type TAstaProviderAfterRefetch = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; RefetchedDataSet, CurrentValuesDataSet: TDataSet) of
object;
Description
This event will fire after a refetch using server side SQL. The CurrentValueDataSet will
contain the values from the client dataset and the RefetchedDataSet contain the values
just refetched.
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
TAstaProvider.AfterUpdate
TAstaProvider
Declaration
property AfterUpdate: TAstaAfterUpdate;
type TAstaAfterUpdateEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; ExecQuery: TComponent; CurrentValueDataSet: TDataset) of
object;
Description
This event will fire after an update using server side SQLand allows you to execute
additional SQL statements using the scratch ExecQuery that is passed through by this
event. The CurrentValueDataSet will contain the values from the client dataset.
Created with the Personal Edition of HelpNDoc: Free help authoring tool
307 / 449
ASTA 3 for Delphi
TAstaProvider.BeforeDelete
TAstaProvider
Declaration
property AfterInsert: TAstaDeleteEvent;
type TAstaDeleteEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; ExecQuery: Component;
OriginalValueDataSet, ServerValueDataSet: TDataset;
var Handled: Boolean) of object;
Description
This event will fire before a delete using server side SQLand allows you to execute
additional SQL statements using the scratch ExecQuery that is passed through by this
event. The OriginalValueDataSet will contain the values from the client dataset. If you do
NOT want ASTA to fire the Delete statement then set Handled to True.
(ServerValueDataSet has not been implemented yet but would contain the current values
for the prime key fields).
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaProvider.BeforeInsert
Applies to
TAstaProvider
Declaration
type TAstaInsertEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; ExecQuery: TComponent;
CurrentValueDataSet: TDataset; var Handled: Boolean) of object;
property AfterInsert: TAstaInsertEvent;
Description
This event will fire before an insert using server side SQLand allows you to execute additional SQL
statements using the scratch ExecQuery that is passed through by this event. The CurrentValueDataSet will
contain the values from the client dataset. If you do NOT want ASTA to generate any SQL and execute it for
you then set the Handled argument to True.
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
TAstaProvider.BeforeOpen
Applies to
TAstaProvider
Declaration
type TAstaProviderOpenEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinsocket;
ClientParams: TAstaParamList) of object
property BeforeOpen: TAstaProviderOpenEvent;
Description
This event will fire before the dataset attached to the TAstaProvider is opened and will contain the
ClientParams streamed in from the TAstaclientDataSet.Params property.
308 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's User-Friendly UI
TAstaProvider.BeforeUpdate
Applies to
TAstaProvider
Declaration
type
TAstaUpdateEvent = procedure(Sender: TObject; ClientSocket: TCustomWinSocket;
ExecQuery: TComponent;
OriginalValueDataSet,CurrentValueDataSet,ServerValueDatASet;CurrentValueData
Set: TDataset; var Handled: Boolean) of object;
property BeforeUpdate: TAstaUpdateEvent;
Description
This event will fire before an update using server side SQLand allows you to execute additional SQL
statements using the scratch ExecQuery that is passed through by this event. The CurrentValueDataSet will
contain the current values from the client dataset, the originalValueDataSet will contain the original values
before the update and if the CompareCurrentServerValuesOnUpdates is set to true the
ServerValueDataSet will contain freshly populate data from the server. If the var Handled:Boolean is set to
true the AstaProvider will not generate any SQL. Use the passed in ExecQuery by typecasting it to fire any
Update SQL in this event.
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with
HelpNDoc's built-in SEO
TAstaProvider.AfterTransaction
TAstaProvider
Declaration
property OnAfterTransaction: TAstaProviderAfterTransactionEvent;
type TAstaProviderAfterTransactionEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; ExecQuery: TComponent; CurrentValueDataSet:
TDataset; TransactionFailed: Boolean) of object;
Description
The OnAfterTransaction event is fired for a provider after a transaction
has finihsed. A transaction will only be used if ApplyUpdates is called
at the client side with usmServerTransaction.
You can use the passed in ExecQuery to execute some other database
action if you wish. The type of ExecQuery is the same as the object
returned from ThreadedDBSupplyQuery with DBAction=ttExec.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
309 / 449
ASTA 3 for Delphi
TAstaProvider.BeforeTransaction
TAstaProvider
Declaration
property OnBeforeTransaction: TAstaProviderBeforeTransactionEvent;
type TAstaProviderBeforeTransactionEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; ExecQuery: TComponent; OrigValueDataSet,
CurrentValueDataSet: TDataset; var Handled: Boolean) of object;
Description
The OnBeforeTransaction event will be fired for a provider before a
transaction is started. A transaction will only be used if ApplyUpdates
is called at the client side with usmServerTransaction.
CurrentValueDataSet is the values from the client and does not include
deleted rows. OrigValueDataSet is the old values dataset from the client
and includes deleted rows but not appended rows.
Created with the Personal Edition of HelpNDoc: Transform Your Help Documentation Process with a Help
Authoring Tool
TAstaProvider.OnBroadCastDecideEvent
TAstaProvider
Declaration
type BroadCastOkEvent = procedure(Sender: TObject; NewValueDataset: TDataSet;
var BroadCastOK: Boolean) of object;
property OnBroadCastDecideEvent: TBroadCastOKEvent;
Description
This event allows you to code TAstaProviders to only broadcast changes if any fields
change. By setting the BroadCastOk argument (default is True) you can decide if you
want server side changes to be broadcast or not.
Created with the Personal Edition of HelpNDoc: Revolutionize Your CHM Help File Output with HelpNDoc
TAstaProvider.OnRefetchSQL
TAstaProvider
Declaration
property OnRefetchSQL: TAstaOnRefetchSQLEvent;
type TAstaOnRefetchSQLEvent = procedure (Sender: TObject; ClientSocket:
TCustomWinSocket; var TheSQL: string; SQLParser: TAstaSQLParser) of object;
Description
ASTA 3 adds a new event to TAstaProviders: OnRefetchSQL. The AstaSQLParser is passed
in so that you can call Deconstruct and be presented with all the Fields, Tables,
Tablename and Where Clause. It's up to you to change the TheSQL:string param passed
in. You can use the AstaSQLParser and call Construct after you have changed the
properties.
310 / 449
ASTA 3 for Delphi
TAstaProvider.OnRefetchDataSet
TAstaProvider
Declaration
TAstaOnRefetchDataSetEvent=Procedure (Sender :
TObject;ClientSocket:TCustomWinSocket; TheDataSet:TAstaDataSet;Var
TheDataSetAsString:String) of object;
Description
ASTA 3 adds a new event to TAstaProviders: OnRefetchDataSet. This allows for the
Dataset, that contains the refetched values to be manipulated and to add other columns
and to change values. The DataSet will stream back to the client and be updated using a
bookmark.
Created with the Personal Edition of HelpNDoc: Make CHM Help File Creation a Breeze with HelpNDoc
TAstaServerSocket
TAstaServerSocket
Properties : Methods : Events
Unit
AstaServer
311 / 449
ASTA 3 for Delphi
Declaration
type TAstaServerSocket = class(TServerSocket);
Description
An AstaServerSocket is the core component of an ASTA server. The ASTA server is the
"application server" or "middle tier." It manages all the client connections and maintains
a UserList and also handles all database issues. All messages in an ASTA application flow
through the AstaServerSocket.
See the AstaServers discussion and Developer's Abstract for an overview, and Threading
ASTA Servers for a discussion of ASTA threading models.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
Properties
TAstaServerSocket
Active
AddCookie
Address
AstaProtocol
AstaServerName
Compression
DataBaseName
DataBaseSessions
DataSet
DirectoryPublisher
DisconnectClientOnFailedLogin
DisposeofQueriesForThreads
DTAccess
DTPassword
DTUserName
Encryption
Instant Messaging
KeysExchange
LogItems
LogOn
MaximumAsyncSessions
MaximumSessions
MetaDataSet
Port
SecureServer
ServerAdmin
ServerProviderBroadcastList
ServerSQLGenerator
ServerType
SessionList
StatelessListMinutesForExpiration
StatelessListMinutesToCheck
StatelessUserList
StoredProcDataSet
ThreadingModel
TrustedAddresses
UserCheckList
UserList
312 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaServerSocket.Active
TAstaServerSocket
Declaration
property Active: Boolean;
Description
When the Active property is set to true, an ASTA server starts to listen on the port that it
is configured to use.
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
These Security Measures
TAstaServerSocket.AddCookie
TAstaServerSocket
Declaration
property AddCookie: TAstaServerCookieOption;
TAstaServerCookieOption = (coNoCookie, coStatelessUserList, coUserCoded);
Description
Adds a "cookie" to ASTA messaging packets for stateless HTTP authentication. See
Stateless Clients for more detail.
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
TAstaServerSocket.Address
TAstaServerSocket
Declaration
property Address:String;
Description
Use this property if there are more than one network card in the computer the
AstaServerSocket is running on and you want to bind tp a specific network card. In
normal use this property need not be set as the AstaServerSocket will bind the the
default network card installed on the computer running the Server.
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaServerSocket.AstaProtocol
TAstaServerSocket
Declaration
313 / 449
ASTA 3 for Delphi
Description
THIS PROPERTY HAS BEEN DEPRECATED IN ASTA 3.
ASTA 3 servers can now handle TCP/IP and HTTP clients with no changes to the server
protocol. Each user can have their own protocol. See UserRecord.Protocol.
ASTA servers and clients use a proprietary messaging format with the default transport
using TCP/IP. To traverse firewalls ASTA TCP/IP messaging can be made to appear as
HTTP messages or actually become HTTP messsages. There is no need to set this property
on the AstaServerSocket as ASTA servers can serve TCP/IP and HTTP clients unchanged.
The only requirement is that to support stateless HTTP clients, servers must be run using
Pooled or Smart Threading.
ASTAClientSockets can call serveral helper methods and run time dialogs to configure
ASTA clients to use protocols other than TCP/IP.
Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator
TAstaServerSocket.AstaServerName
TAstaServerSocket
Declaration
property AstaServerName: string;
Description
Use of this property allows a name to be assigned to an ASTA server that can be seen
from AstaClientDatasets using the mdDBMSName ordinal of the MetaData property.
Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator
TAstaServerSocket.Compression
TAstaServerSocket
Declaration
property Compression: TAstaCompression;
Description
This property determines if compression will be employed by your application. It works in
conjunction with the OnCompress and OnDecompress events. AstaZLib compression is
the recommended compression method to use and it available cross platform.
NOTE: This property must have the SAME SETTING on the ServerSocket AND the
ClientSocket.
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAstaServerSocket.DataBaseName
TAstaServerSocket
Declaration
property DataBaseName: string;
314 / 449
ASTA 3 for Delphi
Description
Use of this property allows a DatabaseName to be assigned to an ASTA server that can be
seen from AstaClientDatasets using the mdDBMSName ordinal of the MetaData property.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaServerSocket.DataBaseSessions
TAstaServerSocket
Declaration
property DatabaseSessions: string;
Description
The DatabaseSessions property of the TAstaServerSocket determines the number of
sessions or connections that will be pooled by the AstaServer and will be created at
startup when using the Pooled Sessions Threading Model and expands on demand. By
creating the sessions before the server starts to run, they will be available when needed.
You can limit the number of DatabaseSessions that the AstaSessionList explands to by
setting the MaxiumumSessions property.
TAstaServerSocket.DataSet
TAstaServerSocket
Declaration
property DataSet: TDataset;
Description
When running an ASTA server in the Single Thread model, set the the DataSet property
to any TDataSet descendent on the server in the OnSubmitSQL event, and that dataset
will be streamed back to the ASTA client.
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
TAstaServerSocket.DirectoryPublisher
TAstaServerSocket
Declaration
property DirectoryPublisher: TAstaServerDirectory;
Description
See the tutorial RemoteDirectory for more information and an example using this
component.
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
315 / 449
ASTA 3 for Delphi
TAstaServerSocket.DisconnectClientOnFailedLogin
TAstaServerSocket
Declaration
property DisconnectClientOnfailedLogin: Boolean;
Description
When this is true, the client is automatically disconnected if Verified is set to False in the
OnClientLogin or OnClientDBLogin events. It is more secure to disconnect a client rather
than sending a KillMessage.
Security Issues
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
TAstaServerSocket.DisposeofQueriesForThreads
TAstaServerSocket
Declaration
property DisposeofQueriesForThreads: Boolean;
Description
When threading ASTA servers this property determines whether ASTA disposes of a query
after a client does some database task. If the ASTA server implements it's queries using
a data module (as in the AstaODBCServer example) set DisposeofQueriesForThreads to
False.
TAstaServerSocket.DTAccess
TAstaServerSocket
Declaration
property DTPassword: string;
Description
DTAccess controls which clients have design time access to your AstaServer (and
therefore your data).
ASTA provides powerful design time features by allowing a developer to access currently
running ASTA servers. This access does not require a password, a convenience that allows
you to have easy access to your design time data without having to type in user names
and passwords at every turn. It also opens up a potential security hole. Other ASTA
developers, if they knew the IP address and the port of your ASTA server, would be able
to gain access to your database if they were so inclined. One simple step that you can
take to help avoid this problem is to switch your ASTA servers from the default port of
9000 to a different number above 1024.
To close the door completely, ASTA provides server-side and client-side properties that
allow you to control who accesses the servers at design time. The AstaClientSocket and
the AstaServerSocket both have DTUserName and DTPassword properties. Those
316 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
TAstaServerSocket.DTPassword
TAstaServerSocket
Declaration
property DTPassword: string;
Description
ASTA provides powerful design time features by allowing a developer to access currently
running ASTA servers. This access does not require a password, a convenience that allows
you to have easy access to your design time data without having to type in user names
and passwords at every turn. It also opens up a potential security hole. Other ASTA
developers, if they knew the IP address and the port of your ASTA server, would be able
to gain access to your database if they were so inclined. One simple step that you can
take to help avoid this problem is to switch your ASTA servers from the default port of
9000 to a different number above 1024.
To close the door completely, ASTA provides server-side and client-side properties that
allow you to control who accesses the servers at design time. The AstaClientSocket and
the AstaServerSocket both have DTUserName and DTPassword properties. Those
properties are controlled by the AstaServerSocket's DTAccess property. DTAccess is
defaulted to True. For maximum security, you should set DTAccess to False and then
assign matching user name and passwords to the AstaClientSocket and AstaServerSocket
DTUserName and DTPassword properties. If you set DTAccess to False, you must provide
DTUserName and DTPassword values. Null values will not be accepted and the client will
be terminated.
Created with the Personal Edition of HelpNDoc: Effortlessly Edit and Export Markdown Documents
TAstaServerSocket.DTUserName
TAstaServerSocket
Declaration
property DTUserName: string;
Description
ASTA provides powerful design time features by allowing a developer to access currently
running ASTA servers. This access does not require a password, a convenience that allows
you to have easy access to your design time data without having to type in user names
and passwords at every turn. It also opens up a potential security hole. Other ASTA
developers, if they knew the IP address and the port of your ASTA server, would be able
to gain access to your database if they were so inclined. One simple step that you can
take to help avoid this problem is to switch your ASTA servers from the default port of
9000 to a different number above 1024.
317 / 449
ASTA 3 for Delphi
To close the door completely, ASTA provides server-side and client-side properties that
allow you to control who accesses the servers at design time. The AstaClientSocket and
the AstaServerSocket both have DTUserName and DTPassword properties. Those
properties are controlled by the AstaServerSocket's DTAccess property. DTAccess is
defaulted to True. For maximum security, you should set DTAccess to False and then
assign matching user name and passwords to the AstaClientSocket and AstaServerSocket
DTUserName and DTPassword properties. If you set DTAccess to False, you must provide
DTUserName and DTPassword values. Null values will not be accepted and the client will
be terminated.
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Process with HelpNDoc's
Project Analyzer
TAstaServerSocket.Encryption
TAstaServerSocket
Declaration
property Encryption: TAstaEncryption;
Description
This property determines the encryption, if any, that will be employed by your
application.
Value Meaning
aeAstaEncrypt A simple encryption, just set
client and server properties.
NOTE: This property must have the SAME SETTING on the ServerSocket AND the
ClientSocket. This property is used in conjunction with the AstaClientSocket's and
AstaServerSocket's OnEncrypt and OnDecrypt events.
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TAstaServerSocket.InstantMessaging
Declaration
Description
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
318 / 449
ASTA 3 for Delphi
TAstaServerSocket.KeysExchange
TAstaClientSocket
TAstaServerSocket
Declaration
property KeysExchange: TAStaKeysExchange
TAstaKeysExchange=(keNoKeysExchange,keRSA);
Description
When set to keRSA RSA public key exchange is performed.
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
TAstaServerSocket.LogItems
Declaration
Description
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaServerSocket.LogOn
TAstaServerSocket
Declaration
property LogOn: Boolean;
Description
When the LogOn property is set to true, an ASTA server will show internal debug
messages and any messages you have coded on your ASTA server using the
OnShowServerMessage. For production servers it is recommended that NO logging is
done as writing to any GUI control consumes quite a bit of CPU resources.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TAstaServerSocket.MaximumAsyncSessions
TAstaServerSocket
Declaration
property MaximumAsyncSessions: Integer; default -1;
Description
ASTA Messaging can be run threaded and also request Database components within the
threads by calling the ThreadedDBUtilityEvent. When running under the Pool Sessions
Threading Model ASTA supports Asyncronous Database Access within threads. This an
advanced feature that can consume a great deal of resources but can also be very
powerful in allowing remote ASTA clients to run concurrent Database processes in threads
319 / 449
ASTA 3 for Delphi
on ASTA servers.
TAstaServerSocket.MaxiumumSessions
TAstaServerSocket
Declaration
property MaximumSessions: Integer; default -1;
Description
When running the server in Pooled Sessions threading model at server startup
DatabaseSessions number of DataModules are created on the server by calling the
ThreadedDBSupplySession event and adding those DataModules the AstaSessionList. The
AstaSessionList will expand by demand. You can control the maximum number of Pool
Sessions with the MaximumSessions property. When this MaximumSessions property is
set and the pool tries to expand beyond that number, Database Requests are Queued
until a Session becomes available.
Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help
Authoring Tool
TAstaServerSocket.MetaDataSet
TAstaServerSocket
Declaration
property MetaDataSet: TDataset;
Description
This is the dataset that is used for meta data requests from ASTA clients. Make sure the
OnFetchMetaData event of the TAstaServerSocket sets the MetaData property to the
correct dataset after a request from an ASTA client.
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
HTML5 template
TAstaServerSocket.Port
TAstaServerSocket
Declaration
property Port: Integer;
Description
A socket is a combination of an IP address and port number. You can control the ASTA
server port by assigning this property. You can assign port numbers above 2048. The
AstaServerSocket defaults to port 9000. If you change to Port 5555, then you will need to
make sure that your AstaClientSocket.Port property is assigned 5555.
320 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
TAstaServerSocket.SecureServer
TAstaServerSocket
Declaration
property SecureServer: Boolean;
Description
With SecureServer set to true the only message allowed from a client with no UserName
already on the UserList, is a LoginRequest or the client gets disconnected. After the
loginrequest the UserRecord of the UserList has a UserName so the door allows any
remote users with a userName through which means they have already passed the Login.
This means all doors are closed except the login door. Design time access is NOT
suported with this property set to true.
TAstaServerSocket.ServerAdmin
TAstaServerSocket
Declaration
property ServerAdmin: TServerAdmin;
Description
ServerAdmin allows for remote server administration capabilities. See ASTA Server Admin
for more information.
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
TAstaServerSocket.ServerProviderBroadCastList
TAstaServerSocket
Declaration
property ServerProviderBroadCastList: TAstaProviderBroadCastList;
Description
Internal Datastructure used to handle provider broadcasts. ASTA uses this internally and
access at the application level is not normally required.
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's
Advanced Features
TAstaServerSocket.ServerSQLGenerator
TAstaServerSocket
321 / 449
ASTA 3 for Delphi
Declaration
property ServerSQLGenerator: TAstaSQLGenerator;
Description
Contains the server side settings to allow for customization of SQL generated by the ASTA
server. See TAstaSQLGenerator.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaServerSocket.ServerType
TAstaServerSocket
Declaration
type TServerType = (stNonBlocking, stThreadBlocking);
property ServerType: TServerTypeProperty;
Description
In ASTA applications, leave the ServerType set to the default, stNonBlocking.
Created with the Personal Edition of HelpNDoc: Generate EPub eBooks with ease
TAstaServerSocket.SessionList
TAstaServerSocket
Declaration
property SessionList: TAstaSessionList;
Description
For Pooled Sessions, the actual DataModule list used to pool database connections.
Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced
Customization Options
TAstaServerSocket.StatelessListMinutesforExpiration
Declaration
Description
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's
Advanced Features
TAstaServerSocket.StatelessListMinutesToCheck
Declaration
Description
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
322 / 449
ASTA 3 for Delphi
Password Protection
TAstaServerSocket.StatelessUserList
Declaration
Description
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
TAstaServerSocket.StoredProcDataSet
TAstaServerSocket
Declaration
property StoredProcDataSet: TDataset;
Description
Set the StoredProcDataSet to the server side TDataSet descedent that contains a result
set after the execution of a stored procedure on the server. Used only in the Single
Threaded Model.
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaServerSocket.ThreadingModel
TAstaServerSocket
Declaration
property ThreadingModel: TAstaThreadModel;
type TAstaThreadModel = (tmSingleSession, tmPooledSessions,
tmPersistentSessions);
Description
See Threading ASTA servers for an overview.
Value Meaning
tmSingleSession This is the default model and should be the fastest
for small numbers of users or larger numbers of
users that don't have excessive concurrent activity.
323 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation
TAstaServerSocket.TrustedAddresses
TAstaServerSocket
Declaration
property TrustedAddresses: TStrings;
Description
Users can be authenticated by ASTA Servers using the OnClientAuthentiate Event and
design time access can be granted to certain uses. TrustedAddresses is a more elegant
way to secure the server but to allow certain "trusted" addresses access regardless of
user name or password. If you set SecureServer to true design time access is blocked
UNLESS you include the IP address of any machine you want to be able to access your
server. Trusted Addresses basically create a back door for access to the server for any IP
address you add to the Trusted Address List.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaServerSocket.UserCheckList
TAstaServerSocket
Declaration
property UserCheckList: TCheckListBox;
324 / 449
ASTA 3 for Delphi
Description
ASTA provides a built-in TUsers object that tracks the users connected to the server. Drop
a TCheckListBox component onto the server and then set the UserCheckList to it. When
users connect or disconnect the CheckListBox will populate/depopulate automatically.
The UserCheckList will populate with the Socket (the client IP address and port on which
it is communicating), the UserName and the ApplicationName (if values are assigned to
those properties . . . see AutoLoginDlg).
[NEED SCREENSHOT]
To disconnect specific users, utilize the KillSelectedUsers method. Place an "x" next to the
user or users that you wish to disconnect and then issue the KillSelectedUsers command.
To broadcast to specific users, utilize the SendSelectPopup or SendSelectCodedMessage
command.
Created with the Personal Edition of HelpNDoc: Modernize your help files with HelpNDoc's WinHelp HLP
to CHM conversion tool
TAstaServerSocket.UserList
Declaration
property UserList: TUsers;
Description
The AstaServerSocket maintains a UserList that contains a list of TUserRecord objects. It
tracks information about connected users. Users are added to the UserList after a
successful client login on the AstaServerSocket. There is an event fired when users are
added or removed: UserList.OnUserListChange. Each item in the UserList contains a
UserRecord with the UserName (if the user has supplied one for a login), Application
Name, Connect time and an ParamList that can be used to store any other "scratch"
information that your application may require. The ParamList can be used to store extra
information and will include any parameters added to the
AstaclientSocket.ClientSocketParams at login time. See the AdvancedLogin Tutorial for
code examples of using the ClientSocketParams and accessing the
AstaServerSocket.UserRecord.ParamList at login time.
All messaging and database routines on the AstaServerSocket supply access to the
ClientSocket making the request. This ClientSocket can be used to look up information
from the UserList.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
Methods
TAstaServerSocket
AstaThreadCount
ClientBroadcastParams
ClientUpgradeRegistryInfoAsDataset
325 / 449
ASTA 3 for Delphi
CommandLinePortcheck
CreateSessionsForDbThreads
DisconnectClientBroadCaster
DisconnectClientSocket
EarlyRegisterSocket
FileSegmentsend
IsNonVCLClient
KillSelectedUsers
LogServerActivity
ManualBroadcastProviderChanges
NetworkProviderBroadcast
PdaFastEnable
PublishServerDirectories
PublishServerDirectories
RecordServerActivity
RegisterClientAutoUpdate
RegisterDataModule
RemoteAddressAndPort
SendAsyncException
SendAsyncExceptionUserRecord
SendBroadcastEvent
SendBroadcastPopUp
SendClientKillMessageSocket
SendCodedMessage
SendCodedMessageSocket
SendCodedParamList
SendCodedParamListSocket
SendCodedStream
SendCodedStreamSocket
SendExceptionToClient
SendInstantMessage
SendSelectCodedMessage
SendSelectPopupMessage
SessionCount
SetAESKeyStrings
SetDESKey
StatelessClient
ThreadedDBUtilityEvent
ThreadedUtilityEvent
UseThreads
UseThreadsSocket
ValidSocket
VerifyClientConnection
VerifyClientConnections
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaServerSocket.AddFileToTransportQueue
TAstaServerSocket
Declaration
procedure AddFileToTransportQueue(QName,FileName, LocalFileName: string;
DeleteFile: Boolean; Chunksize: Integer; ClientSocket: TCustomWinSocket);
Description
See the ASTA FTP discussion.
326 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
TAstaServerSocket.AddFileToTransportQueueParams
TAstaServerSocket
Declaration
procedure AddFileToTransportQueueParams(QName: string; Params: TAstaParamList;
ClientSocket: TCustomWinSocket);
Description
See the ASTA FTP discussion.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaServerSocket.AddUserToStatelessUserList
TAstaServerSocket
Declaration
procedure AddUserToStatelessUserList(TheClient: TUserRecord; UserName:
string);
Description
Used internally to add users to the the StatelessUserList.
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TAstaServerSocket.AstaThreadCount
TAstaServerSocket
Declaration
function AstaThreadCount: Integer;
Description
Returns the current number of active threads.
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
TAstaServerSocket.BCBThreadedDBUtilityEvent
TAstaServerSocket
Declaration
procedure BCBThreadedDBUtilityEvent(ClientSocket: TCustomWinSocket;
QueryToUse: TThreadDbAction; BCBCustomEvent: BCBThreadUtilityCallBack;
Params: TAstaParamList);
327 / 449
ASTA 3 for Delphi
Description
Used for the BCB linker.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaServerSocket.ClientBroadCastParams
TAstaServerSocket
Declaration
procedure ClientBroadCastParams(Msgid: Integer; P: TAstaParamList); overload;
procedure ClientBroadCastParams(Originator: TCustomWinsocket; Msgid: Integer;
P: TAstaParamList); overload;
Description
Broacasts ParamLists to users. Overloaded so that you can optionally skip the user who
triggered a broadcast request (originator).
Created with the Personal Edition of HelpNDoc: Keep Your Sensitive PDFs Safe with These Easy Security
Measures
TAstaServerSocket.ClientUpgradeRegistryInfoAsDataSet
TAstaServerSocket
Declaration
function ClientUpgradeRegistryInfoAsDataSet: TAstaDataSet;
Description
Returns a TAstaDataSet with auto update registry info. You are responsible for disposing
of any DatAset returned as a result of this function call.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaServerSocket.CommandLinePortcheck
TAstaServerSocket
Declaration
procedure CommandLinePortcheck;
Description
Call this method in an ASTA server before the server sets it's Active property to True if
you want to allow the ASTA server command line switches to be checked.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
TAstaServerSocket.CreateSessionsForDbThreads
TAstaServerSocket
328 / 449
ASTA 3 for Delphi
Declaration
procedure CreateSessionsForDBThreads(FreeSessions: Boolean);
Description
This is called in an ASTA server when the server first starts and initializes the
AstaSessionList when running an ASTA server. If you want ASTA to free the sessions set
it to True. The SessionList can be reinitialized at runtime by freeing and re-calling
CreateSessionsforDBThreads. This would be necessary if the Database is being backed up
and no database connections where allowed.
The following is an example from the AstaDOAServer (Direct Oracle Access) that frees the
SessionList and creates it again.
procedure TFrmMain.ReLogonToAllSessions;
var
i: Integer;
ADM: TastaOracleDataModule;
begin
try
if DM.MainLogon.Session.Connected then DM.MainLogon.Session.LogOff;
DM.MainLogon.Session.LogOn;
mrequests.lines.add('Main Database reconnected');
except
mrequests.lines.add('Problems reconnecting to Main Login' +
EDataBaseError(ExceptObject).Message);
end;
try
//with a single session there is no SessionList
if AstaServerSocket1.ThreadingModel=tmSingleSession then Exit;
for i := 0 to AstaServerSocket1.SessionList.Count - 1 do begin
//walk the session list and type cast and call whatever routines are
needed
//to check to see if it is connected and then re-logon
Adm := AstaServerSocket1.SessionList.GetSession(i) as
TAstaOracleDataModule;
if Adm.MainLogon.Session.Connected then Adm.MainLogOn.Session.LogOff;
Adm.MainLogOn.Session.LogOn;
mrequests.lines.add('Session ' + InttoStr(i) + ' reconnected');
end;
except
mrequests.lines.add('Session List Reconnect Problem.' +
EDataBaseError(ExceptObject).Message);
//try again!!!
AstaServerSocket1.SessionList.Free;
AstaServerSocket1.SessionList := nil;
AstaServerSocket1.CreateSessionsForDbThreads(True);
//this calls the OnDBSupplySession event of the AstaServerSocket
end;
end;
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
TAstaServerSocket.DisconnectClientBroadCaster
TAstaServerSocket
329 / 449
ASTA 3 for Delphi
Declaration
procedure DisconnectClientBroadCaster(ClientSocket: TCustomWinSocket; S:
string; ClientEncryption: Boolean);
Description
Used for ASTA chat tutorials where a list of users is sent to everybody when a client
disconnects. Deprecated with the ASTA Instant messaging API.
Created with the Personal Edition of HelpNDoc: Transform Your Help Documentation Process with a Help
Authoring Tool
TAstaServerSocket.DisconnectClientByLastActivity
TAstaServerSocket
Declaration
procedure DisconnectClientsByLastActivity(SecondsToAllow:Integer);
Description
Verifying Clients connected to an ASTA server.
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
TAstaServerSocket.DisconnectClientSocket
TAstaServerSocket
Declaration
procedure DisconnectClientSocket(ClientSocket: TCustomWinSocket);
Description
This method disconnects a remote socket and is more reliable than
SendClientKillMessageSocket as that depends on an ASTA client responding to the
message from the server.
Security Issues
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaServerSocket.EarlyRegisterSocket
TAstaServerSocket
Declaration
procedure EarlyRegisterSocket(ClientSocket: TCustomWinSocket);
Description
This adds a ClientSocket to the UserList. If you want to communicate with a ClientSocket
in the OnClientConnectevent you must add the ClientSocket to theUserList first by calling
this method.
330 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
TAstaServerSocket.FileSegmentSend
TAstaServerSocket
Declaration
procedure FileSegmentSend(ClientSocket: TCustomWinSocket; P: TAstaParamList);
Description
Used internally to implement FileSegment sends. See the ASTA FileSegment discussion
and tutorial on sending large files.
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
TAstaServerSocket.IsNonVCLClient
TAstaServerSocket
Declaration
function IsNonVCLClient(ClientSocket: TCustomWinSocket): Boolean;
Description
Returns true if the Client is a non-vcl or SkyWire client. See ASTA SkyWire.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with a Help
Authoring Tool
TAstaServerSocket.KillSelectedUsers
TAstaServerSocket
Declaration
procedure KillSelectedUsers(KillMessage: string);
Description
The KillSelectedUsers method is used in conjunction with the UserCheckList property. The
UserCheckList will present a visual list that will allow you to select one or more users.
Once the users have been selected, issuing the KillSelectedUsers command will terminate
the client connections to the server.
TAstaServerSocket.LogServerActivity
TAstaServerSocket
331 / 449
ASTA 3 for Delphi
Declaration
procedure LogServerActivity(LogItems: TAstaLogItems; S: TCustomWinSocket;
const Msg: string);
Description
ASTA servers, by default come with logging turned on but with an option to turn it off. By
definition, logging is an expensive activity and is not thread safe. Writing to a UI
component (TMemo) is not thread safe and eats a lot of CPU cycles.
If you require more granualar control of the logging process, you can define which events
you want the server to log.
You can specify that you want to log all items and add items that you don't want to log to
the NoLogItems property, or you can define the actual items you want logged.
Which checks the LoginOn, LogItems and NoLogItems. If the LogEvent is coded you can
further control if an item is passed through to the log. Only if all the tests passed is
RecordServerActivity actually called.
Note: Problems on ASTA servers are often caused by ASTA users writing logging routines
that are not thread safe. Beware of too much logging!
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
332 / 449
ASTA 3 for Delphi
TAstaServerSocket.ManualBroadCastProviderchanges
TAstaServerSocket
Declaration
procedure ManualBroadCastProviderChanges(const ProviderName, UpdateTableName:
string; D: TAstaDataSet); overload;
procedure ManualBroadCastProviderchanges(Provider: TAstaProvider); overload;
Description
Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents
TAstaServerSocket.NetWorkProviderBroadcast
TAstaServerSocket
Declaration
procedure NetWorkProviderBroadcast(TableName: string);
Description
By calling this method, all TAstaProviders that use the same UpdateTableName will
broadcast to any registered users. This is useful if you have a provider that returns
different fields than other providers yet you want broadcasted changes to go to the same
clients.
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaServerSocket.PdaFastEnable
TAstaServerSocket
Declaration
procedure PdaFastEnable(CodedParamListIntercept: Boolean);
Description
Enables support for Palm and WinCE using the SkyWire API. See ASTA SkyWire
discussion.
Created with the Personal Edition of HelpNDoc: Maximize Your CHM Help File Capabilities with HelpNDoc
TAstaServerSocket.PublishedDirectoriesFromRegistry
TAstaServerSocket
Declaration
function PublishedDirectoriesFromRegistry: TAstaDataSet;
Description
Returns an in memory DataSet that represents the "Aliases" used in the Remote
Directory Components. This DataSet can be edited and then any changes can be updated
to the registry by calling UpdatePublishedDirectoriesToRegistry, This call creates a
TAstaDataSet which you are responsible for disposing of.
333 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
TAstaServerSocket.PublishServerDirectories
TAstaServerSocket
Declaration
procedure PublishServerDirectories;
Description
Allows server side directories to be "aliased" and made available for ASTA clients to view
and send files back and forth from using the TAstaRemoteDirectory component.
TAstaServerSocket.RecordServerActivity
TAstaServerSocket
Declaration
procedure RecordServerActivity(S: TCustomWinSocket; Msg: string);
Description
If you have coded the OnShowServerMessage event of the TAstaServerSocket, then
RecordServerActivity will call that event. This is used internally by ASTA to show
threading information and other database activity.
Created with the Personal Edition of HelpNDoc: Free CHM Help documentation generator
TAstaServerSocket.RegisterClientAutoUpdate
TAstaServerSocket
Declaration
procedure RegisterClientAutoUpdate;
Description
In order to take advantage of ASTA's built-in automatic client update capabilities, you
must register the new client executable at the server. RegisterClientAutoUpdate brings
up a dialog that will allow you to browse for any EXE's that you want your remote clients
to have available. There is also a remote interface available to allow you to see all
available server EXE's and allow you to update the list (which is stored in the registry),
and even to send EXE's to the server to be placed in the correct directory. Se also
AstaClientSocket.RequestUtilityInfo for more details
334 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaServerSocket.RegisterDataModule
TAstaServerSocket
Declaration
procedure RegisterDataModule(DM: TComponent)
Description
This is called at the startup of an ASTA server and all of the TDataSet descendents,
TAstaProviders and TAstaBusinessObjectManagers are registered so that they can be seen
by ASTA clients.
Example
AstaServerSocket1.RegisterDataModule(Self);
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease
TAstaServerSocket.RemoteAddressAndPort
TAstaServerSocket
Declaration
function TAstaServerSocket.RemoteAddressAndPort(Socket: TCustomWinSocket):
string;
Descripiton
Provides a quick and easy way to return a string representing a ClientSocket's remote
address and port number.
Created with the Personal Edition of HelpNDoc: Free help authoring tool
TAstaServerSocket.RequestPing
TAstaServerSocket
Declaration
procedure RequestPing(SecondsToAllow:Integer);
Description
Verifying Clients connected to an ASTA server.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaServerSocket.SendAsyncException
TAstaServerSocket
Declaration
procedure SendAsyncException(ClientSocket: TCustomWinSocket; ErrorToken:
335 / 449
ASTA 3 for Delphi
Description
Used to raise an exception on the client when connected asyncronously.
TAstaServerSocket.SendAsyncExceptionUserRecord
TAstaServerSocket
Declaration
procedure SendAsyncExceptionUserRecord(const TheClient: TUserRecord;
ErrorToken:Integer;Const Msg: array of string); overload;
procedure SendAsyncExceptionUserRecord(const TheClient: TUserRecord;
ErrorToken: Integer; TheParamList: TAstaParamList); overload;
Description
Used to raise an exception on the client when connected asyncronously.
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
TAstaServerSocket.SendBroadcastEvent
TAstaServerSocket
Declaration
procedure SendBroadcastEvent(S: string);
Description
There are two methods that allow you to send broadcasts to connected clients.
The fist method, SendBroadcastPopup is intrusive and will display the message in a
ShowMessage dialog box. This type of broadcast is appropriate for administrative
messages.
The second method, SendBroadcastEvent, allows you to broadcast a message and control
the way that it appears at the client. It must be used in conjunction with the
AstaClientSocket's OnServerBroadcast event.
The following code shows how the AstaClientSocket's OnServerBroadcast event would
copy a SendBroadcastEvent method to a memo.
TAstaServerSocket.SendBroadcastPopUp
TAstaServerSocket
336 / 449
ASTA 3 for Delphi
Declaration
procedure SendBroadcastPopUp(S: string);
Description
There are two methods that allow you to send broadcasts to connected clients.
The fist method, SendBroadcastPopup is intrusive and will display the message in a
ShowMessage dialog box. This type of broadcast is appropriate for administrative
messages.
The second method, SendBroadcastEvent, allows you to broadcast a message and control
the way that it appears at the client. It must be used in conjunction with the
AstaClientSocket's OnServerBroadcast event.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TAstaServerSocket.SendClientKillMessage
TAstaServerSocket
Declaration
procedure SendClientKillMessage(TheClient: TUserRecord; KillMessage: string);
Description
SendClientKillMessage will disconnect the remote client after showing the KillMessage.
The client application will be terminated unless the
AstaClientSocket.OnTerminateMessageFromServer is coded. For extended security use
DisconnectClientSocket so as not to allow another ASTA user to code a client application
that ignores kill messages.
Security Issues
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaServerSocket.SendClientKillMessageSocket
TAstaServerSocket
Declaration
procedure SendClientKillMessageSocket(Socket: TCustomWinSocket; KillMessage:
string);
Description
SendClientKillMessageSocket will disconnect the remote socket after showing the
KillMessage.
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
TAstaServerSocket.SendClientPopupMessage
Declaration
Description
337 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Revolutionize Your CHM Help File Output with HelpNDoc
TAstaServerSocket.SendCodedMessage
TAstaServerSocket
Declaration
procedure SendCodedMessage(ClientSocket: TCustomWinsocket; MsgID: Integer;
Msg: string);
Description
SendCodedMessage allows you to send special messages throughout an ASTA application.
The SendCodedMessage method allows you to roll your own protocol where certain
MsgIDs have specific meaning to your application. The ability to create your own protocol
in this fashion is a simple yet powerful technique. See the Simple Business Objects code
below.
The simple code below sends a message from a client to the server, but the message is
sent with two different MsgIDs. The server will handle the message differently depending
on which of the MsgIDs, 1700 or 1750, accompanies the message.
338 / 449
ASTA 3 for Delphi
if MyBusinessObject.ChargeSalesTax(StrToInt(Msg)) then
AstaServerSocket1.SendCodedMessage(ClientSocket, MsgID,
'TRUE')
else
AstaServerSocket1.SendCodedMessage(ClentSocket, MsgID,
'FALSE');
end;
1850: begin
AstaServerSocket1.SendCodedMessage(ClientSocket, MsgID,
MyBusinessObject.NewCreditLimit(Msg));
end;
end;
end;
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
TAstaServerSocket.SendCodedMessageSocket
TAstaServerSocket
Declaration
procedure SendCodedMessageSocket(const TheClient: TUserRecord; MsgID: integer;
const Msg: string);
Description
Same as SendCodedMessage but takes a TUserRecord rather than a ClientSocket:
TCustomWinSocket.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's User-Friendly UI
TAstaServerSocket.SendCodedParamList
TAstaServerSocket
Declaration
procedure SendCodedParamList(ClientSocket: TCustomWinSocket; MsgID: Integer;
Params: TAstaParamList);
Description
SendCodedParamList allows you to send special messages throughout an ASTA
application. The SendCodedParamList method allows you to roll your own protocol where
certain MsgIDs have specific meaning to your application. The ability to create your own
protocol in this fashion is a simple yet powerful technique. See
AstaClientSocket.OnCodedParamlist on how to code this procedure on the client. Normally
messaging calls are not threaded but ASTA Servers by default will thread messages that
use SendGetCodedParamList. If you want to thread messages sent from the server then
you must use the AstaServerSocket. ThreadedUtilityEvent.
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
339 / 449
ASTA 3 for Delphi
TAstaServerSocket.SendCodedParamListSocket
TAstaServerSocket
Declaration
procedure SendCodedParamListSocket(TheClient: TUserRecord; MsgID: Integer;
Params: TAstaParamList);
Description
SendCodedParamListSocket works just like SendCodedParamList except it passes in a full
copy of the UserRecord which the TAstaThread copies when it is created. This allows a
thread safe use of the UserRecord since it is a copy and not the actual UserRecord of the
AstaServerSocket.UserList.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaServerSocket.SendCodedStream
TAstaServerSocket
Declaration
procedure SendCodedStream(ClientSocket: TCustomWinSocket; MsgID: Integer; MS:
TMemoryStream);
Description
The SendCodedStream compliments the SendCodedMessage method. It can be used to
send streams throughout an ASTA application. The client server and then the server can
respond with a custom action according to the MsgID. The following code demonstrates
the usage.
The server responds by loading a memo into a stream and sending it to the client.
The client receives the stream and displays it in a memo and saves it to a file.
340 / 449
ASTA 3 for Delphi
TAstaServerSocket.SendCodedStreamSocket
TAstaServerSocket
Declaration
procedure SendCodedStreamSocket(const TheClient: TUserRecord; MsgID: integer;
MS: TMemoryStream);
Description
Same as SendCodedStream but takes a UserRecord rather than a ClientSocket:
TCustomWinSocket.
TAstaServerSocket.SendExceptionToClient
TAstaServerSocket
Declaration
procedure SendExceptionToClient(TheSocket: TcustomWinSocket; ErrorList:
TAstaParamList); overload;
procedure SendExceptionToClient(TheSocket: TcustomWinSocket; ErrorMsg:
string); overload;
Descripiton
This sends the ErrorMsg to an ASTA client and raises an exception on the client.
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaServerSocket.SendInstantMessage
TAstaServerSocket
Declaration
function SendInstantMessage(Origin: TUserRecord; UserName: string; MsgID:
integer; Params: TAstaParamList): Boolean;
Description
Used internally by the Asta IMA (Instant Message API) to sends an Instant Message to a
specific user.
341 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaServerSocket.SendSelectCodedMessage
TAstaServerSocket
Declaration
procedure SendSelectCodedMessage(MsgID: Integer; S: string);
Description
This property is used in conjunction with the UserCheckList property. You can place an "x"
next to one or more users and server messages will be selectively broadcast to the
selected users. Coded messages allow you to create your own protocol (see
SendCodedMessage) for details.
Example
TAstaServerSocket.SendSelectPopupMessage
TAstaServerSocket
Declaration
procedure SendSelectPopupMessage(S: string);
Description
This property is used in conjunction with the UserCheckList property. You can place an "x"
next to one or more users and server messages will be selectively broadcast to the
selected users.
Example
342 / 449
ASTA 3 for Delphi
TAstaServerSocket.SendUserNameCodedParamList
TAstaServerSocket
Declaration
function SendUserNameCodedParamList(Origin: TUserRecord; UserName: string;
MsgID: integer; Params: TAstaParamList): Boolean;
Description
Used Internally by the Asta IMA (Instant Message API) to sends an Instant Message to a
specific user by UserName.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaServerSocket.SessionCount
TAstaServerSocket
Declaration
function SessionCount: Integer;
Description
Returns the number of Database Sessions if running Pooled or Smart Threading.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaServerSocket.SetAESKey
TAstaServerSocket
Declaration
procedure SetAESKey(AKey: PAESKey128; KeyType: AesKeyType);
Description
Low level call to set the AES Keys. SetAESKeyStrings is recommended.
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaServerSocket.SetAESKeyStrings
TAstaServerSocket
Declaration
procedure SetAESKeyStrings(const InKey, OutKey: string);
Description
Sets AES Encryption Keys. Make sure the InKey on the server is the OutKey on the client
and the OutKey on the server is the InKey on the client.
343 / 449
ASTA 3 for Delphi
by-Step Guide
TAstaServerSocket.SetDESKey
TAstaServerSocket
Declaration
procedure SetDESKey(AKey: PDESKey);
Description
Low level call to Set the DES key. SetDESStringKey is recommended.
Created with the Personal Edition of HelpNDoc: Ensure High-Quality Documentation with HelpNDoc's
Hyperlink and Library Item Reports
TAstaServerSocket.SetDESStringKey
TAstaServerSocket
Declaration
procedure SetDESStringKey(const AKey: string);
Description
Sets the key if you are using DES Encryption.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaServerSocket.StatelessClient
TAstaServerSocket
Declaration
function StatelessClient(Clientsocket: TCustomWinSocket): Boolean; overload;
function StatelessClient(U: TUserRecord): Boolean; overload;
Description
Returns True if the client is running stateless. This could be an HTTP client, a blocking
client or a SkyWire Client.
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
TAstaServerSocket.ThreadedDBUtilityEvent
TAstaServerSocket
Declaration
procedure ThreadedDBUtilityEvent(ClientSocket: TCustomWinSocket; QueryToUse:
TThreadDBAction; CustomEvent: TAstaDBUtilityEvent; Params: TAstaParamList);
344 / 449
ASTA 3 for Delphi
Description
Asta servers are non-blocking and event driven so normal messaging calls are not
threaded. You can have ASTA launch a thread in response to a message from any ASTA
client and ASTA will also make available some database components for you to use in the
thread. If you do not need access to any database calls use ThreadedUtilityEvent. Set the
QueryToUse parameter to the type of query component you need like ttSelect or ttExec.
The following shows the use of the ThreadedDBUtilityEvent event from an ASTA server.
Notice the AstaServerSocket SendCodedParamListSocket call which uses the
ThreadedClient copy of the UserRecord. Note: If a client is disconnected at this point the
thread will be marked as terminated, so perhaps a call to if not
TAstaThread(Sender).HasTerminted then Exit is needed before the actual send is made.
This example assumes that the TestUtilSQLEvent is being called from within
OnCodedParamList on the server which gets called with a
ClientSocket:TCustomWinSocket and an incoming Params: TAstaParamList. In this
example a request is made for a component that can handle SQLSelects by passing in
ttSelect. ThreadedDBSupplyQuery is called with ttSelect to return the Query:TComponent
that can be used safely in the thread. The TestUtilSQLEvent must be of type
TAstaDBUtilityEvent.
345 / 449
ASTA 3 for Delphi
TAstaServerSocket.ThreadedUtilityEvent
TAstaServerSocket
Declaration
procedure ThreadedUtilityEvent(ServerSocket: TAstaServerSocket; ClientSocket:
TCustomWinSocket; CustomEvent: TAstaUtilityEvent; P: TAstaParamList);
Description
Asta servers are non-blocking and event driven so normal messaging calls are not
threaded. You can have ASTA launch a thread in response to a message from any ASTA
client. If you want to use some database calls in this event use the
ThreadedDBUtilityEvent.
The ServerSocket is passed in so that you do not have to access the ServerSocket directly
across Thread boundries. The ClientSocket is the actual Socket that is available to each
client connected to the server. The CustomEvent your own custom procedure submitted
for
threading. It must be a threaded procedure and should take the following format of its
declaration which is declared as TAstaUtilityEvent.
Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents
TAstaServerSocket.UpdatePublishedDirectoriesToRegistry
TAstaServerSocket
Declaration
procedure UpdatePublishedDirectoriesToRegistry(D: TAstaDataSet);
Description
Updated the registry replacing the contents that map to "Aliases" used in the Remote
Directory Components. The TAstaDataSet is fired obtained by calling
PubliishedRemoteDirectoriesFromRegistry.
346 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
TAstaServerSocket.User
TAstaServerSocket
Declaration
function User(ClientSocket: TCustomWinSocket): TUserRecord; overload;
function User(UserName: string): TUserRecord; overload;
Description
Returns the TUserRecord by using the ClientSocket (TCustomWinSocket) or UserName.
Note: ASTA 3 uses the ClientSocket.Data (Pointer) to store a pointer to the UserRecord so
DO NOT use this property.
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
TAstaServerSocket.UserRecordNil
TAstaServerSocket
Declaration
function TAstaServerSocket.UserRecordNil(const TheClient: TUserRecord):
Boolean;
Description
Returns True if TheClient is NIL.
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAstaServerSocket.UseThreads
TAstaServerSocket
Declaration
function UseThreads(TheClient: TUserRecord = nil): TAstaThreadModel;
Description
Returns the TAstaThreading Model for any client. Used in tmSmartThreading where users
use Pooled Sessions by default but any single user can run a persistent session and
switch back and forth from pooled to persistent.
Created with the Personal Edition of HelpNDoc: Transform Your Help Documentation Process with a Help
Authoring Tool
TAstaServerSocket.UseThreadsSocket
TAstaServerSocket
Declaration
function UseThreadsSocket(ClientSocket: TCustomWinSocket): TAstaThreadModel;
347 / 449
ASTA 3 for Delphi
Description
Returns the TAstaThreading Model for any client. Used in tmSmartThreading where users
use Pooled Sessions by default but any single user can run a persistent session and
switch back and forth from pooled to persistent.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TAstaServerSocket.UtilityInfo
TAstaServerSocket
Declaration
Description
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
TAstaServerSocket.ValidSocket
TAstaServerSocket
Declaration
function ValidSocket(ClientSocket: TCustomWinSocket): Boolean;
Description
Returns true if the ClientSocket is not nil and is valid using the same low level Winsock
call as VerifyClientConnection. ValidSocket will not force a disconnect if invalid but
VerifyClientConnection will.
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
TAstaServerSocket.VerifyClientConnection
TAstaServerSocket
Declaration
procedure VerifyClientConnection(S: TCustomWinSocket);
Description
Called internally by the TAstaServerSocket whenever a TCP/IP error is raised, this call
uses a low level Winsock API call to verify the client and if not valid force a disconnect.
Created with the Personal Edition of HelpNDoc: Transform Your Word Doc into a Professional-Quality
eBook with HelpNDoc
TAstaServerSocket.VerifyClientConnections
TAstaServerSocket
Declaration
procedure VerifyClientConnections;
348 / 449
ASTA 3 for Delphi
Description
Calls VerifyClientConnection for every connected client in the AstaServerSocket. UserList.
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
Events
TAstaServerSocket
LogEvent
OnAccept
OnAddDataModule
OnAssignPersistentSession
OnAstaClientUpdate
OnAstaClientUpdateDecide
OnBeforeProcessToken
OnBeforeServerMethod
OnChatLine
OnCheckOutSession
OnCheckInSession
OnClientAuthenticate
OnClientConnect
OnClientDBLogin
OnClientExceptionMessage
OnClientLogin
OnClientValidate
OnCodedMessage
OnCodedParamList
OnCodedStream
OnCompress
OnCustomAutoIncFormat
OnDecompress
OnDecrypt
OnEncrypt
OnExecRowsAffected
OnExecSQLParamList
OnFetchBlobEvent
OnFetchMetaData
OnInsertAutoIncrementFetch
OnInstantMessage
OnOutCodedDBParamList
OnOutCodedParamList
OnPersistentFieldTranslateEvent
OnProviderCompleteTransaction
OnProviderConvertParams
OnProviderSetParams
OnServerQueryGetParams
OnServerQuerySetParams
OnShowServerMessage
OnStatelessClientCheckIn
OnStatelessClientCookie
OnStatelessPacketEvent
OnStoredProcedure
OnSubmitSQL
OnSubmitSQLParams
OnTransactionBegin
OnTransactionEnd
OnTrigger
349 / 449
ASTA 3 for Delphi
OnTriggerDefaultValue
OnUserEncryption
OnUserListChange
OnUserRecordStateChange
ThreadedDBSupplyQuery
ThreadedDBSupplySession
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaServerSocket.LogEvent
TAstaServerSocket
Declaration
procedure LogEvent(ClientSocket: TCustomWinSocket; const Msg: string);
Description
ASTA servers, by default come with logging turned on but with an option to turn it off. By
definition, logging is an expensive activity and is not thread safe. Writing to a UI
component (TMemo) is not thread safe and eats a lot of CPU cycles.
If you require more granualar control of the logging process, you can define which events
you want the server to log.
You can specify that you want to log all items and add items that you don't want to log to
the NoLogItems property, or you can define the actual items you want logged.
350 / 449
ASTA 3 for Delphi
Which checks the LoginOn, LogItems and NoLogItems. If the LogEvent is coded you can
further control if an item is passed through to the log. Only if all the tests passed is
RecordServerActivity actually called.
Note: Problems on ASTA servers are often caused by ASTA users writing logging routines
that are not thread safe. Beware of too much logging!
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
TAstaServerSocket.OnAccept
TAstaServerSocket
Declaration
property OnAccept: TSocketNotifyEvent;
Description
Occurs on server sockets just after the connection to a client socket is accepted. For more
information see the TServerSocket.OnAccept in the Delphi help file.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaServerSocket.OnAddDataModule
TAstaServerSocket
Declaration
property OnAddDataModule: TAddDataModuleEvent;
Description
This allows you to add multiple data modules to ASTA servers for support of ASTA server
side components and to perform any intialization for the additional data module.
Traditionally, a main data module will contain a TDataBase type of component that will
need to be used by the additional data module.
In order for ASTA to properly thread ASTA Servers, data modules need to be created by
ASTA on demand and OnAddDataModule allows this to occur.
Example
351 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnAssignPersistentSession
TAstaServerSocket
Declaration
property OnAssignPersistentSession: TAstaServerAssignPersistentSession;
TAstaServerAssignPersistentSession=
procedure(Sender:TObject;TheClient:TUserRecord;UserName,Password:String;Var
PersistentSession:TComponent;var Verified:Boolean) of object;
Description
ASTA 3 introduces ASTA SmartThreading which allows for the server to scale using Pooled
Database Sessions but to also allow for any client to be able to run a "PersistentSession"
that gives them their own Database Connection.
If you want any user to be able to use their Database UserName and Password you can
code the OnAssignPersistentSession event and create a DataModule, which will contain
your Database connection component and connect using the UserName and Password
from the remote ASTA client. You must use assign Var PersistentSessionTComponent to
the DataModule you create and you must also set Verified To true if you want the remote
client to be allowed to connect to the server. This PersistentSession:TComponent wil then
be available on the server in the TUserRecord.DatabaseSession event.
Example
Below is an example of the Asta3ADOServer. In this case, if a user has the name of
'PersistentSessions' then a datamodule will be created for that user. There is a client
example in the SmartThreading Example Directory to match this server.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaServerSocket.OnAstaClientUpdate
TAstaServerSocket
Declaration
property OnAstaClientUpdate: TAstaAutoClientUpateEvent;
type TAstaAutoClientUpdateEvent = procedure(Sender: TObject;
UserName, AppName, OldVer, NewVer: string) of object;
352 / 449
ASTA 3 for Delphi
Description
The OnAstaClienUpdate event allows you to keep a server log or database record of which
users have been updated.To control which clients are allowed to get new versions see the
OnAstaClientUpdateDecide event. To be able to manage different versions of client exe's
that are available for udpates on the server, see Automatic Client Updates.
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
TAstaServerSocket.OnAstaClientUpdateDecide
TAstaServerSocket
Declaration
property OnAstaClientUpateDecide: TAstaClientUpgradeDecideEvent;
type TAstaClientUpgradeDecideEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; AppName, OldVer,
UserName: string; var AllowUpgrade: Boolean) of object;
Description
The OnAstaClientUpdateDecide event allows you to control whether remote clients have a
new client exe streamed down to them. The ApplicationName, OldVer and UserName
arguments are passed to the event and it's up to you to set the AllowUpgrade argument
to False. The default is True to allow for upgrades.
Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy
TAstaServerSocket.OnBeforeProcessToken
TAstaServerSocket
Declaration
property OnBeforeProcessToken: TAstaBeforeProcessTokenEvent;
type TAstaBeforeProcessTokenEvent = procedure(Sender: TObject; TheClient:
UserRecord; Token: TAstaToken; var Allow: Boolean) of object;
Description
This event is fired before any token is processed. A token is the type of message that is
being received from a client.The primary use of this is to make some sort of restriction on
what operations can be performed by certain user names etc. If you set allow to False, an
exception will be raised on the client.
This is a low level call is not only used to heavily customize a server. Typically this event
is not required to be coded.
As an example, take a user "TestUser" and you want to restrict it to only run server
methods:
353 / 449
ASTA 3 for Delphi
See Also
OnBeforeServerMethod
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
TAstaServerSocket.OnBeforeServerMethod
TAstaServerSocket
Declaration
property OnBeforeServerMethod: TAstaBeforeServerMethodEvent;
type TAstaBeforeServerMethodEvent = procedure(Sender: TObject; TheClient:
UserRecord; MethodName: string; var Allow: Boolean) of object;
Description
This event is fired before any server method is run. It allows you a central place to make
security restrictions on which server methods can be run by which users.If you set allow
to False, an exception will be raised on the client. As an example, take a user "TestUser"
and you want to restrict it to only run a particular server method "GetUserList":
See Also
OnBeforeProcessToken
TAstaServerSocket.OnChatLine
TAstaServerSocket
Declaration
property OnChatLine: TAstaServerSendStringsEvent;
Description
The OnChatLine event allows you to take action when chat messages are passed through
the sever. The following code, for instance, displays the messages in a memo at the
server.
354 / 449
ASTA 3 for Delphi
begin
ReceiveMemo.Lines.Add(S);
end;
You could stream the memo to a file or perhaps save it to a database on a daily basis.
Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced
Customization Options
TAstaServerSocket.OnCheckOutSession
TAstaServerSocket
Declaration
property OnCheckOutSession: TServerCheckOutSession;
TServerCheckOutSession = procedure (Sender: TObject; At: TAstaThread;
ClientSocket: TCustomWinSocket; Session: TComponent) of object;
Description
This event will fire whenever a Database Session is "checked Out" this event will fire. If
there is any housekeeping you want to do on a DataModule you can code this event. The
Session:TComponent parameter will be the main Datamodule created in
ThreadedDBSupplySession when the server starts up in Pooled Threading.
TAstaServerSocket.OnCheckInSession
TAstaServerSocket
Declaration
property OnCheckInSession: TServerCheckOutSession;
TServerCheckOutSession = procedure (Sender: TObject; At: TAstaThread;
ClientSocket: TCustomWinSocket; Session: TComponent) of object;
Description
This event will fire whenever a Database Session is "checked in " this event will fire. If
there is any housekeeping you want to do on a DataModule you can code this event. The
Session:TComponent parameter will be the main Datamodule created in
ThreadedDBSupplySession when the server starts up in Pooled Threading.
355 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnClientAuthenticate
TAstaServerSocket
Declaration
property OnClientAuthenticate: TAstaClientAuthenticateEvent;
type TAstaClientAuthenticateEvent = procedure (Sender: TObject; Client:
TUserRecord; Name, Password, AppName: string; ClientParamList:
TAstaParamList; var LoginVerified: Boolean; var PersistentSession:
TComponent) of object;
Description
The OnClientAuthenticate provides the Authentication Event of the Login Process where
you can
Every remote client logging in will send a Username and Password to the Asta server as
well as extra items that were added to the TAstaClientSocket.ClientSocketParams which
are merged into the UserRecord.ParamList. Set the LoginVerified parameter to
authenticate the client and optionally fill the ClientParamList with any values you want
passed back that will appear in the TAstaClientSocket.OnLoginParamsAttempt event. If
you want the user to have a specific Database Session, create a DataModule and assign it
to the PersistentSession:TComponent event. Users can move between Pooled and
Persisent Sessions using ASTA Smart Threading and this event is also used for that
purpose.
Example
LoginVerified := True;
end;
Created with the Personal Edition of HelpNDoc: Easily create EPub books
356 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnClientConnect
TAstaServerSocket
Declaration
property OnClientConnect: TSocketNotifyEvent;
Description
Occurs when a client socket completes a connection accepted by the server socket.. For
more information see the TServerSocket.OnClientConnect in the Delphi help file.
The ClientSocket has not been added to the UserList when this event occurs so if you
want to send a message to a client socket from this event you must call
EarlyRegisterSocket.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of HelpNDoc for
CHM Help File Generation
TAstaServerSocket.OnClientDBLogin
TAstaServerSocket
Declaration
property OnClientDBLogin: TAstaLoginEvent;
type TAstaDBLoginEvent = procedure(Sender: TObject; TheUserName, ThePassword,
TheAppName: string; var Verified: Boolean; var ADataBase: TComponent) of
object;
Description
Supported in ASTA 3 for ASTA 2 compatibility but the new OnClientAuthenticate event is
recommended.
OnClientDBLogin is implemented when you want to have your remote users use their
database user name and password or to have them to have access to a different server
database, and is used primarily with the PersistentSession threading model. For normal
logins use the OnClientLogin. If you want to validate IP addresses before the login use
OnClientValidate.
Note: The Verified parameter returns the results of the attempt to the client. If you
verification attempt succeeds then set Verified to True, if it fails, set Verified to False. If
you want the client to be automatically disconnected then set
DisconnectClientOnFailedLogin to True in which case nothing will be returned to the client
but they will be immediately disconnected from the server.
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
TAstaServerSocket.OnClientExceptionMessage
TAstaServerSocket
Declaration
property OnClientExceptionMessage: TServerExceptionEvent;
type TServerExceptionEvent = procedure (Sender: TObject; ClientSocket:
TCustomWinSocket; var ErrorMsg: string) of object;
357 / 449
ASTA 3 for Delphi
Description
ASTA servers are coded so that typical database requests from clients that raise
exceptions are sent back using SendExceptionToClient. By coding the
OnClientExceptionMessage you can intercept any exceptions raised by your database and
re-word them for your client application.
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaServerSocket.OnClientLogin
TAstaServerSocket
Declaration
property OnClientLogin: TAstaLoginEvent;
type TAstaLoginEvent = procedure(Sender: TObject; UserName, Password, AppName:
string; var Verified: Boolean) of object;
Description
Assign code to this event handler if you wish to provide login routines using the
AstaClientSocket's AutoLoginDlg property. If you wanted to compare an AstaClient's user
name and password input against a list of valid user names and passwords that you
maintain, this is the place to do it. The TAstaClientSocket has a corresponding
OnLoginAttempt event.
Note: The Verified parameter returns the results of the attempt to the client. If you
verification attempt succeeds then set Verified to True, if it fails, set Verified to False.
The following code simply adds the user name, password and the application name to a
memo on the server.
TAstaServerSocket.OnClientValidate
TAstaServerSocket
Declaration
property OnClientValidate: TValidateSocketEvent;
type TValidateSocketEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; var IsValid: Boolean) of object;
Description
Use this event if you want to validate remote clients on connection. This occurs before the
358 / 449
ASTA 3 for Delphi
Example
Security Issues
Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and
software
TAstaServerSocket.OnCodedMessage
TAstaServerSocket
Declaration
property OnCodedMessage: TAstaServerSendcodedMessageEvent;
type TAstaServerSendCodedMessage = procedure (Sender: TObject; Clientsocket:
TCustomWinSocket; Msgid, MsgToken: Integer) of object;
Description
The OnCodedMessage event handler allows you to take customized application action
according your own custom messages that have been sent via an AstaClientSocket's
SendCodedMessage method.
The following code shows how the server might respond upon receiving certain messages.
Created with the Personal Edition of HelpNDoc: Ensure High-Quality Documentation with HelpNDoc's
Hyperlink and Library Item Reports
359 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnCodedParamList
TAstaServerSocket
Declaration
property OnCodedParamList: TAstaServerParamEvent;
Description
The OnCodedParam event handler allows you to take customized application action
according your own custom messages that have been sent via an AstaClientSocket's
SendCodedParamList method.
Note: when the AstaclientSocket uses SendGetCodedParamList the incoming parameters
will be automatically returned to the client by ASTA, so it is up to you to clear the
parameters and add any parameters you would like to be returned to the client.
The following code shows how the server might respond upon receiving certain messages.
case Params[I].DataType of
ftBytes, ftBlob, ftGraphic:
begin
LogIt(' Params[' + IntToStr(I) + '] -> Blob Size ' +
IntToStr(Length(Params[I].AsString)))
end;
else
LogIt(' Params[' + IntToStr(I) + '] ->' + Params[I].AsString);
end;
case Msgid of
100: if (Pos('zip', Params[I].Name) > 0) and
(Params[I].DataType = ftBlob) then
begin
M := TMemoryStream(Params[I].AsStream);
M.SaveToFile(Params[I].Name);
LogIt('Save to disk: ' + Params[I].Name);
M.Free;
end;
1500: begin
Params.Clear;
AstaServerSocket1.ThreadedDBUtilityEvent(ClientSocket,
ttSelect, TestUtilEvent, Params);
end;
1550: AstaServerSocket1.ThreadedDBUtilityEvent(ClientSocket,
ttSelect, TestUtilSQLEvent, Params);
360 / 449
ASTA 3 for Delphi
1600: begin
Params.Clear;
AstaServerSocket1.ThreadedUtilityEvent(ClientSocket,
TestPlainUtilEvent, Params);
end;
1800: begin
ChangeThreadingModel(ClientSocket,
TAstaThreadModel(Params[0].AsInteger),
Params[1].AsInteger);
end;
1801: begin
Params.Clear;
Params.FastAdd(ord(AstaServerSocket1.ThreadingModel));
Params.FastAdd(AstaServerSocket1.DataBaseSessions);
end;
1900: begin
//this requires persisentsessions threading
dm := TAstaDataModule(AstaServerSocket1.SessionList.
GetSessionFromSocket(ClientSocket, ''));
if dm <> nil then LogIt(dm.Name);
end;
2001: begin
if FileExists(Params[0].AsString) then begin
M := TMemoryStream.Create;
M.LoadFromFile(Params[0].AsString);
M.Position := 0;
LogIt(Params[0].AsString + ' ' + IntToStr(M.Size));
Params.Clear;
params.Fastadd('');
Params[0].AsStream := M;
M.Free;
end
else
Params.Clear;
end;
end;
end;
end;
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TAstaServerSocket.OnCodedStream
TAstaServerSocket
Declaration
property OnCodedStream: TAstaServerStreamEvent;
Description
The OnCodedStream event is similar to the OnCodedMessage event, the MsgID allows
you to create your own protocol codes and then take custom action corresponding to that
code. The OnCodedStream event handler is for handling streams and blobs. See the
SendCodedStream method.
The following code takes a stream from the server, and as dictated by the user-defined
850 protocol code, it displays the stream in a memo field, then writes it to a file.
361 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Upgrade your help files and your workflow with
HelpNDoc's WinHelp HLP to CHM conversion
TAstaServerSocket.OnCompress
TAstaServerSocket
Declaration
property OnCompress: TAstaServerStringEvent;
Description
This event handler allows you to add code to compress messages before they are sent
across the network. It should be noted that compression/decompression routines will
have performance considerations. Compressing large messages before they are sent over
slow network connections is sensible. Compressing small messages before transmission
over fast LANs may actually impede performance. It might take longer to
compress/decompress the data then it takes for the data to travel across the network.
NOTE: If you add compression routines, you must add decompression routines. You must
place your code in the appropriate event handlers (OnCompress and OnDecompress) of
the AstaClientSocket and the AstaServerSocket.
ASTA Compression
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
TAstaServerSocket.OnCustomAutoIncFormat
TAstaServerSocket
Declaration
property OnCustomAutoIncFormat: TAstaServerCustomAutoIncFormat;
type TAstaServerCustomAutoIncFormat = procedure(Sender: TObject; TheDatabase,
TheTableName: string; var TheAutoIncrementValue: string);
Description
Allows for the customization of the AutoIncValue.
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaServerSocket.OnDecompress
TAstaServerSocket
362 / 449
ASTA 3 for Delphi
Declaration
property OnDecompress: TAstaServerStringEvent;
Description
This event handler allows you to add code to decompress messages after they have been
sent, in an encrypted form, across the network. It should be noted that
compression/decompression routines will have performance considerations. Compressing
large messages before they are sent over slow network connections is sensible.
Compressing small messages before transmission over fast LANs may actually impede
performance. It might take longer to compress/decompress the data then it takes for the
data to travel across the network.
NOTE: If you add compression routines, you must add decompression routines. You must
place your code in the appropriate event handlers (OnCompress and OnDecompress) of
the AstaClientSocket and the AstaServerSocket.
ASTA Compression
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaServerSocket.OnDecrypt
TAstaServerSocket
Declaration
property OnDecrypt: TAstaServerStringEvent;
type TAstaServerStringEvent = procedure(Sender: TObject; TheClient:
TUserRecord; var S: string) of object;
Description
The OnDecrypt event handler allows you to add code for decrypting an encrypted
message.
Note: If you add encryption routines to the OnEncrypt event handlers, then you must add
decryption routines to the OnDecrypt event handlers. You must place your code in the
appropriate event handlers (OnEncrypt and OnDecrypt) of the AstaClientSocket and the
AstaServerSocket.
Example
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
TAstaServerSocket.OnEncrypt
TAstaServerSocket
Declaration
363 / 449
ASTA 3 for Delphi
Description
The OnEncrypt event handler allows you to add code for encrypting a message before
transmitting it across a network.
Note: If you add encryption routines to the OnEncrypt event handlers, then you must add
decryption routines to the OnDecrypt event handlers and of course the Server and Client
must use the same Encryption scheme. You must place your code in the appropriate
event handlers (OnEncrypt and OnDecrypt) of the AstaClientSocket and the
AstaServerSocket. The Sender:TObject on the AstaServer is a
ClientSocket:TCustomWinSocket. Using the ClientSocket you are able to access the
UserRecord to provide stronger encyrption with multiple keys.
There are many third party components that can be used to secure your ASTA
applications. Because of US export laws ASTA cannot supply strong encryption routines as
part of ASTA.
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator
TAstaServerSocket.OnExecRowsAffected
TAstaServerSocket
Declaration
property OnExecRowsAffected: TAstaServerRowsAffectedEvent;
type TAstaServerRowsAffectedEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; AQuery: TComponent; var RowsAffected: Integer) of object;
Description
Previously ASTA users had to code the OnExecSQLParamList of the AstaServerSocket to
send back a custom message to the AstaClientSocket to retrieve this information.
Example
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
364 / 449
ASTA 3 for Delphi
website
TAstaServerSocket.OnExecSQLParamList
TAstaServerSocket
Declaration
type TAstaServerExecSQLParamListEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; AQuery: TComponent;
DataBaseStr, SQLString: string; var TheResult: Boolean;
var Msg: string; ParamList: TAstaParamList) of object;
Description
This is the event coded that allows Exec statements to work for ASTA clients. ASTA clients
will send in parameterized queries that appear as the SQLString and ParamList
parameters. The server must be able to handle parameterized queries in order to be able
to update and insert blobs and memos. To support the RowsAffected property of the
AstaClientDataSet the OnExecRowsAffected Event of the AstaServer must be coded.
Here is an example from the AstaBDEServer. Depending on the threading model in effect,
the AQuery parameter will be supplied by the ThreadedDBSupplyQueryEvent . Since ASTA
suports any type of component for use with ASTA servers, the example below type casts
the AQuery parameter as a BDE TQuery since this example was from the AstaBDEServer.
365 / 449
ASTA 3 for Delphi
ftDatetime: TQuery(AQuery).Params[i].AsDateTime :=
ParamList[i].AsDateTime;
ftBlob,
ftGraphic: TQuery(AQuery).Params[i].SetBlobData(
pchar(ParamList[i].AsString),
Length(ParamList[i].AsString));
ftMemo: TQuery(AQuery).Params[i].AsMemo :=
ParamList[i].AsString;
end;
end;
TQuery(AQuery).ExecSQL;
TheResult := True;
except
begin
Msg := EDataBaseError(ExceptObject).Message;
LogIt('Exec SQL Error->' + Msg);
end;
end;
end;
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TAstaServerSocket.OnFetchBlobEvent
TAstaServerSocket
Declaration
property OnFetchBlobEvent: TAstaFetchBlobEvent;
type TAstaFetchBlobEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinsocket; AQuery: TComponent;
DataBaseStr, TableName, FieldName, WhereString: string;
var M: TMemoryStream) of object;
Description
In order to to fetch a single blob from an ASTA server this event must be coded. The
following is an example from the AstaBDEServer.
366 / 449
ASTA 3 for Delphi
case TQuery(AQuery).FieldByName(FieldName).DataType of
ftMemo: TMemoField(TQuery(AQuery).FieldByName(
FieldName)).SaveToStream(M);
ftBlob,
ftGraphic: TBlobField(TQuery(AQuery).FieldbyName(
FieldName)).SaveToStream(M);
end;
end;
except
LogException(ClientSocket, Exception(exceptObject).Message, True);
end;
end;
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaServerSocket.OnFetchMetaData
TAstaServerSocket
Declaration
type TAstaServerMetaDataEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; MetaRequest: TAstaMetaData;
DataBaseStr, Arg1, Arg2: string) of object;
Description
ASTA clients require information about the server database, and coding the OnFetchMetaData event is
required for ASTA clients to be able to fetch tablenames, fieldnames, index information, foreign key
information, stored procedure names and columns and other assorted server database information.
AstaClientDataSets trigger this server side event using their MetaDataRequest property.
The OnFetchMetaData event is currently NOT threaded and will return the
AstaServerSocket.MetaDataSet to ASTA clients.
The following is an abridged version of the OnFetchMetaData event as coded on the AstaBDEServer. An
important point is that whatever request that comes in from the client, the MetaData property is set on the
TAstaServerSocket so that the correct information is streamed back to ASTA clients. The AstaBDEServer
uses the ASTA component AstaBDEInfoTable to retrieve BDE information and the AstaODBCInfoDataSet to
retrieve meta data information using components from www.odbcexpress.com. Source is available for these
two ASTA units on request from ASTA registered users.
procedure TForm1.AstaServerSocket1FetchMetaData(Sender: TObject;
ClientSocket: TCustomWinSocket; MetaRequest: TAstaMetaData;
DataBaseStr, Arg1, Arg2: string);
var
i: Integer;
begin
try
case MetaRequest of
mdIndexes, mdPrimeKeys, mdForeignKeys:
begin
LogIt('Index Info for ' + Arg1);
IndexInfoTable.Close;
IndexInfoTable.TableName := Trim(Arg1);
AdjustBDEInfoDatabaseName(DataBaseStr, IndexInfoTable);
IndexInfoTable.Active := True;
if AstaDataSet1.Active then AstaDataSet1.Empty;
AstaDataSet1.CloneFieldsFromDataSet(IndexInfoTable,
False, False);
IndexDataTransfer(IndexInfoTable, AstaDataSet1);
AstaServerSocket1.MetaDataSet := AstaDataSet1;
end;
mdStoredProcColumns:
begin
//ODBC and the BDE create different column names and types.
367 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Easily create EPub books
TAstaServerSocket.OnInsertAutoIncrementFetch
TAstaServerSocket
Declaration
property OnInsertAutoIncrementFetch: TAstaAutoIncrementInsertEvent;
type TAstaAutoIncrementInsertEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; AQuery: TComponent; TheDatabase, TheTable,
TheAutoIncField: string; var AutoIncrementValue: Integer) of object;
Description
The OnInsertAutoIncrementFetch event must be coded if you wish to retrieve auto
increment field values at the client. This event is used in conjunction with the
368 / 449
ASTA 3 for Delphi
The above code is specific to your database. For Access, Paradox and Interbase 5.X the
above code should work in calling MAX to get the last value used by the server for an
auto increment field. For MS SQL Server, Sybase, and SQL Anywhere you would need to
write code to access the @@identify variable. The AstaODBC server is already coded to
identify these databases and make the appropriate call.
Created with the Personal Edition of HelpNDoc: Don't be left in the past: convert your WinHelp HLP help
files to CHM with HelpNDoc
TAstaServerSocket.OnInstantMessage
Declaration
Description
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
TAstaServerSocket.OnOutCodedDBParamList
TAstaServerSocket
Declaration
property OnOutCodedDBParamList: TAstaServerOutDBParamEvent;
type TAstaServerOutDBParamEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; DBDataModule: TComponent; MsgID: integer; InParams,
OutParams: TAstaParamList) of object;
Description
This new event is available which will be called in a thread with a datamodule handed off
to you with any and all of your database components. You can also create and destroy DB
components on the fly.
Just Grab the incoming Params and fill up the OutParams and they will be transported
back to the client in a thread. if an exception occurs it will be raised at the client. or you
can raise it yourself on the server to be transported back to the client.
369 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnOutCodedParamList
TAstaServerSocket
Declaration
property OnOutCodedParamList: TAstaServerOutParamEvent;
type TAstaServerOutParamEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; MsgID: integer; InParams, OutParams: TAstaParamList) of
object;
Description
OnOutCodedparamlist supports SendGetCodedParamList calls from the AstaClientSocket.
These calls "block or wait". On the server, the Incoming Params from the client are
passed in as inParams. On the server, just use any of the InParams and fill up the
OutParams with any value you want and they will be returned to the client in a thread.
Example
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
TAstaServerSocket.OnPersistentFieldTranslateEvent
TAstaServerSocket
Declaration
property OnPersistentFieldTranslateEvent: TAstaFieldTranslate;
type TAstaFieldTranslate = procedure (Sender:TObject; DataSet: TDataSet;
Field: TField; var NewField: TField) of object;
Description
When coding ASTA servers using Providers and ServerMethods persistent Fields can be
defined on the server changing things like display labels and displaywidth. This is one of
the benefits of server side programming allowing these changes to be coded once and
then used on client apps with no changes needed to remote clients.
ASTA supports this by default in streaming down all persistent Fields properties from
370 / 449
ASTA 3 for Delphi
There are problems however when the Delphi 3rd Party Database components on the
server user Fields Types that don't exist on the client. An example of this, which has
bitten many an ASTA user is the TIBStringField used in IBExpress instead of a
TStringField. Of course remote clients know nothing of "IB" specific classes as remote
ASTA thin clients are world citizens with no alligiance to any specific DataBase.
To allow the best of allow worlds the AstaServerSocket now has a new event named
OnPersisentFieldTranslate that is of type TAstaFieldTranslate.
Created with the Personal Edition of HelpNDoc: Don't be left in the past: convert your WinHelp HLP help
files to CHM with HelpNDoc
TAstaServerSocket.OnProviderCompleteTransaction
TAstaServerSocket
Declaration
property OnProviderCompleteTransaction: TAstaProviderCompleteTransactionEvent;
type TAstaProviderCompleteTransactionEvent = procedure(Sender: TObject;
TransactionCommitted: Boolean; const Providers: array of TAstaProvider) of
object;
Description
When using AstaSocket.SendProviderTransaction from remote clients to send multiple
ClientDataSets, connected to a TAstaProvider, to the server in one server round trip, the
OnProviderCompleteTransaction event will fire after all operations from all providers are
successfull or at first failure. The TransactionCommited:Boolean param signifies the
success of the transaction.
This is useful if you want to hand craft your own Provider broadcasts with ASTA Provider
manual broadcast options.
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites
371 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnProviderConvertParams
TAstaServerSocket
Declaration
type TAstaProviderConvertParams = procedure(Sender :TObject;
D: TDataSet; P: TAstaParamList; var Converted: Boolean) of object;
Description
This method along with the OnProviderSetParams method of the TAstaServerSocket allows
TAstaProviders using TDataSets that do not have a TParams, Params property to be supported by
ASTA.
Example
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
TAstaServerSocket.OnProviderSetParams
TAstaServerSocket
Declaration
type TAstaProviderSetParams = procedure(Sender: TObject;
D: TDataSet; P: TAstaParamList) of object;
Description
This method along with the OnProviderConvertParams method of the TAstaServerSocket
allows TAstaProviders using TDataSets that do not have a TParams, Params property to be
supported by ASTA.
Example
372 / 449
ASTA 3 for Delphi
TAstaServerSocket.OnServerQueryGetParams
TAstaServerSocket
Declaration
Description
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TAstaServerSocket.OnServerQuerySetParams
TAstaServerSocket
Declaration
property OnServerQuerySetParams: TAstaServerQuerySetParams;
type TAstaServerQuerySetParams = procedure(Sender: TObject;
ClientSocket:TCustomWinSocket; Query:TComponent; ParamList: TAstaParamList)
of object;
Description
When parameterized queries are sent from remote ASTA clients the originate from the
TAstaClientDataSet.Params property which is type TAstaParamList. Since ASTA supports
any Delphi 3rd party DataSet Components on ASTA servers, those AstaParamLists need to
be translated to the param type supported by the Delphi 3rd party Database component
used on the server. On Both Select and Exec SQL, a typical ASTA server implementation
will call ServerSetSQLParams which internally uses the OnServerQuerySetParams event.
See also:
OnSubmitSQLParams
OnProviderSetParams
373 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Modernize your help files with HelpNDoc's WinHelp HLP
to CHM conversion tool
TAstaServerSocket.OnShowServerMessage
TAstaServerSocket
Declaration
type TAstaServerShowMessageEvent = procedure(Sender: TObject;
Msg: string) of object;
Description
This event is used internally by ASTA servers to record server activity. You may want to
have this write to a log file. Note there is a performance penalty of course for writing to a
TMemo on an ASTA server so you should be able to turn this off in production. To control
logging on an ASTA server code this event and use the LogOn property.
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator
TAstaServerSocket.OnStatelessClientCheckIn
Declaration
374 / 449
ASTA 3 for Delphi
Description
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaServerSocket.OnStatelessClientCookie
Declaration
Description
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaServerSocket.OnStateLessPacketEvent
Declaration
Description
Created with the Personal Edition of HelpNDoc: Make the switch to CHM with HelpNDoc's hassle-free
WinHelp HLP to CHM conversion tool
TAstaServerSocket.OnStoredProcedure
TAstaServerSocket
Declaration
property OnStoredProcedure: TAstaServerStoredProcEvent;
type TAstaServerStoredProcEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; AQuery: TComponent; DataBaseStr, StoredProcName: string;
ClientParams: TAstaParamList; NoResultSet: Boolean) of object;
Description
This event must be coded to support StoredProcedures using ASTA. The client will send in
the StoredProcName and a TAstaParamList that will contain the parameters for the stored
procedure. If parameters are to be returned, the the ClientParams must be updated. Note
the NoResultSet:Boolean which is required for StoredProcedures that do not return a
result set. The AstaClientDataSet must call ExecSQL when invoking StoredProcedures to
that do not return a result set.
The following is an example from the AstaBDEServer showing how this method can be
coded.
375 / 449
ASTA 3 for Delphi
P: TParam;
begin
try
if TStoredProc(Aquery).Active then
TStoredProc(AQuery).Active := False;
for i := 0 to ClientParams.Count - 1 do
TStoredProc(AQuery).ParambyName(ClientParams[i].Name).Value :=
ClientParams[i].Value;
//TStoredProc(AQuery).Prepare; prepare is now called in the
//setup stored proc call
if NoResultSet then
TStoredProc(Aquery).ExecProc
else
TStoredProc(AQuery).Active := True;
ClientParams.Clear;
for i := 0 to TStoredProc(AQuery).Params.Count - 1 do begin
case TStoredProc(AQuery).Params[i].ParamType of
db.ptOutPut,
db.ptInputOutput,
db.ptResult:
begin
if ClientParams.FindParam(TStoredProc(Aquery).
Params[i].Name) = nil then
ClientParams.CreateParam(TStoredProc(AQuery).
Params[i].DataType,
TStoredProc(AQuery).Params[i].Name,
ParamType(ord(TStoredProc(AQuery).Params[i].
ParamType)));
ClientParams.ParamByName(TStoredProc(AQuery).
Params[i].Name).Value :=
TStoredProc(AQuery).Params[i].Value;
end;
end;
end;
except
LogException(ClientSocket, Exception(ExceptObject).Message,
True);
end;
end;
Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents
TAstaServerSocket.OnSubmitSQL
TAstaServerSocket
Declaration
property OnSubmitSQL: TAstaServerExecSQLEvent;
type TAstaServerExecSQLEvent = procedure(Sender: TObject; AQuery: TComponent;
DataBaseStr, SQLString: string;
var TheResult: Boolean; var Msg: string) of object;
Description
376 / 449
ASTA 3 for Delphi
This is the event coded that allows Select statements to work for ASTA clients. Here is an
example from the AstaBDEServer. Depending on the threading model in effect, the
AQuery parameter will be supplied by the ThreadedDBSupplyQueryEvent . Since ASTA
suports any type of component for use with ASTA servers, the example below type casts
AQuery as a BDE TQuery since this example was from the AstaBDEServer.
TAstaServerSocket.OnSubmitSQLParams
TAstaServerSocket
Declaration
property OnSubmitSQLParams: TAstaParamQueryEvent;
type TAstaParamQueryEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; AQuery: TDataSet; const DataBaseStr, SQLString: string;
SQLParams: TAstaParamList) of object;
Description
This is the event that when coded allows Select statements to work for ASTA clients and
replaces the Asta 2 OnSubmitSQL event which is now deprecated. In ASTA 3 all Params
are no longer expanded on the client but instead passed through to the server. In order
to support this the TAstaServerSocket.OnServerQuerySetParams must be coded.
377 / 449
ASTA 3 for Delphi
end;
Created with the Personal Edition of HelpNDoc: Maximize Your CHM Help File Capabilities with HelpNDoc
TAstaServerSocket.OnTransactionBegin
TAstaServerSocket
Declaration
property OnTransactionsBegin: TAstaBeginTransactionEvent;
type TAstaBeginTransactionEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; Session: TComponent;
TransActionName: string) of object;
Description
This is the event coded that allows a transaction to be started on ASTA servers
Here is an example from the AstaBDEServer. Depending on the threading model in effect,
the Session parameter will be supplied by the ThreadedDBSupplyQueryEvent . In this
case the ThreadedDBSupplyQuery event receives a ttTransactionStart and returns a
TDataBase which the BDE uses to start a transaction with the StartTransaction method.
Since ASTA suports any type of component for use with ASTA servers, the example below
type casts the Session parameter as a BDE TDataBase since this example was from the
AstaBDEServer.
TAstaServerSocket.OnTransactionEnd
TAstaServerSocket
Declaration
property OnTransactionEnd: TAstaEndTransactionEvent;
type TAstaEndTransactionEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; Session: TComponent;
Success: Boolean) of object;
Description
This is the event when coded that ends a transaction on ASTA servers.
378 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
TAstaServerSocket.OnTrigger
TAstaServerSocket
Declaration
property OnFireTrigger: TTriggerEvent;
type TTriggerEvent = procedure(Sender: TObject; SQLString: string; U:
TUserRecord; SQLParser: TAstaSQLParser; P: TAstaParamList; AQuery:
TComponent) of object;
Description
All SQL executed within a transaction on the server from a client initiatied ApplyUpdates
call will also flow through the OnTrigger event. The TAstaSQLParser is available to
deconstruct the SQL so that you can access the UpdateTableName and Fields.
Example
TAstaServerSocket.OnTriggerDefaultValue
TAstaServerSocket
Declaration
property OnTriggerDefaultValue: TTriggerDefaultValueEvent;
type TTriggerDefaultValueEvent = procedure(Sender:TObject; U: UserRecord;
SQLString, Tablename, FieldName: string; P: TAstaParamList; AQuery:
TComponent) of object;
Description
ASTA triggers can be defined by calling the AstaClientSocket.RegisterTrigger event so
that a parameterized query is created when an ApplyUpdates call is made but the Param
will recieve it's value from the server. The value for the field needs to be supplied from
the client application before the login process or on the server within the login event. All
SQL executed within a transaction on the server from a client initiatied ApplyUpdates call
will also flow through the OnTrigger event.
Example
379 / 449
ASTA 3 for Delphi
begin
if (CompareText(tablename,'Customer') = 0) and
(CompareText(fieldname, 'USERID') = 0) then
begin
Logit(' server trigger ' + SQLString);
p.FastAdd('UserID',
u.ParamList.ParamByName('UserID').AsInteger);
end;
end;
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaServerSocket.OnUserEncryption
TAstaServerSocket
Declaration
property OnUserEncryption: TAstaServerEncryptionEvent;
type TAstaServerEncryptionEvent = procedure(Sender: TObject; TUserRecord:
TUserRecord; EncryptIt: Boolean; var TheData: string) of object;
Description
This allows you to add different encryption for each client.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help
Authoring Tool
TAstaServerSocket.OnUserListChange
TAstaServerSocket
Declaration
property OnUserListChange: TUserChangeEvent;
type TUserChangeEvent = procedure(Sender: TObject; Socket: TCustomWinSocket;
AState: TUserRecordState) of object;
Description
This event fires whenever a client is added or removed from the UserList. ClientSockets
are not available in the UserList on the OnClientConnect event. If you want to send a
message to a client socket from the OnClientConnect event, use the EarlyRegisterSocket
method.
The OnUserListChange event used to be passed an IsNew parameter of type Boolean, but
this did not accurately reflect what happened on the server. A remote client first connects
to a server, goes through a login process, and then can be disconnected. The new
parameter of AState: TUserRecordState more accurately reflects the action of the
ClientSocket. TUserRecordState is defined in AstaTypes.pas
Here is an example of the way servers update the UserDataSet that is on the Asta demo
servers. Note: Clients need to come in with login info for this to accurately reflect all
states.
380 / 449
ASTA 3 for Delphi
Append;
FieldbyName('Address').AsString := Address;
case Astate of
tuConnect:
FieldbyName('Activity').AsString := 'Connected';
tuDisconnect:
FieldbyName('Activity').AsString := 'Disconnected';
tuLogin:
FieldbyName('Activity').AsString := 'Login';
end;
FieldByName('Date').AsDATeTime := Now;
Post;
end;
end;
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
TAstaServerSocket.OnUserRecordStateChange
Declaration
Description
Created with the Personal Edition of HelpNDoc: Keep Your Sensitive PDFs Safe with These Easy Security
Measures
TAstaServerSocket.ThreadedDBSupplyQuery
TAstaServerSocket
Declaration
property ThreadDBSupplyQuery: TAstaServerSupplyQueryEvent;
type TAstaServerSupplyQueryEvent = procedure(Sender: TObject; ClientSocket:
TCustomWinSocket; DBAction: TThreadDbAction; DataBaseStr: String;
CreateNew: Boolean; var AQuery: Component; SQLOptions:
TAstaSelectSQLOptionSet) of object;
Description
When an ASTAclient is connected to an ASTA server and it needs to do a Select or an
Exec, or to execute a stored procedure, this routine will be called to create a new
component to be used in the client process. Under the BDE, a TQuery is used for Selects
and Execs and a TStoredProc is used for stored procedures. Under the ODBCExpress
implementation, a TOEDataSet is created for both. The DBAction indicates the type of
process that the component will be used for.
The ThreadedDBSupplyQueryEvent sets the AQuery parameter. This allows you to create
a single component like a TQuery for a specific action, or to use a component that was
created in a data module. In the AstaBDEServer, TQueries or TStoredProcs are created as
381 / 449
ASTA 3 for Delphi
needed. Since individual components are created on the fly, they must be disposed of by
the ASTA server when they have done their tasks. In this case, make sure the
DisposeofQueriesForThreads property is set to True. This will tell the ASTA server to
dispose of these components. In the AstaODBCExpress server example, a complete data
module is created for each thread. In this case, the DisposeOfQueriesForThreads would be
set to false, as any components that are part of a data module will be disposed of when
the DataModule is destroyed.
Note: When ASTA servers utilize the tmPersistentSession Model, and packet fetch
requests are received from AstaClientDataSets, components must be created on the fly
and not used from data modules. In this case, the incoming TThreadDBAction will be set
to ttPacketSelect. See the AstaODBCExpress server for an example of this. Since the
component must be kept open to be able to return further packet requests, it must be
created on the fly.
When running threaded the Sender parameter will come in as a TAstaThread otherwise in
SingleThreaded mode it will be the AstaServerSocket itself.
Example
382 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: iPhone web sites made easy
TAstaServerSocket.ThreadedDBSupplySession
TAstaServerSocket
Declaration
property ThreadDBSupplySession: TAstaSessionCreateEvent;
type TAstaSessionCreateEvent = procedure(Sender: TObject;
ClientSocket: TCustomWinSocket; DataBaseString: string;
var ASession: TComponent) of object;
Description
When Threading ASTA servers, this event must be coded so that ASTA can create
whatever database component is needed to be able to run independently in a thread. This
can be a TDatabase/TSession pair under the BDE, or a data module containing any
components necessary. The ASession parameter is declared as a TComponent to make
this as flexible as is necessary to handle any Delphi database component.
Example
procedure TForm1.AstaServerSocket1ThreadedDBSupplySession(
Sender: TObject; ClientSocket: TCustomWinSocket;
DataBaseString: string; var ASession: TComponent);
var
Sess: TSession;
begin
try
Sess := TSession.Create(nil); //Asta will dispose of it if
//CreateSessionForDBThreads was called with true
ASession := TDataBase.Create(Sess);
with ASession as TDataBAse do begin
DataBaseName := 'db' + IntToStr(AstaServerSocket1.
SessionList.Count);
Name := 'DataBase' + IntToStr(AstaServerSocket1.
SessionList.Count);
AliasName := MainDataBase.AliasName;
LoginPrompt := False;
Params.Assign(MainDatabase.Params);
TransIsolation := MainDataBase.TransIsolation;
Connected := True;
end;
except
LogException(ClientSocket, Exception(exceptObject).Message, True);
end;
end;
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
TAstaSessionList
Unit
AstaSessionList
383 / 449
ASTA 3 for Delphi
Applies to
TAstaServerSocket
Declaration
type TAstaSessionList = class(TObject);
Description
Used internally by ASTA servers to manage database sessions when threaded. In the
Pooled Threading Model at server startup the AstaServerSocket calls
ThreadedDBSupplySession DatabaseSessions number of times to populate the
AstaServerSocket.SessionList in the CreateSessionsForDBThreads method that should be
called in the FormCreate of any AstaServer.
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad
Properties
These properties are used internally by ASTA and under normal use are not required to be
accessed in Applications.
Created with the Personal Edition of HelpNDoc: Don't Let Unauthorized Users View Your PDFs: Learn
How to Set Passwords
TAstaSessionList.FreeSessions
TAstaSessionList
Declaration
property FreeSessions: Boolean;
Description
Determines whether or not ASTA will free up the Sessions created automatically. It is
passed in when the AstaServerSocket.CreateSessionsForDbThreads(FreeSessions:
Boolean) method is called. Typically True should be used in this call.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaSessionList.MaximumAsyncSessions
TAstaSessionList
Declaration
property MaximumAsyncSessions: Integer;
Description
384 / 449
ASTA 3 for Delphi
TAstaSessionList.MaximumSessions
TAstaSessionList
Declaration
property MaximumSessions: Integer;
Description
The session pool expands on demand if a session is not available. The MaximumSessions property will not
allow the pool to expand beyond MaximumSessions. Rememember that 8 sessions could easily be handling
50-100 users or more depending on the size and frequency of client requests.
If MaxiumSessions is reached, the thread will be created and added to a ThreadQueue list. When a running
process is finished, the thread will be popped from the pool and executed using the newly freed up session.
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
TAstaSessionList.StartupSessions
TAstaSessionList
Declaration
property StartupSessions: Integer;
Description
From the AstaServerSocket.DataBaseSessions property. The initial size of the thread pool.
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with
HelpNDoc's built-in SEO
Methods
These properties are used internally by ASTA and under normal use are not required to be
accessed in Applications.
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAstaSessionList.AddASession
TAstaSessionList
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents
385 / 449
ASTA 3 for Delphi
TAstaSessionList.AddASessionSocket
TAstaSessionList
Created with the Personal Edition of HelpNDoc: Free Web Help generator
TAstaSessionList.AddASocketwithSession
TAstaSessionList
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
TAstaSessionList.AddDataModuleToSession
TAstaSessionList
procedure AddDataModuleToSession(Session, NewDM: TComponent);
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
TAstaSessionList.AddPersistentThread
procedure AddPersistentThread(T:TObject);
Created with the Personal Edition of HelpNDoc: Make Help Documentation a Breeze with a Help
Authoring Tool
TAstaSessionList.AddSocketToSession
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TAstaSessionList.FreeAQuery
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
TAstaSessionList.FreeProxyDataModule
386 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's User-Friendly UI
TAstaSessionList.GetActionItemDataModule
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
TAstaSessionList.GetActionItemFromDataModule
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator
TAstaSessionList.GetActionItemFromMethodName
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework
TAstaSessionList.GetAvailableSession
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
TAstaSessionList.GetDataModuleListFromSession
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
TAstaSessionList.GetDataSetFromProxyName
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
387 / 449
ASTA 3 for Delphi
TAstaSessionList.GetPersistentSessionFromSocket
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
TAstaSessionList.GetProviderFromDataModule
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaSessionList.GetProviderFromSession
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
TAstaSessionList.GetQueryFromASocket
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework
TAstaSessionList.GetSession
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's User-Friendly UI
TAstaSessionList.GetSessionData
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
388 / 449
ASTA 3 for Delphi
TAstaSessionList.GetSessionDataFromSocket
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
TAstaSessionList.GetSessionFromSocket
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
TAstaSessionList.GetSmartSession
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
TAstaSessionList.InitSessionData
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaSessionList.InitSessions
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents
TAstaSessionList.MakeAvailable
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
TAstaSessionList.MaxAsyncSessionExceeded
389 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease
TAstaSessionList.PersistentCleanUpSession
Procedure PersistentCleanUpSession(Sender:TObject);
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help
Authoring Tool
TAstaSessionList.ProxyDataModuleIsRegistered
Created with the Personal Edition of HelpNDoc: Easily create iPhone documentation
TAstaSessionList.QueuedCount
function QueuedCount:Integer;
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TAstaSessionList.QueuedProcessCheck
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
TAstaSessionList.QueuedProcessLaunch
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaSessionList.QueueThread
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
TAstaSessionList.RunningPersistentSession
Function RunningPersistentsession(S:PSessionData):Boolean;
390 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Ensure High-Quality Documentation with HelpNDoc's
Hyperlink and Library Item Reports
TAstaSessionList.SessionsInUse
Function SessionsInUse:Integer;
Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle
TAstaSessionList.SetUseFlag
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
HelpNDoc's Project Analyzer
TAstaSessionList.ShrinkSessionList
procedure ShrinkSessionList(newSize:integer);
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
TAstaSessionList.SocketDisposeSession
Created with the Personal Edition of HelpNDoc: Free PDF documentation generator
TAstaSessionList.SocketRegisterProxyDataModule
TAstaSessionList.SocketValidateList
procedure SocketValidateList(ServerSocket:TObject);
Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced
Customization Options
391 / 449
ASTA 3 for Delphi
TAstaSessionList.StoreQueryForPacket
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaSessionList.UpdateAsyncList
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
Events
These properties are used internally by ASTA and under normal use are not required to be
accessed in Applications.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Creation with a Help
Authoring Tool
TAstaSessionList.OnAddDataModule
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAstaSessionList.OnPacketQueryDispose
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
TAstaSessionList.CreateASession
392 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Easily Add Encryption and Password Protection to Your
PDFs
TAstaSQLGenerator
TAstaSQLGenerator
Properties : Events
Unit
AstaSQLGenerate
Declaration
type TAstaSQLGenerator = class(TComponent)
Description
The TAstaSQLGenerator can be used on ASTA servers to generate SQL on the server. The
TAstaServerSocket has a ServerSQLGenerator property to connect to a
TAstaSQLGenerator. It allows server side SQL settings much like the TAstaClientSocket
has to be able to customize the SQL that ASTA generates. TAstaProviders use a
TAstaSQLGenertor to guide them in the SQL syntax that they generate. If no
TAstaSQLGenerator is present, the TAstaProvider will create and release one on the fly.
You need only one TAstaSQLGenerator per ASTA server and they should be on the same
form as the TAstaServerSocket.
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
Properties
TAstaSQLGenerator
DateMaskForSQL
DateTimeMaskForSQL
ServerSQLOptions
SQLDialect
UpdateMode
UpdateSQLSyntax
Created with the Personal Edition of HelpNDoc: Import and export Markdown documents
TAstaSQLGenerator.ServerSQLOptions
TAstaSQLGenerator
Declaration
property ServerSQLOptions: TAstaServerSQLOptions;
Description
The ServerSQLOptions property of the TAstaSQLGenerator on the server allows for full
customization of the SQL that ASTA generates. The ServerSQLOptions set is automatically
filled if the UpdateSQLSyntax property is changed.
ASTA clients and servers can be configured a variety of ways to provide the SQL syntax
used for your database. For a full discussion see SQL Generation.
393 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
Events
TAstaSQLGenerator
OnCustomParamSyntax
OnCustomSQLSyntax
Created with the Personal Edition of HelpNDoc: HelpNDoc's Project Analyzer: Incredible documentation
assistant
TAstaSQLParser
Properties : Methods
Unit
AstaSQLParser
Declaration
type TAstaSQLParser = class(TComponent);
Description
There are times when you want to modify your SQL like changing the WHERE clause,
ORDER BY, fields, tables, HAVING and GROUP BY clauses. The AstaClientDataSet now has
a built in SQL parser that can deconstruct your SQL and allow you to piece it back
together.
The AstaSQLParser can take any SQL by setting the SQL Property.
SQLParser.SQL.Text := YourSQL.Text;
SQLParser.Deconstruct;
Property Description
UpdateTable The table used in the UPDATE statement
394 / 449
ASTA 3 for Delphi
After a call to descontruct the SQL wil have an SQLStatement type of one of
the following:
These properties can also be edited and then Construct called so that the SQL
is reassembled for use.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean
and Efficient User Interface
Properties
TAstaSQLParser
Correlations
DeleteTable
Fields
Group
Having
InsertTable
Order
SQL
SQLOptions
TableIsReadOnly
Tables
UpdateTable
Where
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
TAstaSQLParser.Correlations
TAstaSQLParser
Declaration
property Correlations: TStrings;
Description
Read Correlations to retrieve the list of aliases used in a SELECT statement.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
395 / 449
ASTA 3 for Delphi
TAstaSQLParser.DeleteTable
TAstaSQLParser
Declaration
property DeleteTable: string;
Description
Read DeleteTable to get the table name being deleted in a DELETE SQL statement.
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaSQLParser.Fields
TAstaSQLParser
Declaration
property Fields: TStrings;
Description
Read Fields to retrieve the list of result fields used in a SELECT SQL statement.
Created with the Personal Edition of HelpNDoc: iPhone web sites made easy
TAstaSQLParser.Group
TAstaSQLParser
Declaration
property Group: TStrings;
Description
Read Group to retrieve the list of GROUP BY fields used in a SELECT SQL statement.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TAstaSQLParser.Having
TAstaSQLParser
Declaration
property Having: string;
Description
Read Having to retrieve the HAVING clause of an SQL SELECT statement, if there is one.
Created with the Personal Edition of HelpNDoc: Bring your WinHelp HLP help files into the present with
HelpNDoc's easy CHM conversion
TAstaSQLParser.InsertTable
TAstaSQLParser
396 / 449
ASTA 3 for Delphi
Declaration
property InsertTable: string;
Description
Read InsertTable to get the table name being inserted into in an INSERT SQL statement.
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator
TAstaSQLParser.Order
TAstaSQLParser
Declaration
property Order: TStrings;
Description
Read Order to retrieve the ORDER BY clause of an SQL SELECT statement, if there is one.
Created with the Personal Edition of HelpNDoc: Make CHM Help File Creation a Breeze with HelpNDoc
TAstaSQLParser.SQL
TAstaSQLParser
Declaration
property SQL: TStrings;
Description
Holds the SQL statement to be deconstructed, or created after a call to Construct.
Created with the Personal Edition of HelpNDoc: Easily create EPub books
TAstaSQLParser.SQLOptions
TAstaSQLParser
Declaration
property SQLOptions: TParseSQLOptions;
Description
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
TAstaSQLParser.TableIsReadOnly
TAstaSQLParser
Declaration
property TableIsReadOnly: Boolean;
Description
Returns True if the SQL statement reflects read only acitivty.
Created with the Personal Edition of HelpNDoc: Free help authoring tool
397 / 449
ASTA 3 for Delphi
TAstaSQLParser.Tables
TAstaSQLParser
Declaration
property Tables: TStrings;
Description
Read Tables to retrieve the list of tables used in a SELECT SQL statement.
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
TAstaSQLParser.UpdateTable
TAstaSQLParser
Declaration
property UpdateTable: string;
Description
Read UpdateTable to get the table name being updated in an UPDATE SQL statement.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Creation with a Help
Authoring Tool
TAstaSQLParser.Where
TAstaSQLParser
Declaration
property Where: string;
Description
Read Where to retrieve the WHERE clause of an SQL statement.
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
Methods
TAstaSQLParser
Construct
Deconstruct
SQLStatetmentType
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
TAstaSQLParser.Construct
TAstaSQLParser
Declaration
procedure Construct;
398 / 449
ASTA 3 for Delphi
Description
Creates an SQL statement from all of the deconstructed elements of a TAstaSQLParser.
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and
Passwords
TAstaSQLParser.Deconstruct
TAstaSQLParser
Declaration
procedure Deconstruct;
Description
Breaks the SQL statement down into the properties of the AstaSQLParser: Tables, Group,
Having, Order, Fields, Where and UpdateTable.
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
TAstaSQLParser.SQLStatetmentType
TAstaSQLParser
Declaration
property SQLStatementType: TSQLStatementType;
Description
SQLStatementType returns one of the following:
Value Meaning
stUnknown The type of SQL statement is unknown.
Created with the Personal Edition of HelpNDoc: Step-by-Step Guide: How to Turn Your Word Document
into an eBook
399 / 449
ASTA 3 for Delphi
TAstaThread
Properties
Unit
AstaThread
Declaration
type TAstaThread = class(TThread);
Description
ASTA was designed so that developers would not have to worry about implementing any
threading. ASTA servers are threaded at the ASTA component level.
Properties
TAstaThread
ServerSocket
Session
TheQuery
TheSocket
ThreadDBAction
ThreadedClient
Created with the Personal Edition of HelpNDoc: Transform Your CHM Help File Creation Process with
HelpNDoc
TAstaThread.Data
TAstaThread
Declaration
property Data: Pointer;
Description
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
TAstaThread.DataBase
TAstaThread
Declaration
property DataBase: TComponent;
400 / 449
ASTA 3 for Delphi
Description
Created with the Personal Edition of HelpNDoc: Enhance Your Documentation with HelpNDoc's Advanced
Project Analyzer
TAstaThread.FreeQuery
TAstaThread
Declaration
property FreeQuery: Boolean;
Description
Created with the Personal Edition of HelpNDoc: Effortlessly Spot and Fix Problems in Your
Documentation with HelpNDoc's Project Analyzer
TAstaThread.FreeSessions
TAstaThread
Declaration
property FreeSessions: Boolean;
Description
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaThread.Params
TAstaThread
Declaration
property Params: TAstaParamList;
Description
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites
TAstaThread.ServerSocket
TAstaThread
Declaration
property ServerSocket: TServerSocket;
Description
This is a pointer back to the AstaServerSocket so that the main process AstaServerSocket
is not accessed from the thread. It is safer to typecast this property.
401 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TAstaThread.Session
TAstaThread
Declaration
property Session: TComponent;
Description
This is the component created in Pooled or Persistent Threading, typically a DataModule.
It will be created on the ASTA server in the ThreadedDBSupplyQueryEvent and
OnClientDBLogin events.
Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web
sites
TAstaThread.SessionListHolder
TAstaThread
Declaration
property SessionListHolder: Pointer;
Description
Created with the Personal Edition of HelpNDoc: Effortlessly Edit and Export Markdown Documents
TAstaThread.TheQuery
TAstaThread
Declaration
property TheQuery: TComponent;
Description
This is the component used for the database threading activity and the one called from
AstaServerSocket.ThreadedDBSupplyQuery.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaThread.TheSocket
TAstaThread
Declaration
property TheSocket: TCustomWinSocket;
Description
This is the client socket which is useful if you want to use ASTA messaging calls.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with
HelpNDoc's Stunning User Interface
402 / 449
ASTA 3 for Delphi
TAstaThread.ThreadDBAction
TAstaThread
Declaration
property ThreadDBAction: TThreadDBAction;
Description
This is the type of activity the thread is going to perform and is passed to
ThreadedDBSupplyQuery to return the appropriate component for the thread process.
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAstaThread.ThreadedClient
TAstaThread
Declaration
property ThreadedClient: TUserRecord;
Description
When a TAstaThread is created it makes a copy of the UserRecord for use within the
thread.
Methods
TAstaThread
Created with the Personal Edition of HelpNDoc: Powerful and User-Friendly Help Authoring Tool for
Markdown Documents
TAstaThread.AddToPersistentList
Declaration
procedure AddToPersistentList;
Description
Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle
TAstaThread.HasTerminated
Declaration
function HasTerminated: Boolean;
403 / 449
ASTA 3 for Delphi
Description
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaThread.MakeSessionAvailable
Declaration
procedure MakeSessionAvailable;
Description
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaThread.PerformanceString
Declaration
function PerformanceString(S: string): string;
Description
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
HTML5 template
TAstaThread.ResetQueryForThread
Declaration
procedure ResetQueryForThread;
Description
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaThread.ResetServerMethodForThread
Declaration
procedure ResetServerMethodForThread;
Description
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaThread.Run
Declaration
404 / 449
ASTA 3 for Delphi
procedure Run;
Description
Created with the Personal Edition of HelpNDoc: From Word to ePub or Kindle eBook: A Comprehensive
Guide
TAstaThread.SetUserRecord
Declaration
procedure SetUserRecord(U: TUserRecord);
Description
Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through
a beautiful website
Events
TAstaThread
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TAstaThread.CustomDBUtilityEvent
Declaration
property CustomDBUtilityEvent: TAstaDBUtilityEvent;
Description
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with
HelpNDoc's User-Friendly UI
TAstaThread.CustomUtilEvent
Declaration
property CustomUtilEvent: TAstaUtilityEvent;
Description
Created with the Personal Edition of HelpNDoc: Transform Your Help Documentation Process with a Help
Authoring Tool
TAstaThread.OnAfterExecute
TAstaThread
405 / 449
ASTA 3 for Delphi
Declaration
property OnAfterExecute: TTreadDBEvent;
Description
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
TAstaThread.OnExecute
Declaration
property OnExecute: TTreadDBEvent;
Description
Created with the Personal Edition of HelpNDoc: Effortlessly create a professional-quality documentation
website with HelpNDoc
TUserRecord
Properties : Methods
Unit
AstaTypes
Declaration
type TUserRecord = class(TObject);
Description
The TAstaServerSocket maintains a list of connected users using the UserList. Each item in the UserList is
an TObject Descended of Type TUserRecord. On any server side routine where a client is accessing the
server, you will be presented with a ClientSocket:TCustomWinSocket which you can use as a key to return
a UserRecord. Note: Even though the UserRecord is stored in the UserList, ASTA 3 keeps a pointer to the
UserRecord in the ClientSocket.Data:Pointer property so you can call
AstaServerSocket.User(ClientSocket) to return a TUserRecord which just performs a type cast.
The UserRecord contains all kinds of information about the remote user including UserName,Application
name and also an AstaParamList that can be used to store any kind of extra data. The UserRecord will also
provider information to know what kind of client, like a tcp/ip or stateless or Palm, Java or WinCE client.
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
Properties
TUserRecord
AppName
AppVersion
ClientSideSQL
406 / 449
ASTA 3 for Delphi
ClientSocket
ConnectTime
Cookie
DatabaseSession
EncryptKey
MaxResponseSize
ParamList
RemoteUser
Serversocket
UserList
UserName
Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's
Documentation Tool
TUserRecord.AppName
TUserRecord
Declaration
property AppName:String;
Description
Returns the ApplicationName as defined in the TAstaClientSocket.ApplicationName and is
passed from the Client to the Server as part of the Login Process and is also presented on
the server during authentication in the TAstaServerSocket.OnClientAuthenticate Event.
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TUserRecord.AppVersion
TUserRecord
Declaration
property AppVersion:String;
Description
Returns the ApplicationVersion as defined in the TAstaClientSocket.ApplicationVersion
and is passed from the Client to the Server as part of the Login Process and is also
presented on the server during authentication in the
TAstaServerSocket.OnClientAuthenticate Event.
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TUserRecord.ClientSideSQL
TUserRecord
Declaration
property ClientSideSQL:Boolean;
Description
Allows security to be set to allow for specific clients to be able to execute client side sql
via selects and execSQL.
407 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Free CHM Help documentation generator
TUserRecord.Clientsocket
TUserRecord
Declaration
property ClientSocket:TCustomWinSocket;
Description
Returns the TCustomWinSocket that corresponds to the remote user.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
TUserRecord.ConnectTime
TUserRecord
Declaration
property ConnectTime:TDateTime;
Description
Returns the date and time that the client connected to the server.
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with
HelpNDoc
TUserRecord.Cookie
TUserRecord
Declaration
property Cookie:Integer;
Description
Used for Stateless Http Authentication.
Created with the Personal Edition of HelpNDoc: Make Your PDFs More Secure with Encryption and
Password Protection
TUserRecord.DatabaseSession
TUserRecord
Declaration
property DatabaseSession:TComponent;
Description
When using SmartThreading and a specific user has been given their own
PersistentSession this will point to the DataModule used for that session for the user.
408 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily
TUserRecord.EncryptKey
TUserRecord
Declaration
Description
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TUserRecord.MaxResponseSize
TUserRecord
Declaration
property MaxResponseSize:Integer;
Description
Used for ASTA transport where message size must be limited. First implemented for use
with ASTA "C" transport for embedded devices. Contact ASTA for more information on
this transport.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1
single source
TUserRecord.OnStateChange
TUserRecord
Declaration
Description
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with
HelpNDoc's Intuitive Interface
TUserRecord.ParamList
TUserRecord
Declaration
property ParamList:TAstaParamList;
Description
A TAstaParamList that can be used to store any kind of information from remote clients.
When the AstaClientSocket connects to a remote server, the ClientSocketParams are
409 / 449
ASTA 3 for Delphi
TUserRecord.RemoteUser
TUserRecord
Declaration
property RemoteUser:TRemoteUser;
TRemoteUserType=(trWin32,trJava,trPalm,trWince,tuForceDisconnect, trUnicode,
trRim,trLinux,trLinuxPda,trDotNet, trThreadedMessage);
TRemoteUser= set of TRemoteUserType;
Description
Contains detailed information that applies to non vcl clients.
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TUserRecord.ServerSocket
TUserRecord
Declaration
property ServerSocket:TObject;
Description
Contains a pointer to the TAstaServerSocket which can be accessed via a typecast.
Created with the Personal Edition of HelpNDoc: Why Microsoft Word Isn't Cut Out for Documentation:
The Benefits of a Help Authoring Tool
TUserRecord.UserList
TUserRecord
Declaration
property UserList:TObject;
Description
Contains a pointer to the TAstaServerSocket.UserList which can be accessed via a
typecast.
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TUserRecord.UserName
TUserRecord
410 / 449
ASTA 3 for Delphi
Declaration
property UserName:String;
Description
Contains the UserName that is presented on the
TAstaServerSocket.OnClientAuthnenticate event and originates in the
TAstaClientSocket.UserName property.
Created with the Personal Edition of HelpNDoc: Transform Your Word Document into a Professional
eBook with HelpNDoc
Methods
TUserRecord
Function SkyWire:Boolean;
Function IsJava:Boolean;
Function PersistentSession:Boolean;
Function IsValid : Boolean;
Function IsPalm:Boolean;
Function IsRemotePda:Boolean;
Function isStateless:Boolean;
Created with the Personal Edition of HelpNDoc: Effortlessly Create Encrypted, Password-Protected PDFs
TUserRecord.PersistentSession
Function PersistentSession:Boolean;
Created with the Personal Edition of HelpNDoc: Effortlessly Support Your Windows Applications with
HelpNDoc's CHM Generation
TUsers
Properties Methods
Unit
AstaTypes
Declaration
type TUsers = class(TList);
Description
The AstaServerSocket maintains a UserList which is type TUsers and contains
TUserRecords.
Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator
411 / 449
ASTA 3 for Delphi
Methods
Declaration
Description
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
Properties
Declaration
Description
Created with the Personal Edition of HelpNDoc: Easily create Help documents
TAstaParamItem
Properties : Methods
Unit
AstaParamList
Description
A TAstaParamList is similar to the TParams property in the Delphi TQuery, except that
each param can be streamed across the Internet and can contain any type of data
including binary, other ParamLists and even datasets. Each Param member is of type
TAstaParamItem which has the following properties:
Name: string;
ParamType: TAstaParamType;
DataType: TFieldType;
IsNull: Boolean;
Size: Integer;
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's
WinHelp HLP to CHM conversion feature
Properties
TAstaParamItem
AsBlob
AsBoolean
AsCurrency
AsDataSet
AsDate
AsDateTime
AsDispatch
AsFloat
AsGUID
412 / 449
ASTA 3 for Delphi
AsInteger
AsLargeInt
AsMemo
AsObject
AsParamList
AsSmallint
AsStream
AsString
AsTime
AsWord
DataType
IsInput
IsNull
IsOutput
Name
ParamType
Size
Text
Value
Created with the Personal Edition of HelpNDoc: Effortlessly optimize your documentation website for
search engines
TAstaParamItem.AsBlob
TAstaParamItem
Declaration
property AsBlob: string;
Description
Set AsBlob to assign the value for a blob field to the parameter. Setting AsBlob will set
the DataType property to ftBlob. Since long strings are just like buffers, binary values can
safely be handled and are stored internally as strings.
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaParamItem.AsBoolean
TAstaParamItem
Declaration
property AsBoolean: Boolean;
Description
Set AsBoolean to assign the value for a boolean field to the parameter. Setting AsBoolean
will set the DataType property to ftBoolean.
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
TAstaParamItem.AsCurrency
TAstaParamItem
Declaration
413 / 449
ASTA 3 for Delphi
Description
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaParamItem.AsDataSet
TAstaParamItem
Declaration
property AsDataSet: TDataSet;
Description
Set AsDataSet to assign the value for a dataset field (Delphi 4 and higher) to the
parameter. Setting AsDataset will set the DataType property to ftDataSet in Delphi 4 and
higher and to ftString in Delphi 3.
When using this as a function you are responsible for disposing of the dataset. Internally
it calls the CloneDataSetToString and StringToDataSet.
Created with the Personal Edition of HelpNDoc: Elevate Your Help Documentation with a Help Authoring
Tool
TAstaParamItem.AsDate
TAstaParamItem
Declaration
property AsDate: TDateTime;
Description
Set AsDate to assign the value for a date field to the parameter. Setting AsDate will set
the DataType property to ftDate;
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAstaParamItem.AsDateTime
TAstaParamItem
Declaration
property AsDateTime: TDateTime;
Description
Set AsDateTime to assign the value for a datetime field to the parameter. Setting
AsDateTime will set the DataType property to ftDateTime.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
TAstaParamItem.AsDispatch
TAstaParamItem
414 / 449
ASTA 3 for Delphi
Declaration
property AsDispatch: Pointer;
Description
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of HelpNDoc for
CHM Help File Generation
TAstaParamItem.AsFloat
TAstaParamItem
Declaration
property AsFloat: Double;
Description
Set AsFloat to assign the value for a float field to the parameter. Setting AsFloat will set
the DataType property to ftFloat.
Created with the Personal Edition of HelpNDoc: Free Kindle producer
TAstaParamItem.AsGUID
TAstaParamItem
Declaration
property AsGUID: TGUID;
Description
Created with the Personal Edition of HelpNDoc: Transform Your CHM Help File Creation Process with
HelpNDoc
TAstaParamItem.AsInteger
TAstaParamItem
Declaration
property AsInteger: Integer;
Description
Set AsInteger to assign the value for a integer field to the parameter. Setting AsInteger
will set the DataType property to ftInteger.
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TAstaParamItem.AsLargeInt
TAstaParamItem
This applies to Delphi 4 and BCB4 and higher only
Declaration
415 / 449
ASTA 3 for Delphi
Description
Set AsLargeInt to assign the value for a large int field to the parameter. Setting
AsLargeInt will set the DataType property to ftLargeInt.
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help
Authoring Tool
TAstaParamItem.AsMemo
TAstaParamItem
Declaration
property AsMemo: string;
Description
Set AsMemo to assign the value for a memo field to the parameter. Setting AsMemo will
set the DataType property to ftMemo
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease
TAstaParamItem.AsObject
TAstaParamItem
Declaration
property AsObject: TObject;
Description
Set AsObject to assign the value for a pointer field to the parameter. Setting AsObject
will set the DataType property to ftBlob.
Note: this is used internally by ASTA to pass some pointer values using ParamLists. These
pointers are meaningless beyond the local machine boundry.
Created with the Personal Edition of HelpNDoc: Bring your WinHelp HLP help files into the present with
HelpNDoc's easy CHM conversion
TAstaParamItem.AsParamList
TAstaParamItem
Declaration
property AsParamList: TAstaParamList;
Description
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaParamItem.AsSmallint
TAstaParamItem
416 / 449
ASTA 3 for Delphi
Declaration
property AsSmallInt: SmalllInt;
Description
Set AsSmallInt to assign the value for a small int field to the parameter. Setting
AsSmallInt will set the DataType property to ftSmallInt.
Created with the Personal Edition of HelpNDoc: 5 Reasons Why a Help Authoring Tool is Better than
Microsoft Word for Documentation
TAstaParamItem.AsStream
TAstaParamItem
Declaration
property AsStream: TMemoryStream;
Description
Set AsStream to assign the value for a memo field to the parameter. Setting AsStream
will set the DataType property to ftBlob When using this property as a function, the caller
is resposonsible for disposing of the stream.
Example
var
m: TMemoryStream;
begin
//The Param list creates a stream that *must* be disposed of.
m := Params[0].AsStream;
//do something
m.Free;
end;
Created with the Personal Edition of HelpNDoc: Easily create iPhone documentation
TAstaParamItem.AsString
TAstaParamItem
Declaration
property AsString: string;
Description
Set AsString to assign the value for a string field to the parameter. Setting AsString will
set the DataType property to ftString.
Created with the Personal Edition of HelpNDoc: Easily create Help documents
TAstaParamItem.AsTime
TAstaParamItem
Declaration
property AsTime: TDateTime;
Description
417 / 449
ASTA 3 for Delphi
Set AsTime to assign the value for a time field to the parameter. Setting AsTime will set
the DataType property to ftTime.
Created with the Personal Edition of HelpNDoc: Quickly and Easily Convert Your Word Document to an
ePub or Kindle eBook
TAstaParamItem.AsWord
TAstaParamItem
Declaration
property AsWord: Word;
Description
Set AsWord to assign the value for a word field to the parameter. Setting AsWord will set
the DataType property to ftWord
Created with the Personal Edition of HelpNDoc: Keep Your PDFs Safe from Unauthorized Access with
These Security Measures
TAstaParamItem.DataType
TAstaParamItem
Declaration
property DataType: TFieldType;
Description
Indicates the type of field whose value the parameter represents. DataType is set
automatically when a value is assigned to the parameter.
Read DataType to discover the type of data that was assigned to the parameter. Each
possible value of DataType corresponds to a type of database field.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaParamItem.IsInput
TAstaParamItem
Declaration
function TAstaParamItem.IsInput: Boolean;
Description
A quick way to check if a TAstaParamItem is an input parameter.
Created with the Personal Edition of HelpNDoc: Add an Extra Layer of Security to Your PDFs with
Encryption
TAstaParamItem.IsNull
TAstaParamItem
Declaration
property IsNull: Boolean;
Description
418 / 449
ASTA 3 for Delphi
Indicates whether the value assigned to the parameter is NULL (blank). Inspect IsNull to
discover if the value of the parameter is NULL, indicating the value of a blank field. NULL
values can arise in the following ways:
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaParamItem.IsOutput
TAstaParamItem
Declaration
function TAstaParamItem.IsOutput: Boolean;
Description
A quick way to check if a TAstaParamItem is an output parameter.
Created with the Personal Edition of HelpNDoc: Protect Your Confidential PDFs with These Simple
Security Measures
TAstaParamItem.Name
TAstaParamItem
Declaration
property Name: string;
Description
Use Name to identify a particular parameter within a TParams object. Name is the name
of the parameter, not the name of the field the value of which the parameter represents.
Created with the Personal Edition of HelpNDoc: Free Web Help generator
TAstaParamItem.ParamType
TAstaParamItem
Declaration
property ParamType: TAstaParamType
Description
Objects that use TParam objects to represent field parameters set ParamType to indicate
the use for the parameter. ParamType must be one of the following values:
Value Meaning
ptUnknown Unknown or undetermined. Before executing a stored
procedure, the application must set parameters of this type
to another kind.
419 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Efficiency with a Help
Authoring Tool
TAstaParamItem.Size
TAstaParamItem
Declaration
Property Size: Integer;
Description
Size of the param value. For blobs, memos and streams this will return the actual stored
size.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaParamItem.Text
TAstaParamItem
Declaration
property Text: string;
Description
Set the Text property to assign the value of the parameter to a string without changing
the DataType. Unlike the AsString property, which sets the value to a string and changes
the DataType, setting the text property converts the string to the datatype of the
parameter, and sets the value accordingly. Thus, use AsString to treat the parameter as
representing the value of a string field. Use Text instead when assigning a value that is in
string form, when making no assumptions about the field type. For example, Text is
useful for assigning user data that was input using an edit control.
Reading the Text property is the same as reading the AsString property.
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
420 / 449
ASTA 3 for Delphi
website
TAstaParamItem.Value
TAstaParamItem
Declaration
property Value: Variant;
Description
Represents the value of the parameter as a Variant. Use Value in generic code that
manipulates the values of parameters without needing to know the field type the
parameters represent.
Created with the Personal Edition of HelpNDoc: Elevate Your Help Documentation with a Help Authoring
Tool
Methods
TAstaParamItem
Add
AssignField
AssignParam
AssignStdParam
AssignTo
AssignToStdParam
Clear
FindParam
GetDataSize
IsInput
LoadFromFile
LoadFromStream
ParamByName
SetBlobData
Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your
documentation
TAstaParamItem.Add
TAstaParamItem
Declaration
function Add: TAstaParamItem;
Description
Adds a TAstaParamItem and returns it as a result. See FastAdd for a fast, easy way to
add parameter items to a TAstaParamList.
Example
421 / 449
ASTA 3 for Delphi
end;
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool
TAstaParamItem.AssignField
TAstaParamItem
Declaration
procedure AssignField(Field: TField);
Description
Assigns the value of the TAstaParamItem from a TField.
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator
TAstaParamItem.AssignParam
TAstaParamItem
Declaration
procedure AssignParam(Dest: TAstaParamItem);
Description
Assigns all the properties of the TAstaParamItem to Dest (TAstaParamItem).
Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator
TAstaParamItem.AssignStdParam
TAstaParamItem
Declaration
procedure AssignStdParam(Src: TParam);
Description
Allows you to assign a standard Delphi TParam to a TAstaParamItem.
Created with the Personal Edition of HelpNDoc: Upgrade Your Documentation Process with a Help
Authoring Tool
TAstaParamItem.AssignTo
TAstaParamItem
Declaration
procedure TAstaParamItem.AssignTo(Dest: TPersistent);
Description
If Dest is a TField, AssignTo assigns the Value of the TAstaParamItem to it. Otherwise it
expects Dest to be a TAstaParamItem.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
422 / 449
ASTA 3 for Delphi
TAstaParamItem.AssignToStdParam
TAstaParamItem
Declaration
procedure AssignToStdParam(Dest: TParam);
Description
Allows you to assign a TAstaParamItem to a standard Delphi TParam.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
TAstaParamItem.Clear
TAstaParamItem
Declaration
procedure Clear;
Description
Empties the AstaParamList.
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaParamItem.FindParam
TAstaParamItem
Declaration
function FindParam(ParamName: string): TAstaParamItem;
Description
This is similar to the TParam.FindParam and returns nil if it does not find the ParamName.
Created with the Personal Edition of HelpNDoc: Easily create EBooks
TAstaParamItem.GetDataSize
TAstaParamItem
Declaration
function GetDataSize: Integer;
Description
Returns the size in bytes of the internal storage used by AstaParamItems.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaParamItem.IsBlob
TAstaParamItem
Declaration
function IsBlob: Boolean;
423 / 449
ASTA 3 for Delphi
Description
Created with the Personal Edition of HelpNDoc: Effortlessly create a professional-quality documentation
website with HelpNDoc
TAstaParamItem.LoadFromFile
TAstaParamItem
Declaration
procedure TAstaParamItem.LoadFromFile(FileName: string);
Description
Assigns a TAstaParamItem value from data contained in a file. Internally this creates a
TFileStream, does a load from file and stores the value using TAstaParamItem.AsStream.
Created with the Personal Edition of HelpNDoc: Converting Word Documents to eBooks: A Step-by-Step
Guide with HelpNDoc
TAstaParamItem.LoadFromStream
TAstaParamItem
Declaration
procedure TAstaParamItem.LoadFromStream(Stream: TStream);
Description
Assigns the data from a stream to the TAstaParamItem value calling AsStream which sets
the DataType to ftBlob.
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
TAstaParamItem.ParamByName
TAstaParamItem
Declaration
function ParamByName(ParamName: string): TAstaParamItem;
Description
This is similar to the FindParam function and returns NIL if the ParamName is not found.
Created with the Personal Edition of HelpNDoc: Make your documentation accessible on any device with
HelpNDoc
TAstaParamItem.SetBlobData
TAstaParamItem
Declaration
procedure TAstaParamItem.SetBlobData(Buffer: Pointer; Size: Integer);
Description
Sets the datatype to ftBlob and moves the data pointed to by Buffer to the internal
424 / 449
ASTA 3 for Delphi
TAstaParamList
Properties : Methods
Unit
AstaParamList
Description
A TAstaParamList is similar to the TParams property in the Delphi TQuery except that they
can be streamed across the internet and can contain any type of data including binary,
other ParamLists and even datasets. Each Param member is of type TAstaParamItem
which has the following properties:
Name: string;
ParamType: TAstaParamType;
DataType: TFieldType;
Null: Boolean;
Size: Integer;
This allows the TAstaParamList to be used just like the Delphi TParams. Here are some
examples:
ParambyName('CustomerNumber').AsInteger := 101;
Params[0].AsInteger := 101;
Use the TastaParmList.FastAdd to add any kind of data (excluding blob data). It takes a
variant as an argument and calls TAstaParamList.Add to automatically add and set the
data according to the variant datatype.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of a Help
Authoring Tool
Properties
TAstaParamList
Items
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
TAstaParamList.Items
TAstaParamList
Declaration
property Items[Index: Integer]: TAstaParamItem;
Description
425 / 449
ASTA 3 for Delphi
Items is the default property of the TAstaParamList so you can use it like ParamList[i] to
access an individual TAstaParamItem.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
Methods
TAstaParamList
AddNamedParam
AddOneParamItem
AsDisplayText
AssignValues
AsTokenizedString
ConstantAdd
CopyList
CopyParams
CopyParamsType
CreateFromString
CreateParam
DeleteParam
FastAdd
FindParam
LoadFromTokenizedString
ParamByName
SaveToFile
SaveToStream
UpdateAddParams
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
TAstaParamList.AddNamedParam
TAstaParamList
Declaration
procedure AddNamedParam(AName: string; Value: Variant);
Description
This procedure allows you to easily values to an AstaParamList and to supply a name for
the param. In versions of Delphi beyond Delphi 3 the FastAdd method is overloaded so
you can also use that.
Created with the Personal Edition of HelpNDoc: Converting Word Documents to eBooks: A Step-by-Step
Guide with HelpNDoc
TAstaParamList.AddOneParamItem
TAstaParamList
Declaration
procedure AddOneParamItem(Value: TAstaParamItem);
426 / 449
ASTA 3 for Delphi
Description
Adds one TAstaParamItem to the list. Used in Delphi 3. with Delphi 5 and up use the
overloaded FastAdd(Value: TAstaParamItem).
Created with the Personal Edition of HelpNDoc: Generate EPub eBooks with ease
TAstaParamList.AsDisplayText
TAstaParamList
Declaration
function AsDisplayText: string;
Description
Used in Server logs to be able to display the ParamNames and Values as Strings. For
blobs/memos the size of the blob is displayed.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaParamList.AssignValues
TAstaParamList
Declaration
procedure AssignValues(Dest: TAstaParamList);
Description
If a Param named Dest.Param exists in the AstaParamList the Dest will be assigned to
that Param. If the Param does not exist it will be ignored.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TAstaParamList.AsTokenizedString
TAstaParamList
Declaration
function AsTokenizedString(InputsOnly: Boolean): string;
Description
This saves a TAstaParamList as a string so that it can be easily recreated later using
CreateFromString.
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaParamList.ConstantAdd
TAstaParamList
Declaration
procedure ConstantAdd(const Values: array of const);
Description
Allows an Array of Const to be added to the ParamList.
427 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
TAstaParamList.CopyList
TAstaParamList
Declaration
function CopyList: TAstaParamList;
Description
This makes a copy of the TAstaParamList.
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help
Authoring Tool
TAstaParamList.CopyParams
TAstaParamList
Declaration
procedure CopyParams(Dest: TAstaParamList; ClearIt: Boolean);
Description
This will copy all of the AstaParamItemsto Dest and optionally clear the destination
ParamList.
Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files
TAstaParamList.CopyParamsType
TAstaParamList
Declaration
procedure CopyParamsType(Dest: TAstaParamList; Clearit: Boolean; Accepted:
TAstaParamTypes);
Description
Makes a copy of the AstaParamList. If Accepted is [] all param types will be included in
the copy. Optionally only certain types (example [ptInput]) can be included for the copy.
Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web
sites
TAstaParamList.CreateFromString
TAstaParamList
This replaces the previous call of CreateFromTokenizedString.
Declaration
constructor CreateFromString(S: string; Token: TAstaParamListCreateToken);
TAstaParamListCreateToken = (tcToken, tcServer, tcJava, tcPalm);
Description
This is used quite frequently by ASTA servers internally to receive incoming strings from
ASTA clients and to convert the strings to TAstaParamLists. Since ASTA ParamLists can
428 / 449
ASTA 3 for Delphi
contain any kinds of data, using the CreateFromString method along with the
AsTokenizedString method allows you to even have TAstaParamLists where each item is
another TAstaParamList or to store AstaParamLists as strings in blob fields in a DataSet.
To save a TAstaParamList as a string see AsTokenizedString. Most often you would use
this method with the tcToken param.
Example
var
p: TAstaParamList;
begin
p := TAstaParamList.CreateFromString(SomeStringSavedAsTokenizedString,
tcToken);
end;
Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy
TAstaParamList.CreateParam
TAstaParamList
Declaration
function CreateParam(FldType: TFieldType; const ParamName: string; AParamType:
TAstaParamType): TAstaParamItem;
Description
This method creates a param and adds it to the AstaParamList. For more simple calls
check out the overloaded method FastAdd.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaParamList.DeleteParam
TAstaParamList
Declaration
function DeleteParam(ParamName: string): Boolean;
Description
Deletes and frees a ParamItem if the name of the param exists. Returns True if the Param
exists.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaParamList.FastAdd
TAstaParamList
Declaration
procedure FastAdd(Value: Variant); overload;
procedure FastAdd(AName: string; Value: Variant); overload;
procedure FastAdd(AName: string; ADataType: TFieldType; AValue: Variant);
overload;
procedure FastAdd(const AName: string; ADataType: TFieldType; AValue: Variant;
AParamType: TAstaParamType); overload;
procedure FastAdd(Value: TAstaParamItem); overload;
429 / 449
ASTA 3 for Delphi
Description
This procedure allows you to easily values to an AstaParamList. Internally the Add
method is called, a name for the parameter is assigned and the Value property is used to
set the incoming Value.
Example
Streams cannot be added this way, but you can use FastAdd('') and then Params[Count -
1].AsStream to add a stream.
Variations
procedure FastAdd(Value: TAstaParamItem);
This allows you to add a parameter whose value is taken from another TAstaParamItem.
Created with the Personal Edition of HelpNDoc: Easily create iPhone documentation
TAstaParamList.FindParam
TAstaParamList
Declaration
function FindParam(const ParamName: string): TAstaParamItem;
Description
Just like the TParam.FindParam function. Returns a pointer to it if the param is found,
otherwise returns nil.
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's
Advanced Features
TAstaParamList.LoadFromTokenizedString
TAstaParamList
Declaration
procedure LoadFromTokenizedString(const S: string);
Description
ParamLists can be saved as Strings. This allows for ParamLists to contain lists of full
ParamLists. LoadFromTokenizedString can load a Paramlist from a string that has been
saved using AsTokenizedString.
430 / 449
ASTA 3 for Delphi
TAstaParamList.ParamByName
TAstaParamList
Declaration
function ParamByName(const ParamName: string): TAstaParamItem;
Description
Like the standard TParams.ParamByName function, returns a ParamItem by it's name or raises an
exception if not found.
Created with the Personal Edition of HelpNDoc: Effortlessly Create Professional Documentation with
HelpNDoc's Clean UI
TAstaParamList.SaveToFile
TAstaParamList
Declaration
procedure SaveToFile(FileName: string);
Description
Save a ParamList to a file.
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator
TAstaParamList.SaveToStream
TAstaParamList
Declaration
procedure SaveToStream(Stream: TStream);
Description
Save a ParamList to a stream.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
TAstaParamList.SaveToString
TAstaParamList
Declaration
function SaveToString: string;
Description
Saves a ParamList to a String. The same as calling AsTokenizedString(False).
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Review with
431 / 449
ASTA 3 for Delphi
TAstaParamList.UpdateAddParams
TAstaParamList
Declaration
procedure UpdateAddParams(Dest: TAstaParamList);
Description
This will add to Dest any params that don't exist or update any params that exist by
searching for the param using FindParam.
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
TAstaMQManager
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaAggregates
Properties
Unit
AstaIndexes
Declaration
type TAstaAggregates = class(TCollection)
Description
The TAstaDataSet.Aggregate Property is if type TAstaAggregate which mimics closely the
TAggregate Delphi class
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaAggregates.Properties
432 / 449
ASTA 3 for Delphi
TAstaIndexes
Unit
AstaIndexes
Declaration
type TAstaIndexes = class(TCollection)
Description
Asta datasets can have indexes defined so that multiple sort orders can be defined.
Indexes can be added at design time using the Indexes property or at runtime by calling
AddIndex or AddIndexFields.
Created with the Personal Edition of HelpNDoc: Easily create Qt Help files
Properties
TAstaIndexes
Active
BMKActive
DataSet
Items
Ordered
SelectedIndex
SelectedIndexFields
SelectedIndexName
Created with the Personal Edition of HelpNDoc: Import and export Markdown documents
TAstaIndexes.Active
TAstaIndexes
Declaration
property Active: Boolean;
Description
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User
Interface
433 / 449
ASTA 3 for Delphi
TAstaIndexes.BMKActive
TAstaIndexes
Declaration
property BMKActive: Boolean;
Description
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaIndexes.DataSet
TAstaIndexes
Declaration
property DataSet: TDataSet;
Description
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with
HelpNDoc's Stunning User Interface
TAstaIndexes.Items
TAstaIndexes
Declaration
property Items[AIndex: Integer]: TAstaIndex;
Description
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation with HelpNDoc's Project
Analyzer Features
TAstaIndexes.Ordered
TAstaIndexes
Declaration
property Ordered: Boolean;
Description
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with
HelpNDoc's online capabilities
TAstaIndexes.SelectedIndex
TAstaIndexes
434 / 449
ASTA 3 for Delphi
Declaration
property SelectedIndex: TAstaIndex;
Description
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation
TAstaIndexes.SelectedIndexFields
TAstaIndexes
Declaration
property SelectedIndexFields: string;
Description
Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook
TAstaIndexes.SelectedIndexName
TAstaIndexes
Declaration
property SelectedIndexName: string;
Description
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
Methods
TAstaIndexes
LoadFromStream
SaveToStream
Created with the Personal Edition of HelpNDoc: Revolutionize Your Documentation Output with a Help
Authoring Tool
TAstaIndexes.LoadFromStream
TAstaIndexes
Declaration
procedure LoadFromStream(AStream: TStream);
Description
Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's
Advanced Project Analyzer
435 / 449
ASTA 3 for Delphi
TAstaIndexes.SaveToStream
TAstaIndexes
Declaration
procedure SaveToStream(AStream: TStream);
Description
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
Events
TAstaIndexes
OnChanged
OnChanging
Created with the Personal Edition of HelpNDoc: Free Web Help generator
TAstaIndexes.OnChanged
TAstaIndexes
Declaration
property OnChanged: TAstaIndexChangeEvent;
Description
Created with the Personal Edition of HelpNDoc: Produce online help for Qt applications
TAstaIndexes.OnChanging
TAstaIndexes
Declaration
property OnChanging: TAstaIndexChangeEvent;
Description
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaMetaData
Unit
AstaDBTypes
Declaration
TAstaMetaData = (mdNormalQuery, mdTables, mdIndexes, mdFields, mdViews,
mdStoredProcs, mdForeignKeys, mdSystemTables, mdDBMSName, mdPrimeKeys,
mdStoredProcColumns, mdServerDataSets, mdCustomDataSets, mdBusinessObjects,
436 / 449
ASTA 3 for Delphi
Description
Value Meaning
mdNormalQuery
mdTables
mdIndexes
mdFields
mdViews
mdStoredProcs
mdForeignKeys
mdSystemTables
mdDBMSName
mdPrimeKeys
mdStoredProcColumns
mdServerDataSets
mdCustomDataSets
mdBusinessObjects
mdProviders
mdBusObjectParams
mdProviderParams
mdVCLFields
mdOtherMetaData
mdBusinessObjectNames
mdUserList
mdAliasedBizObjectMethods
Created with the Personal Edition of HelpNDoc: Easy Qt Help documentation editor
TAstaParamType
Unit
AstaParamList
Declaration
type TAstaParamType = (ptUnknown, ptInput, ptOutput, ptInputOutput, ptResult);
Description
These correspond to the same ordinals as the TParams as defined in db.pas in Delphi 4
and up.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator
TAstaProtocol
Unit
AstaStringLine
Applies to
TAstaServerSocket
TAstaClientSocket
Declaration
437 / 449
ASTA 3 for Delphi
Description
ASTA servers and clients use a proprietary messaging format with the default transport
using TCP/IP. To traverse firewalls ASTA TCP/IP messaging can be made to appear as
HTTP messages or actually become HTTP messsages. There is no need to set this
property on the AstaServerSocket as ASTA servers can serve TCP/IP and HTTP clients
unchanged. The only requirement is that to support stateless HTTP clients, servers must
be run using Pooled or Smart Threading.
ASTAClientSockets can call serveral helper methods and run time dialogs to configure
ASTA clients to use protocols other than TCP/IP.
SetForIsapiUse
SetForProxyUse
SetupForSocksServer
Firewalls
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's
Easy-to-Use Tool
TAstaSelectSQLOptionSet
Unit
AstaDBTypes
Declaration
type TAstaSelectSQLOptionSet = set of TAstaSelectSQLOptions;
Description
soFetchMemos This will fetch all the ftMemo fields in selects and also allow
them to be part of any Insert or Edit's applied to the server.
Note that since all fields in the select statement that translate
to ftmemos will be fetched, using this feature could cause large
memos to be streamed from the server to the client.
soFetchBlobs This will fetch all ftBlob or ftGraphic fields similar to the way
that soFetchMemos works will the same performance
considerations.
soCompress When this is set the select statement will be compressed on the
server using AstaCompression and and will be uncompressed
on the client. This is ignored if you are have compression set on
in the TAstaClientSocket. You may gain significant performance
benefits by using this property on larger queries and if your
438 / 449
ASTA 3 for Delphi
soExecStoredProc Some stored procedures return result sets and others do not. If
a stored Procedure does not return a result set then call
ExecSQL which is the same as setting soExecStoredProc to true.
This will pass the NoResultSet:Boolean to the
AstaServerSocket.OnStoredProcedure event as true.
soCyclopsSQL This allows for select statements to be written, one for each
item in the SQL:TStrings property and a result set will be
returned that contains the SQL and an AstaDataSet saved as a
string in a blob field. Used internally by ExpresswaySQL.
soFetchBytes This will fetch all ftBytes or ftVarBytes fields similar to the way
that soFetchMemos works will the same performance
considerations.
soDelayed This works only with client side SQL and when the AstaServer is
running in Pooled Sessions threading and allows for...
Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web
sites
TAstaServerSQLOptions Type
Unit
AstaSQLUtils
Declaration
type TAstaServerSQLOptionTypes = (ssUseQuotesInFieldNames,
ssTableNameInInsertStatments, ssBooleanAsInteger,
ssUSDatesForLocalSQL, ssTerminateWithSemiColon,
ssNoQuotesInDates, ssDoubleQuoteStrings, ssUseISInNullCompares);
type TAstaServerSQLOptions = set of TAstaServerSQLOptionTypes;
Description
Value Meaning
ssUseQuotesInFieldNames Used for Paradox or any database that
allows spaces in field names.
439 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Free help authoring tool
TAstaUpdateMethod
Unit
AstaDBTypes
Declaration
type TAstaUpdateMethod = (umManual, umCached, umAfterPost);
Description
Determines when SQL is posted to the server. umAfterPost will fire after a record is
posted. umCached requires the ApplyUpdates method to be called.
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Documentation with a
Help Authoring Tool
TAstaUtilityEvent
Unit
AstaServer
Declaration
type TAstaUtilityEvent = procedure(Sender: TObject;ServerSocket:
TAstaServerSocket; ClientSocket: TCustomWinSocket; Params: TAstaParamList)
of object;
Description
The AstaServerSocket is non-blocking and event driven and provides excellent
performance without using threads. ASTA database activity can be threaded and to scale
an ASTA server, the Pooled Threading Model is recommended. See the book COM + and
the Battle for the Middle Tier by Roger Sessions (Wiley Press) for a description of scalable
servers that applies quite accurately to ASTA servers running the Pooled Sessions
threading model.
One of the design goals of ASTA was to provide scalable threaded servers without having
ASTA developers to have to create any threads themselves. Since ASTA 2 there have
been threaded messaging calls that allow for ASTA messaging to be used in threads on
the server. Immediately ASTA users started to push the envelope on asynchronous
database access. The problem arose that one remote client would want to be able to have
multiple database queries executing on a server, and if left un-checked, this could result
in one client using many, many database sessions.
In Asta 2.108 an attempt was made to cache asynchronous threaded database calls so
that a limit could be set on the amount of concurrent database sessions used by any
440 / 449
ASTA 3 for Delphi
The prototypes of the ThreadedUtil events have changed. In the past, the Sender
(TObject) parameter passed was the AstaServerSocket, and now it will be a TAstaThread.
This will allow you to use the UserRecord of the AstaThread to send messages.
The following shows the use of a ThreadedDBUtility event from an ASTA server. Notice the
ServerSocket.SendCodedParamListSocket call which uses the ThreadedClient copy of the
UserRecord. Note: If a client is disconnected at this point the thread will be marked as
terminated, so perhaps a call to if not TAstaThread(Sender).HasTerminted then Exit is
needed before the actual send is made. The one scenario where we still seem to have
problems is when there are queued UtilityEvents that have not been launched, and the
client disconnects.
TAstaWebServer
Unit
AstaClientSocket
441 / 449
ASTA 3 for Delphi
Declaration
type TAstaWebServer = class(TPersistent)
Description
ASTA supports HTTP clients using the AstaClientSocket. The
AstaClientSocket.WebServer property is a property that allows the
configuration and control of HTTP settings. The AstaClientSocket can
optionally use the Microsoft WinInet.dll that comes with Internet
Explorer. WinInet uses any registry settings defined for Internet
Explorer which include any proxy and Socks settings. Setting the
WebServer.WinInet property (Boolean) to true is the recommended way to traverse
firewalls with ASTA. If Internet explorer can browser the Internet, your ASTA WinInet
enabled client will be able to communicate with your remote ASTA server through a web
server and Astahttp.dll
The ASTA Cookies tutorial has an example server and client to show
how authentication can be done with ASTA and stateless clients.
Asta stateless support via HTTP requires a web server to run like
Microsoft IIS (internet Information Server). Another good choice for
testing is the Omini Web Server available from www.omnicron.ca.
Server Side
The AstaServerSocket has an AddCookie property which is of type
TAstaServerCookieOption.
In order to tunnel via HTTP, ASTA binary messages are wrapped using the
HTTP format so that they can be disguised as normal browser traffic in order to traverse
any client firewall. When cookies are used, additional
authentication information is included in the ASTA messaging format.
Value Meaning
442 / 449
ASTA 3 for Delphi
Properties
TAstaWebServer
AddCookie
AstaHttpDll
AstaServerAddress
AstaServerPort
Authenticate
ProxyPassword
ProxyUserName
SSLOptions
Timeout
UseSSL
UseWebServer
WebServerAddress
WebServerPort
WinInet
WinInetToStatusBar
Created with the Personal Edition of HelpNDoc: Effortlessly Create High-Quality Help Documentation
with a Help Authoring Tool
TAstaWebServer.AddCookie
TAstaWebServer
Declaration
443 / 449
ASTA 3 for Delphi
Description
Adds a cookie to client packets.
Created with the Personal Edition of HelpNDoc: Maximize Your PDF Protection with These Simple Steps
TAstaWebServer.AstaHttpDll
TAstaWebServer
Declaration
property AstaHttpDll: string;
Description
The location and name of Astahttp.dll, example "scripts/Astahttp.dll".
Created with the Personal Edition of HelpNDoc: Effortlessly bring your documentation online with
HelpNDoc
TAstaWebServer.AstaServerAddress
TAstaWebServer
Declaration
property AstaServerAddress: string;
Description
The address of the ASTA server relative of the web server. This probably will not be an
internet address but an address on the local network from the web server.
Created with the Personal Edition of HelpNDoc: Free help authoring tool
TAstaWebServer.AstaServerPort
TAstaWebServer
Declaration
property AstaServerPort: Word;
Description
The port of the ASTA Server.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?
TAstaWebServer.Authenticate
TAstaWebServer
Declaration
property Authenticate: Boolean;
444 / 449
ASTA 3 for Delphi
Description
True if your web server requires authentication.
Note: When using WinInet this property probably does not need to be
set as WinInet uses the settings from IE (Internet Explorer).
Created with the Personal Edition of HelpNDoc: Transform Your CHM Help File Creation Process with
HelpNDoc
TAstaWebServer.ProxyPassword
TAstaWebServer
Declaration
property ProxyPassword: string;
Description
The proxy password.
Note: When using WinInet this property probably does not need to be
set as WinInet uses the settings from IE (Internet Explorer).
Created with the Personal Edition of HelpNDoc: Transform Your Documentation Workflow with
HelpNDoc's Intuitive UI
TAstaWebServer.ProxyUserName
TAstaWebServer
Declaration
property ProxyUserName: string;
Description
The proxy username.
Note: When using WinInet this property probably does not need to be
set as WinInet uses the settings from IE (Internet Explorer).
Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor
TAstaWebServer.SSLOptions
TAstaWebServer
Declaration
property SSLOptions: TSSLOptions;
Description
Allows for WinINET SSL options to be configured.
Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web
sites
445 / 449
ASTA 3 for Delphi
TAstaWebServer.Timeout
TAstaWebServer
Declaration
property Timeout: Word;
Description
Time in seconds to block or wait for the server to return a reaponse. Set to a higher value
if you are sending lots of data over the wire.
Note: the ASTA server "knows" that a client is using HTTP and will disconnect the client
as soon as any server side process is completed. So setting a higher value will not affect
performance.
Created with the Personal Edition of HelpNDoc: Say Goodbye to Documentation Headaches with a Help
Authoring Tool
TAstaWebServer.UseSSL
TAstaWebServer
Declaration
property UseSSL: Boolean;
Description
Uses SSL (requires a certificate on the server).
Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool
TAstaWebServer.UseWebServer
TAstaWebServer
Declaration
property UseWebServer: Boolean;
Description
Determines whether settings to HTTP tunnel should be activated.
Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files
TAstaWebServer.WebServerAddress
TAstaWebServer
Declaration
property WebServerAddress: string;
Description
The IP address or host of the web server (eg IIS).
446 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Streamline Your Documentation Process with a Help
Authoring Tool
TAstaWebServer.WebServerPort
TAstaWebServer
Declaration
property WebServerPort: Word;
Description
Web Server port. Traditionally port 80.
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
TAstaWebServer.WinInet
TAstaWebServer
Declaration
property WinInet: Boolean;
Description
Setting WinInet to True tells TAstaWebServer to use WinInet.
Created with the Personal Edition of HelpNDoc: Effortlessly Convert Your Word Doc to an eBook: A Step-
by-Step Guide
TAstaWebServer.WinInetToStatusBar
TAstaWebServer
Declaration
property WinInetToStatusBar: Boolean;
Description
Writes WinInet status messages to a TAstaStatusBar.
Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Output with HelpNDoc's
Advanced Project Analyzer
TRefetchStatus
Unit
AstaDBTypes
Declaration
type TRefetchStatus = (rfNone, rfAutoIncPrimeKey, ftNeedsPrimeFields);
Description
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator
447 / 449
ASTA 3 for Delphi
TThreadDBAction
Unit
AstaDBTypes
Declaration
type TThreadDbAction = (ttSelect, ttExec, ttStoredProc, ttMetaData,
ttBlobFetch, ttTransaction, TransactionStart,
ttCustom, ttDataModule);
Description
These values are passed internally by ASTA to the ThreadedDBSupplyQuery event so that
ASTA servers can have components necessary to complete database tasks and is also
used in the ThreadedDBUtilityEvent allow you to request any kind of database component
handled by your ThreadedDBSupplyQuery to be used in a thread in ASTA messaging
calls.
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc
TUpdateSQLMethod
Unit
AstaClientDataSet
Declaration
type TUpdateSQLMethod = (usmNoTransactions, usmUseSQL, usmServerTransaction,
usmCommitAnySuccess);
Description
For use in the TAstaClientDataSet.ApplyUpdates(TransactionMethod: TUpdateSQLMethod).
usmCommitAnySuccess Commit with Any Success means that rollback will not be called
if *any* of the SQL statements succeed. Commit will be called
if even just one sql statement succeeds. To make sure all the
housekeeping is in order, ASTA will then keep the
OldValuesDataSet rows that have failed on the server and
delete any rows who's SQL has succeeded on the server.
448 / 449
ASTA 3 for Delphi
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help
File Creation Features
TUtilInfoType
Unit
AstaStringLine
Declaration
type TUtilInfoType = (uiUserCount, uiMetaData, uiSQLSelect, uiSQLExec,
uiServerPerformance, uiSessionInfo, uiServerVersion, uiAutoClientUpgradeInfo,
uiWriteAutoClientUpgradeDataSet, uiSaveClientUpgradeExe,
uiPublishedDirectories, uiWritePublishedDirectories, uiRegisterSwitchBoard);
Description
These surface new calls to return server information.
uiUserCount
uiMetaData
uiSQLSelect
uiSQLExec
uiServerPerformance
uiSessionInfo
uiServerVersion
uiAutoClientUpgradeInfo
uiWriteAutoClientUpgradeDataSet
uiSaveClientUpgradeExe
uiPublishedDirectories
uiWritePublishedDirectories
uiRegisterSwitchBoard
Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning
website
449 / 449