⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 86.htm

📁 水木清华的BBS文章
💻 HTM
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>CTerm非常精华下载</title>
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="577">
<tr><td width="32%" rowspan="3" height="123"><img src="DDl_back.jpg" width="300" height="129" alt="DDl_back.jpg"></td><td width="30%" background="DDl_back2.jpg" height="35"><p align="center"><a href="http://bbs.tsinghua.edu.cn"><font face="黑体"><big><big>水木清华★</big></big></font></a></td></tr>
<tr>
<td width="68%" background="DDl_back2.jpg" height="44"><big><big><font face="黑体"><p align="center">         Delphi编程                            (BM: strayli FlyingBoy)          </font></big></big></td></tr>
<tr>
<td width="68%" height="44" bgcolor="#000000"><font face="黑体"><big><big><p   align="center"></big></big><a href="http://cterm.163.net"><img src="banner.gif" width="400" height="60" alt="banner.gif"border="0"></a></font></td>
</tr>
<tr><td width="100%" colspan="2" height="454"> <p align="center">[<a href="index.htm">回到开始</a>][<a href="15.htm">上一层</a>][<a href="87.htm">下一篇</a>]
<hr><p align="left"><small>发信人: strayli (stray), 信区: Delphi <br>

标  题: A Technical View of Borland MIDAS Part II (2) <br>

发信站: BBS 水木清华站 (Thu Nov 12 22:11:56 1998) WWW-POST <br>

  <br>

* * * Begin Note * * * <br>

  <br>

Note: In this example, you might want to simply connect to a remote server <br>

located on the current machine. To do this, simply run the server once, and <br>

it will be registered and listed in the drop down list for the ServerName <br>

property. To access the server on a remote machine, run it once on the local <br>

machine, then once on the remote machine, and then access that machine <br>

through the ComputerName property. If you have DCOM services set up properly <br>

on both machines, then everything should work automatically. If you want, you <br>

can use DComCfg.exe to point DCOM at the remote machine when running your <br>

server, or you can use OLEnterprise to do the same thing. You can, if you <br>

want, use some other means than running the server to make entries in your <br>

registry. There will be more information on connectivity, DCOM and <br>

OLEEnterprise later in this paper. <br>

  <br>

* * * End Note * * * <br>

  <br>

Now drop down two TClientDatasets on a form. Use the drop down list on the <br>

RemoteServer property to hook them both up to RemoteServer1. Use the drop <br>



down list on one TClientDataSet to hook it up to the CustomerDataSet on the <br>

server via the ProviderName property. Use the ProviderName property on the <br>

second data set to hook it up to the OrdersDataSet on the server. When you <br>

use the ProviderName property the Connected property on the TRemoteServer <br>

object will be set to true and the remote server will be loaded into memory. <br>

  <br>

  <br>

Set the client Dataset's Active property to true, and hook up some data <br>

sources and grids to them. You can then use the MasterSource and MasterFields <br>

properties to establish a one to many relationship between the two tables. <br>

You have now completed the client application. You can run it, and see your <br>

tool in action. <br>

  <br>

* * * Begin Note * * * <br>

  <br>

Note: Particularly when working across machines, I think it is often a good <br>

idea to launch the client first, and then connect to the server. Here is code <br>

that would connect to the server at run time: <br>

  <br>

CustomerClientDataSet.Active := True; <br>

  <br>

OrdersClientDataSet.Active := True; <br>

OrdersClientDataSet.Active := True; <br>

  <br>

Or, if you prefer: <br>

  <br>

CustomerClientDataSet.Open; <br>

  <br>

OrdersClientDataSet.Open; <br>

  <br>

The act of setting the Active property of a dataset to True will <br>

automatically set the Connected property of the TRemoteServer to True. <br>

  <br>

I recommend connecting at run time for two reasons. One, the launch of your <br>

application will be relatively quick, and will be sure to succeed. Two, there <br>

is no need to connect to the server every time you run the application. As I <br>

said earlier, the client can save the data set to disk, and then allow the <br>

user to edit without connecting to the server. Obviously, you can't use this <br>

feature properly if you don't give the user a choice when it comes time to <br>

connect to the server. <br>

  <br>

* * * End Note * * * <br>

  <br>

  <br>

-- <br>



※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.38.72.60] <br>

</small><hr>
<p align="center">[<a href="index.htm">回到开始</a>][<a href="15.htm">上一层</a>][<a href="87.htm">下一篇</a>]
<p align="center"><a href="http://cterm.163.net">欢迎访问Cterm主页</a></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -