astadevsource
所属分类:网络编程
开发工具:Delphi
文件大小:2513KB
下载次数:21
上传日期:2008-10-23 11:07:22
上 传 者:
houzhengxiang
说明: 利用asta开发的三层结构业务源码,已在实际项目中得到应用
(Asta developed using three-tier structure of the business source, has been applied in practical projects)
文件列表:
客户端\ClientSaleManage.dof (5949, 2004-02-21)
客户端\ClientSaleManage.cfg (456, 2004-02-21)
客户端\ClientSaleManage.res (4292, 2004-02-21)
客户端\ClientSaleManage.dpr (901, 2004-02-21)
客户端\Docs (0, 2004-03-01)
客户端\参考\Cached\CachedDemo.cfg (434, 2004-02-20)
客户端\参考\Cached\CachedDemo.dof (5703, 2004-02-20)
客户端\参考\Cached\CachedDemo.dpr (192, 2000-08-17)
客户端\参考\Cached\CachedDemo.exe (1228288, 2004-02-20)
客户端\参考\Cached\CachedDemo.res (876, 2004-02-20)
客户端\参考\Cached\u_main.dfm (6058, 2004-02-20)
客户端\参考\Cached\u_main.pas (6372, 2004-02-20)
客户端\参考\Cached (0, 2004-03-01)
客户端\参考 (0, 2004-03-01)
客户端\Bin\ClientSaleManage.exe (2182144, 2004-02-23)
客户端\Bin (0, 2004-03-01)
客户端\Units\FormMainUnit.pas (1644, 2004-02-21)
客户端\Units\FormBillModelUnits.dfm (53432, 2004-02-21)
客户端\Units\DMUnit.dfm (7574, 2004-02-21)
客户端\Units\FormLoginUnit.dfm (23030, 2004-02-21)
客户端\Units\FormBaseData_SPDAUnit.dfm (7341, 2004-02-21)
客户端\Units\DMUnit.pas (1144, 2004-02-21)
客户端\Units\FormLoginUnit.pas (534, 2004-02-19)
客户端\Units\FormBaseData_SPDAUnit.pas (2574, 2004-02-23)
客户端\Units\FormMainUnit.dfm (396149, 2004-02-21)
客户端\Units\FormBill_JHDDUnit.dfm (12965, 2004-02-21)
客户端\Units\FormBillModelUnits.pas (11672, 2004-02-21)
客户端\Units\FormBill_JHDDUnit.pas (5789, 2004-02-23)
客户端\Units\FormBaseData_HSUnit.dfm (1708, 2004-02-23)
客户端\Units\FormBaseDataModelUnit.dfm (35337, 2004-02-23)
客户端\Units\FormBaseData_HSUnit.pas (1300, 2004-02-23)
客户端\Units\FormBaseDataModelUnit.pas (5922, 2004-02-23)
客户端\Units (0, 2004-03-01)
客户端\Files\Title.bmp (129618, 2004-02-19)
客户端\Files (0, 2004-03-01)
客户端\Dcu (0, 2004-03-01)
客户端 (0, 2004-03-01)
中间件\unit1.dfm (4582, 2004-02-23)
中间件\dm.dfm (8861, 2004-02-19)
中间件\FormAboutUnit.pas (491, 2004-02-19)
... ...
ASTAAdoServer Aug 2000 Multi AdoConnection support
This ADO Server allows multple ADOConnections to be created on the fly so that
AstaClientDatasets can use the Database:String property to access any number
or Databases on the server.
How to define Availble Databases on the server.
==============================================
ASTAClientDataSets have a Database:String property that can be populated from
ASTA servers so 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 to allow Alias
information to be defined and save to file by a TAstaDataSet calling
SaveToFile.
The SetupDBMSDataSEt call on the server populates the DBMSDataSet.
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.
function
TAstaDataModule.GetADOConnection(ClientSocket: TCustomWinSocket; Alias,
FileName: string): TComponent; 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;//use main adoconnection
// 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;
近期下载者:
相关文件:
收藏者: