Oracle + Midas Remote Data Module Configuration Process [April 18, 2004 10:17]

zhaozj2021-02-16  67

/// Server //1. Oracle creation table Login System / Manager Create Table Customer (20), Memo Varchar (200)); 2.BCB File / New / MultitierCoccoClassName: Custinfosvr3. Control Data Access / DataBaseDataBaseName: CUSTINFODriverName: ORACLELoginPrompt: falseParams:. SERVER NAME = ORCLUSER NAME = SYSTEMPASSWORD = MANAGER4 control Data Access / updateSQL: Name: CustInfoUpdateSQLDeleteSQL: delete Customer where CustID =: old_CustIDInsertSQL: insert into Customer values ​​(: CustID,: CustName, : Memo) ModifySQL: update Customer setCustID =: CustID, CustName =: CustNamename, Memo =: Memo where CustID =: old_CustID 5. control Data Access / TQuery: Name: CustInfoQueryUpdateObject: CustInfoUpdateSQLUpdateMode: UpdateWhereKeyOnlyDatabaseName: CUSTINFO6 control Midas / DataSetProvider:. Name : CustinfoproviderOptions <

DataSet: CustInfoQuery

Updatemode: UpwhereKeyOnly

7. MAIN form constructor

Custinfosvr = New Tcustinfosvr (Application);

IF (FindWindow (Null, "Borland Socket Server) == NULL)

Winexec (ANSISTRING (ExtractFilePath (Application-> Exename)

"Scktsrvr.exe"). C_str (), sw_show);

Open Borland Socket Server and add port 27241

The program will be released at this port through the BCB Socket Server

//

///

Client

///

1.File / New / Data Modules

Name: CustinFodata

2. Midas / SocketConnectionName: Custinfoconnection

Address: 127.0.0.1

Port: 27241

ServerName: DataModulesvr.custinfosvr

// Note: You need to open the client and socket server to choose ServerName

3.Midas / ClientDataSetName: CustinfoCDS

RemoteServer: CustInfoconnection

Providername: Custinfoprovider

4.Data Access / DataSource

Name: Custinfosource

DataSet: CustinfoCDS

5. MAINFORM constructor

Try

{

Custinfodata-> CustinfoCDS-> Open ();

DataSource = CustinFodata-> Custinfosource;

DBGRID1-> DataSource = CustinFodata-> Custinfosource;

Catch (Exception & E)

{

ShowMessage (E.MESSAGE);

}

// Configuration End This program provides services primarily through DataSetProvider

I haven't worried about DCOM yet, but I think this should be an application of DCOM.

DataSetProvider can provide remote call as long as you provide a data set

Related resources: Midasgts in geotechnical engineering [Li Zhi edited] 2013

转载请注明原文地址:https://www.9cbs.com/read-17209.html

New Post(0)