Meaning TXC

Used for Paradox or any database that allows spaces in field names. Databases like Access need this set to false. MS SQL Server has bit fields that map to ftBoolean in the VCL but then SQL must be generated as Integers eg. 0 or 1 . Interbase, Paradox and xBase using the BDE don't like international dates so this forces the server to receive US formatted dates. Access likes it's SQL statements to be terminated with semi-colons. Use this if you don't want to use single quotes in dates and...

Introducing ASTA SkyWire

The ASTA SkyWire architecture consists of a SkyWire Server and one or more SkyWire thin clients. ASTA Win32 Administrative thin clients are available to help administer remote Databases through SkyWire Database Servers. Since SkyWire clients and servers are available on many platforms, they may be packaged in different formats as shared libaries on the Palm OS, DLL's on Win32 or WinCE devices, COM DLL's on WinCE or Win32 32, so's on Linux or as Java classes or as C XX files. Below is a diagram...

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. Asta supports data-aware controls and can generate SQL to automatically transmit update, insert and...

Example KHB

AstaConnSendParamList RefLib, Conversation, ParamList, 1001, BoolRes function AstaConnSetAuthorizationOff refNum UInt16 hConnInstance Pointer Err Description Turns off any Authentication information being sent to the AstaSkyWire server on connect. Example function AstaConnSetAuthorizationOn refNum UInt16 hConnInstance Pointer UserName PChar Password PChar SecurePassword boolean Err

Example

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 lt PhoneExt', p...

Description RSU

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. type TSQLDialect sqlNone, sqlLocalSQL, sqlAccess, sqlMSSQLServer, sqlOracle, sqlSQLAnywhere, sqllnterbase, sqlDBISAM, sqlCustom

Description HYD

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

Description GWW

Allows you to specify how you would like to see SQL error messages. Value Meaning seToStatusBar Displays the errors in the middle panel of an seAsExceptions Raise the SQL Error as an exception. See the OnSQLError event handler if you are interested in working with the error strings. 1.8.1.3.1.31 TAstaClientSocket.SQLOptions property SQLOptions TAstaServerSQLOptions Description The SQLOptions property of the TAstaClientSocket on the client allows for full customization of the SQL that ASTA...

Meaning 1

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. This is a resource conscious scaling model. Use the DataBaseSessions property to set the number of sessions that are created at server startup. All connections are created at server startup, and client requests are paired with sessions from this pool on an as-needed basis. If you are trying to support a large number of users, this is the model...

Description KST

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

Derived from TDataSet

FieldCount FieldDefList FieldDefs FieldList property Aggregates TAstaAggregate

Derived from TDataSet VPS

Description DNG

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.

Example IUW

There is a full example server using Visual Basic and connects to the Northwind sample database included in the SkyWire COM Server install. This server shows how you can extend SkyWire servers with full database support and also has examples of custom methods that implement business logic on the server. Starting the Server A server must listen on a certain port and be set to active and also connect to a database. Set AstaServer New CAstaCOMServer Set Conn New Connection Set Tbl New Recordset...

XML ParamList routines

procedure XMLToParamList const Doc TXMLDocument Params TAstaParamList function XMLdocToParamList const Doc TXMLDocument TAstaParamList function XMLstringToParamList const S string TAstaParamList procedure XMLstreamToParamList Stream TStream Params TAstaParamList 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. procedure DataSetToXMLStream D TDataSet TableName string var MS TStream Blobs, Memos,...

Description EYG

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

Description QMR

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. Indexes added using IndexFieldNames do not support grouping or maintained aggregates. Note The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.

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

Description XGB

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

Client Side SQL

AstaClientdatasets descend from TAstaDataSets and are in memory DataSets that communicate with remote servers via the TAstaClientSocket.These tutorials show how to use the various methods and properties of the AstaClientDataSet. Aggregates Cached Updates Constraints Indexes Master Detail Sorting SuitCase Transactions AstaBDEServer to be running Description Use Aggregates to define aggregates that summarize the data in the client dataset. Aggregates is a collection of TAstaAggregate objects,...

History

After every query SQL tab , the sql statement will be appended to the history dataset. 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...

How to Define the Available Databases on the Server

ASTAClientDataSets have a Database string property that can be populated from ASTA servers so that there is a design time pulldown of Database choices. To do this the AstaServer must code the OnFetchMetaData Event to return a TAstaDataSet in response to an mdDBMSName Metarequest from AstaclientDatasets. The server must append the DbmsDataSet and define a value in the Database field that will stream back to the remote clientdataset. This ADO Server contains a new menu option of Manager Aliases...

Simple Business Objects

The following code shows how you could send CodedMessages to a business object instantiated on the server. In this scenario, 1800 and 1850 are protocol codes that you control. The client can call those codes, with or without a parameter and invoke a custom response from the server. ClientSocket TCustomWinSocket MsgID Integer Msg string begin MsgID, 'FALSE' MsgID, end end 1.8.1.3.2.24 procedure SendCodedParamList MsgId Integer Params TAstaParamList Description The SendCodedParamList method is...

Description 4

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

Description UHG

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

Description JHC

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

Derived from TAstaCustomDataSet 4

How to have server side database calls react to the Databasestring property

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

Threading the Server

ASTA Database servers already come thread ready but since this is not a database server there are a couple of steps you need to do to thread the server. 1. Set the AstaServerSocket.ThreadingModel to tmSmartThreading 2. Set the to a value greater than zero. 4. Code the AstaServerSocket.ThreadedDBSupplyQuery event. 5. Call the method to set up the Here is the code from the server that sets the server up for threading. procedure TForm1.FormCreate Sender TObject begin...

NonBlocking Calls

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

Description SVF

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

Description BTF

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. An example of how the AstaSessionList could be used is if you want to get a DatabaseSession under the Persistent Session threading model for an...

Meaning 4

Select from several servers, allows new server entry. Last IP used is the one displayed. New IPs can be entered. Allows for a custom login dialog. See the note at bottom. No dialog is displayed, uses the IP entered at design time. No dialog is displayed, developer is responsible for assigning it. 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...

Automatic Client Updates

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

Index 1

TAstaParamItem 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396 ParamByName 396 ParamType 391 SetBlobData 396 Size 392 Text 392 Value 393 TAstaParamList AsTokenizedString CopyList 399 CopyParams 399 CreateFromTokenizedString FastAdd 400 TAstaParamList.AddNamedParam 397 TAstaParamType 406 TAstaPDAServerSocket 457 OnPalmUpdateRequest 458 OnPDAAcquireRegToken 458 OnPDAAuthentication 459 OnPDAGetFileRequest 459 OnPDAPasswordNeeded 459 OnPDARevokeRegToken 459 OnPDAValidatePassword 460...

Security Issues

Socket Addressses can be validated with the AstaServerSocket.OnClientValidate Event. A Server Login can be required using the AstaServerSocket.OnClientLogin or OnClientDBLogin. Remote Users who don't login correctly can be immediately disconnected using the Property. Design time Access can be controlled with DTUserName and DTPassword. The AstaServer can set the public SecureServer Boolean to true to ONLY allow for Login Messages to be processed to completely lockdown a server and force any...

Description OQA

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.

Example XLC

procedure Sender TObject ClientSocket TCustomWinSocket DataBaseString string var ASession TComponent var 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...

Derived from TDataSet 1

ActiveBuffer Append AppendRecord BookmarkValid

XML Support

ASTA 3 XML support is provided at 3 levels 1. Native DOM Parser and Thunk Layer source code users only 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. xmldom, XMLDoc, XMLIntf ELSE end USE_LEGAL_D6 IFDEF USE_MSXML ActiveX,...

Method TestMethod

IntputParam ftSmallInt, ptinput OutputParam ftSmallInt,ptoutput TimeStamp ftDateTime,ptputput In the OnActionEvent of the TAstaActionItem here is the code that receives the InputParam from the client and just sets the output Param. The ClientParams TAstaParamList comes in from a remote TAstaclientDatset. procedure Sender TObject ADataSet TDataSet ClientParams TAstaParamList begin - 100 now end Here is the Client Side Code using an AstaClientDataSet with a ServerMethod pointed to TestMethod....

General Topics

1. Always code the AstaclientSocket.OnDisconnect event even with a comment. 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...

Description QJV

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

ASTA for Delphi

There is a full example server using Visual Basic included in the SkyWire COM Server install. Starting the Server A server must listen on a certain port and be set to Set AstaServer New CAstaCOMServer AstaServer.Port 9090 AstaServer.AllowAnonymousPDAs True AstaServer.Active True Authentication a Username and password is presented from remote clients. Private Function AstaServer OnAuthenticate ByVal Username As String, ByVal Password As String As Boolean AstaServer OnAuthenticate True End...

Assumptions

1. Primary keys are not allowed to be changed. If needed, delete the record and make a 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 ASTA supports a suitcase or persistent model in that any TAstaClientDataSet can 1. Save and load itself from a stream 2. Save and load itself from a file 3. Save and load itself form a blob field since it...

Meaning

Used for Paradox or any database that allows spaces in field names. Databases like Access need this set to false. ssTableNameInInsertStatments 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. Interbase, Paradox and xBase using the BDE don t like international dates so this forces the server to receive US formatted dates. Access likes its SQL statements to be termintaed with semicolons. Use this if you...

Server side Techniques

In the N Tier Architecture it is common practise to put the Business Logic on the middle tier or ASTA server. These demos show a couple of techniques for using TAstaProviders and ServerMethods via the TAstaBusinessObjectsManager. Provider and ServerMethod Text File Updater Shows a non-database example, with a server and a cli of how to query directories on the server via a ServerMethod using the TAstaBusinessObjectsManager to update text files using AstaClientDatasets and TAstaProviders This...

This code shows the packup

procedure TForm1.BitBtn1Click Sender TObject var TableTransportDataSet.Empty for i 0 to memo1.lines.count-1 do begin Query1.Close Query1.Sql.text Select from memo1.lines i Query1.Open TableTransportDataSet.post end end procedure TForm1.ExtractButtonClick Sender TObject begin end AstaParamlist messaging is easy to use and efficient but sometimes you may want to transfer very large files and don t want your Database server to be overwhelmed with file transfer requests. Of course you can always...

Examples

AstaBDEServer.exe Port 9012 AstaBDEServer.exe Port 8080 AstaODBCServer.exe Port 1111 Compression 1.6.4.11 Data Modules on ASTA Servers 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...

ASTA Servers

ASTA servers come out of the box with the ability to Run as a normal EXE or NT Service Support the ASTA ODBC Driver Support SkyWire non-vcl Clients like Palm and WinCE Below is a screen shot of the Asta3ADOServer. ASTA 3 servers use a specific format. 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...