Calling Server Methods at runtime

The demo also has an example of calling servermethods at runtime. When the serverMethod name is set, the params are fetched from the server so you don't need to create the params. This happens at design time also when an AstaClientDataSet is set to use a Provider or ServerMethod. For performance purposes you can cache all the Param info for Providers and ServerMethods so there is no need for a trip to the server. procedure TForm1.Button2Click(Sender TObject) var acd...

TAsta Provider Declaration

Property ClientSocketParams TAstaParamList Description The AstaClientDataSet has a public 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 This allows you to transfer disparate information to AstaProviders. property CompareServerValuesOnUpdates Boolean If set to True the CompareServerValuesOnUpdates will do a...

Description GBS

Sets the datatype to ftBlob and moves the data pointed to by Buffer to the internal storage of the TAstaParamItem. 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 ParamType TAstaParamType DataType TFieldType Null Boolean Size Integer This allows the...

Description XUP

Sets an AstaParamValue Name to Value The ASTA SkyWire architecture consists of remote thin clients, connecting to a middle tier Application Server via TCP IP. SkyWire Servers are available using a number of languages include Visual Basic, Delphi and Java. This document describes how to use NSBASIC Clients to access remote SkyWire Servers servers and perform standard tasks using the SkyWire component. ASTA Skywire consists of a middleware Server and client side components to access that server....

Description FIH

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...

Description HWF

Returns the TUsersRecord 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. function TAstaServerSocket.UserRecordNil(const TheClient TUserRecord) Boolean 1.8.2.4.2.58 TAstaServerSocket.ValidSocket function ValidSocket(ClientSocket TCustomWinSocket) Boolean Returns true if the ClientSocket is not nil and is valid using the same low level Winsock call as...

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. ASTA Suitcase Model ASTA supports a suitcase model where users can fetch data from an ASTA server and then disconnect...

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 get in between this SQL generation. See also More on SQL Generation. 1.6.2.10 More on SQL Generation ASTA can...

N Tier

Whilst the above example is a very simple explanation of the paradigm, it is adequate to explain the concept - in reality, some program functionality may be shared between tiers. So what is happening in each of these three tiers Firstly, the client application manages the user's interaction with your system. It includes all of the screens and dialogs that allow the user to interact with your program. Secondly, the application server (or middle tier) includes the actual business logic of your...

ASTA Technology Parameter Message

The ASTA message format is centered on the two concepts of a message parameter, and a list of message parameters. These concepts are simple and orthogonal, so provide a simple yet powerful means for a developer to write software for platform interoperability. The ASTA message parameter consists of 5 elements. These elements are Parameter name - the name of the parameter Parameter type - the mode of the parameter, in, out, inout, result. On SkyWire clients this is not surfaced but this will be...

Description NSS

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...

Data Sets In Memory

Shows how to use masterDetail with an in memoryDataset and to flip back and forth between master detail support with setting and clearing the master fields property. AstaClientDataSets typically implement master detail using a Parameterized Query on the Detail DataSet. As the master rows are changed new queries are sent to the server. ASTA also provides a way to query all the detail for all the master rows and to use a local filter to implement master detail. There are helper calls to toggle...

ASTA Vision

ASTA was designed to ease the transition to multi-tier development. Our powerful hybrid components allow developers to become successful leveraging the skills they already have. At the same time, the components are flexible enough to grow with your skills and needs. No matter whether you want your application's business logic to reside on the client or on the server side (or both) ASTA allows you to succeed Our end-to-end component suite moves corporate data as easily as the Web moves text and...

Description XNT

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...

Meaning

Displays a user name and password dialog, must be verified at the server. Passes UserName and Password properties, must be verified at the server. UserName and Password properties are transmitted, automatically verified at 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...

Description TNN

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...

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. In essence, it is the thin in thin client. Since it resides in memory, you will also find that it is very fast. The TAstaDataSet implements master-detail support, indexing, persistence, cloning, streaming,xml and filtering. The same methods and techniques that you can use with TTables are used with the TAstaDataSet....

TAsta ServerSocket Declaration WWE

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. procedure FileSegmentSend(ClientSocket TCustomWinSocket P TAstaParamList) Used internally to implement FileSegment sends. See the ASTA FTP discussion. function IsNonVCLClient(ClientSocket TCustomWinSocket) Boolean

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. A Windows socket encapsulates a set of communication protocols to allow the application to connect to other machines for reading or writing information. Windows sockets provide connections based on the TCP IP protocol....

Firewalls

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...

ASTA New Features

All ASTA datasets now have indexes for findkey and set range support and optimized locate calls to use indexes where available We've extended constraint support for all ASTA DataSets Allows for design time or run time copying of any TDataSet to an ASTA In Memory DataSet Adds compression and encryption options to SaveToFile calls ADO and Midas formats supported using the native ASTA XML parser or the Microsoft Parser using a thunk layer built into ASTA 3 ASTA filters were completely re-written...

Description WXL

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.

Description VVO

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. This will fetch all ftBlob or ftGraphic fields similar to the way that soFetchMemos works will the same performance considerations. When this is set, and the RowsToReturn is a positive...

Description WAP

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. The following example is taken from the ExecSQLParam tutorial. FastAdd adds a parameter and tries to set the data type according to the input the first three come in as text, integer, datetime the memo needs to be created explicitly Params.CreateParam(ftmemo, 'Description', ptInput) ParamByName('Description').AsMemo Memol.Text Params.FastAdd(Time) this...

Description EWP

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. ContentDefined ParentDataSet PrimeFields UpdateTableName

Description NKN

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. For more information, see AstaClientSocket. Port

Visual Key to the components

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...

ASTA to ASTA Migration Issues

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. 1. SQL Generation now uses Params In ASTA 2.6 SQL was expanded so that Dates and Floats would have to be properly formatted depending on the settings of the machine running the AstaServer. In ASTA 3, all SQL generation uses Params. In order to do this, there are a couple of new events on...

Description HHV

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...

Description NMM

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. procedure TObject S string) begin You could stream the memo to a file or perhaps save it to a database on a daily basis. 1.8.2.4.3.9 TAstaServerSocket.OnCheckOutSession 1.8.2.4.3.9 TAstaServerSocket.OnCheckOutSession

Description ECO

The main processing engine for PDA requests which mapps to the AstaConnection.AstaConnSendParamList from remote PDA's. TAstaPdaServerSocket Unit AstaPdaServersocket TObject U TUserRecord UserName string var Password string var AccountValid boolean) of object TAstaPdaServerSocket Unit AstaPdaServersocket TObject U TUserRecord PDAid integer IntToken TMessageDigest128 var Result boolean) of object TAstaPdaServerSocket Unit AstaPdaServersocket Procedure OnPdaValidatePassword(Sender TObject...

Description AHE

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...

Description NMO

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...

Description CCX

Procedure Login(const UName, AppName string) procedure Log(Msg string) function PersistentSession Boolean property DatabaseSession TComponent read FDatabaseSession write FDatabaseSession property OnStateChange TUserRecordEvent read FOnStateChange write FOnStateChange function IsValid Boolean function IsPalm Boolean function IsRemotePda Boolean function isStateless Boolean property ClientSocket TCustomWinSocket read fClientSocket write fClientSocket property ParamList TAstaParamList read...

Description JBK

TAstaPdaServerSocket Unit AstaPdaServersocket TObject U TUserRecord PDAid integer IntToken TMessageDigest128 var UserToken string) of object TAstaPdaServerSocket Unit AstaPdaServersocket Procedure OnPdaAuthentication(Sender TObject U TUserRecord Error integer) of object TAstaPdaServerSocket Unit AstaPdaServersocket procedure OnPdaGetFileRequest(Sender TObject PDAid integer RequestString string StartPos, BlockSize integer Buffer Pointer var Written integer var ErrCode integer) of object Skywire...

Universe

Run over any TCP IP connection and be able to disguise yourself as http at anytime . Have a middleware serverthat supports ASP and Peerto Peer. Be aware that the most precious resource is bandwidth . Provide XML Support . Provide Compression Options out of respect for 2 . Support Web Services on both client and servers . Provide Encryption Options to be able to operate securely . There shall be no administration required (Zero Admin rule) . Authenticate at the server by username and password...

Example WTJ

AstaConnSetEncryptionOn function AstaConnSetHttpOff(refnum UInt16 hconnInstance Pointer) Err Will be available in Astalib 1.1 and necessary for ASTA Palm SOAP support along with the ASTA Palm Turns off http tunneling that was set with AstaConnSetHttpOn. function AstaConnSetHttpOn(refnum UInt16 hConnInstance Pointer Address PChar Port Word Page PChar Authenticate Boolean UserName, Password Pchar UseProxy Boolean ProxyAddress PChar ProxyPort Word ProxyAuthenticate Boolean ProxyUserName Pchar...

Description VGR

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. Since the AstaClientSocket is an asyncronous non-blocking socket, setting it to...

Description CWA

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. See the AstaBDEServer for an example of how to use this method. 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...

Description TDN

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. ASTA supports logging by coding the AstaServerSocket OnShowServerMessage event. Internally the RecordServerActivity Method calls OnShowServerMessage. There is a Logon Boolean property that allows for all logging to be turned on or off and ASTA 3 servers...

Feature Testers

These tutorials also can be used to test and adminster remote servers. It's not a bad idea to compile them and install them in the Delphi IDE until Tools Option in order to fire SQL against any remote server, see all your ServerMethods or providers on remote servers or see everything you want with the AstaSQLExplorer. Remember these are all ASTA thin client apps that can be used against any remote server. We've included one of our QA tests in the ASTA 3 tutorials to show how ASTA properly...

Features

Two key benefits of ASTA's design are that 1. It abstracts the database application development process so that any database components can be used on ASTA Servers 2. It handles all threading internally so that developers need not be concerned with threading issues. ASTA technology is especially well suited to Business to Business (B2B) application development. Moreover, with ASTA you can implement your application once then deploy it on a standalone PC, in a LAN as well as over the Internet....

Description QNX

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. procedure...

Description TWC

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 FParamList that can be used to store any other...

Example COU

Function AstaConnSetCompressionOff(refNum UInt16 hConnInstance Pointer) Err Description Sets Compression off. Requires AstaZLib.prc Example function AstaConnSetCompressionOn(refNum UInt16 hConnInstance Pointer level UInt32) Err Description Sets Compression on where level is the compression factor and the higher the number the greater the compresssion but is also slower. Requires AstaZLib.prc

Description UBL

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...

Description EBA

Returns the CAstaParamItem current field by given name Property FieldCount As Long Read-only Member of AstaCOMClient.CAstaDatalist Property FieldCount Returns the number of fields in the CAstaDataList. Function GetParamlist() As CAstaParamlist Member of AstaCOMClient.CAstaDatalist method GetParamList Retrieves an CAstaParamlist from the current row. Member of AstaCOMClient.CAstaDatalist method MoveFirst Moves to the first row in the CAstaDataList. CAstaDataList Member of...

Description JLO

Creates a temporary index on FieldName so that the DataSet appears in the order defined. procedure SortDataSetByFieldNames(const AFieldNames array of string const ADescending array of Boolean) Creates a temporary index so that the DataSet appears in the order defined. procedure SortOrderSort(SortName string)

Database Discussion

1.6.2.1 Client Side SQL vs Coding the Server 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...

Description XPN

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. procedure CleanCloneFromDataSet(D TDataSet) This method clears the current field definitions and copies the field...

Description WSQ

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. property OnAfterBroadcastHandling TNotifyEvent

Authentication Stateless Cookies

Normal ASTA TCP IP client applications support a login process that allows for remote users to be authenticated against ASTA servers with a username and password, and to also send extra params to the server and receive params back from the server on the OnLoginParamsEvent. In addition there is a UserList that maintains Username, Application Name, Connect Time and other information on the AstaServerSocket. When running stateles of course there is no UserList. ASTA supports stateless UserLists...

Description OVG

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...

Description VID

Fires when returning system table info. TOnTablesEvent procedure(Sender TObject ClientSocket TCustomWinSocket MetaDataRequest TAstaMetaData MetaDataSet TAstaDataSet DatabaseName string TableName string) of object property OnTriggers TOnTriggersEvent TOnTriggersEvent procedure(Sender TObject ClientSocket TCustomWinSocket MetaDataRequest TAstaMetaData MetaDataSet TAstaDataSet DatabaseName string TableName string) of object property OnVCLFields TOnVCLFieldsEvent TOnVCLFieldsEvent procedure(Sender...

Description AQA

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. You first call ''), and a TAstaDataSet will be returned as part of the parameters to the These...

Description GLM

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...

Asta

Binary patch on the original client EXE to bring it update to date with the current version Thus, instead of a 1MB client application a 200K patch file could be sent to clients. Combining this with the HTTP download technique you have the best of both worlds no resources used from the ASTA server and a much smaller file streaming down to remote clients. The ASTA Binary Patcher allows any 2 binary files to be compared and a patch file created that can be applied to the first binary file using a...

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 1.6.2.8...

Description WIL

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. Call ApplyRange to cause a range established with SetRangeStart and SetRangeEnd, or EditRangeStart and...

Description OTD

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...

Description OBQ

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. function CompareFields(key1, key2 TAstaDBlistItem AField TField APartialComp, ACaselnsensitive Boolean) Integer

Description PCF

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. 1.8.1.2.2.95 TAstaClientDataSet.ValidBookmark function ValidBookMark(BM string) Boolean

TCPIP with blocking calls

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...

Description QMD

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 1. EditMode must be set to Cached. 2. The MasterDataset can only handle the one row the newly inserted row and it must be setup to have an AutoIncrement Field defined and...

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...

Example OSY

Function AstaNPLNext(refNum UInt16 hPLInstance Pointer var Result boolean) Err Description Moves to the next embedded AstaParamList from an AstaNestedParamlist AstaNestedParamList function AstaNPLPrevious(refNum UInt16 hPLInstance Pointer var Result boolean) Err Description Moves to the previous embedded AstaParamList from an AstaNestedParamlist The ASTA Unified Messaging Initiative allows for cross platform messaging by using AstaParamLists which are easy to use and fully streamable Data...

Example VSN

Procedure TObject ClientSocket TCustomWinSocket DBAction TThreadDbAction DataBaseStr String CreateNew Boolean var AQuery TComponent SQLOptions TAstaSelectSQLOptionSet) begin try if CreateNew then begin case DBAction of ttStoredProc begin AQuery TStoredProc.Create(nil) with AQuery as TStoredProc do begin SessionName TDataBase(TAstaThread(Sender). Session).SessionName DataBaseName TDataBase(TAstaThread(Sender). Session).DataBaseName AQuery AQuery TQuery.Create(nil) with AQuery as TQuery do begin...

ASTA vs the Browser

A discussion of the appropriate use of browser technology in complex business applications. The World Wide Web, and the servers and browsers that make it work, are fantastic and highly useful pieces of technology. But like all tools, the web has appropriate and inappropriate uses. Whether you entrust your business to a technology like the web or a technology like ASTA is a question of appropriate use. We believe that the classic web architecture - a light browser, a protocol like HTTP, and a...

C

Cached Updates 51 CancelUpdates 179 CASL Sample Code 465 CAstaCOMServer.AstaServerName 438 CAstaCOMServer.Compression 437 CAstaCOMServer.Encryption 438 CAstaComServer.IPAddress 437 CAstaCOMServer.OnAuthenticate 439 CAstaCOMServer.OnClientConnect 441 CAstaCOMServer.OnClientDisconnect 439 CAstaCOMServer.OnParamList 439 CAstaCOMServer.Port 437 CAstaCOMServer.SecureServer 438 CAstaCOMServer.StringKey 438 CAstaConnection 600 CAstaNestedParamList 607 CAstaParamltem 441, 612 CastaParamltem.Name 614...

ASTA is a practical technology

ASTA's unique properties are the result of it's unique beginnings. From the start, we decided that this technology needed to appeal to four camps the system administrators, the application developers, the end users, and the CFO. It took the combined visions of an applications programmer, a systems professional and seasoned business veterans. To please the end user, we delivered a native Windows application - providing a crisp and responsive graphical interface. Because it's a native Windows...

TAsta SessionList

Procedure AddASocketwithSession(Socket TObject Session Tcomponent) procedure AddDataModuleToSession(Session, NewDM TComponent) procedure AddPersistentThread(T TObject) procedure AddSocketToSession(Index Integer S, AT TObject) procedure FreeAQuery(TheSocket TObject Queryid, Proxyid Integer) procedure FreeProxyDataModule(Socket Tobject DMName string Proxyid Integer) function GetActionItemDataModule(ClientSocket TCustomWinSocket MethodName string at TObject) TPersistent function...

This client example shows how to use Send CodedParam List and Send GetCoded ParamList It loads up a text

Procedure TForm1.BitBtn1Click Sender TObject var Params, RetParams TAstaParamList begin if not OpenDialog1.Execute then Exit Params TastaParamList.Create try Params.FastAdd OpenDialog1.FileName ' File Size of ' IntToStr Length memo1.Text Params.FastAdd Now accepts TDateTime but Params 1 can be used as Paramis 1 . sString or Params 1 .AsDateTime Params.FastAdd Memo1.Text text is a string representation of a TStringList here we are adding it as a stream use any way you want if...

Description ABF

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. See Coding ASTA Serversfor...

Description CXQ

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. See Coding ASTA Serversfor steps to create an ASTA server. Here is an example...

Description USD

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...

Description QFF

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. TAstaClientDataSet. ProviderBroadcast Declaration property MergeEditRowBroadcasts Boolean

Description BED

The ProviderBroadCase property contains 3 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 BroadCastAction TBroadCastAction property CacheBroadcastsWhenEdit Boolean property MergeEditRowBroadCasts property ProviderFilter string property...

Description YGP

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. property ProviderBroadCast TProviderBroadCastOptions

Description JVB

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...

Description IGH

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.

Description RCU

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. Note FOldValuesDataSet is the internal property that OldValuesDataSet references and is kept public for backward compatibility with old code.

Description MWR

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.

Description WNT

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. 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...

Description FAB

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 The following is an example of...

Description VMM

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...

Description SOU

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. 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...

Description MIC

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...

Description PIO

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.

Description SCM

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. SetRange combines the functionality of SetRangeStart, SetRangeEnd, and ApplyRange in a single procedure call. SetRange performs the following functions 1. Puts the dataset into dsSetKey state. 2. Erases any...

Description QQL

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...

Description MSJ

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...

Description LLN

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...

Description IXL

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.

Description MRK

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. See the CloneCursor Tutorial for an example of cloning.

Description NGD

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.

Description LRB

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. 1.8.1.1.1.11 TAstaDataSet.MasterSource 1.8.1.1.1.11 TAstaDataSet.MasterSource

Description YXP

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...

Database Application Development

File Server, Client Server, Application Server 1.7.1.1 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...

TAsta ServerSocket Declaration WRQ

Type TAstaServerMetaDataEvent procedure Sender TObject ClientSocket TCustomWinSocket MetaRequest TAstaMetaData DataBaseStr, Arg1, Arg2 string of object 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...

ASTA and NET

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 DWORD dwExStyle, extended window style LPCTSTR lpClassName, pointer to registered class name LPCTSTR...