全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:3983
推到 Plurk!
推到 Facebook!

是否有人用過Excel 或 Windows NetDDE來作遠端資料及時傳輸??

尚未結案
fj
一般會員


發表:20
回覆:12
積分:6
註冊:2004-11-23

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-03-22 09:08:16 IP:211.78.xxx.xxx 未訂閱
各位前輩們: 公司現在要用NetDDE來做遠端資料傳送,可是去微軟MSDN看使用說明,也只有到win NT4.0,我們在winXP上試過使用MSDN上的方法,可是依然無法做連結 不知道出什麼問題,以下是微軟網站上的教學文章,試過,但抓出來的資料為N/A,若有前輩曾經試過,請幫幫忙,謝謝。 MORE INFORMATION A Network DDE Link consists of two parts; the DDE server application and the DDE client application. The DDE server application contains the data to be shared. The DDE client requests the data from the DDE server, thus creating a DDE Link. Network DDE requires the server application to make the data accessible on the network. The server Application creates a Network DDE share, available over the network, which the client application can connect to. In Windows NT 3.1, Clipbook could be used to create the Network DDE share. In version Windows NT 3.5, because of changes to the ClipBook and OLE, the ClipBook can no longer be used to create Network DDE Links for Excel worksheets. To create a Network DDE link under Windows NT 3.5: 1. Use DDE Share Manager (%SYSTEMROOT%\SYSTEM32\DDESHARE.EXE) to create a share on the DDE server: a. Select Add a Share in the SHARES.DDESHARES menu. b. Enter a share name. The share must end with a dollar sign ($), for example SalesData$. NOTE: This share is not a directory. You cannot see it in File Manager. c. Under Application Name, enter the following: Old Style: Excel New Style: Excel.Sheet.5 Static: NOTE: Leave Static blank. d. Under Topic Name, enter the following: Old Style: [SALES.XLS]Sheet1 - This is the File Name and the Worksheet name New Style: SALES.XLS - This is the File Name Static: NOTE: Leave Static blank. e. Select Allow Start Application. f. Choose Permissions and then set permissions for the share the same way you would set permissions on files using File Manager. g. Choose OK. h. Select the share you just created and choose Trust Share. i. Choose Set and then choose OK. 2. Launch Excel on the server and create or open a workbook named "SALES.XLS," with a sheet named "Sheet1." It does not matter what directory SALES.XLS is saved to. Enter something into cell A1 (it does not matter what you enter). 3. Create a link to the share that you just created. This example uses the share name SalesData$ and the DDE server machine \\MARLEY. The workbook name is SALES.XLS and the data to be linked is in SHEET1, column 1, row 1. a. At the DDE client machine, run Excel. b. Enter the following command into the first cell: ='\\MARLEY\NDDE$'|'SalesData$.OLE'!'Sheet1!R1C1' NOTE: You may be prompted for a password. If so, enter a valid user account and password which exists in the DDE server's domain or a trusted domain. 4. The linked data should appear in the cell when you press enter. If the cell shows "N/A", choose Links from the Edit menu. The link should be listed as follows: Source File: SalesData$.OLE Item: Sheet1!R1C1 Type: \\MARLEY\NDDE$ Status: Automatic To update the link, select Update Now. The link updates, and the data is linked to the client workbook. The link may not update in Excel on the existing client. If the link does not update, press F2 and then press ENTER to edit the cell. When you edit the cell, be aware of the following: • If you do not save the Excel workbook that is on the server in the My Documents folder or in the Winnt\profiles\user\personal folder, provide the absolute path in the file name, such as C:\SALES.XLS. Note Winnt\profiles\user\personal is the default location where Excel saves files. • If you move the Excel workbook that is on the server, you change the share configuration. Therefore, you must explicitly trust the new share version. To do this, open the Trusted Share Properties dialog box, and then click Set. To run NetDDE programs in Windows 95, you must add a shortcut for Netdde.exe to the Startup group. To do so, follow these steps: 1. Right-click an empty space on the taskbar, and then click Properties. 2. On the Start Menu Programs tab, click Add. 3. Use the Create Shortcut Wizard to create a shortcut for Netdde.exe in the Windows folder. 4. After you create the shortcut, restart your computer. NOTE: With Excel 97, use "Excel.Sheet.8" for the New Style Application name. Also, with Excel versions 7.0, 7.0a, and Excel 97, check "Start Application Enable" and "Initiate to Application Enable" check boxes in the Trusted Share Properties dialog box. -------------------------------------------------------------------------------- APPLIES TO • Microsoft Windows NT Workstation 3.5 • Microsoft Windows NT Workstation 3.51 • Microsoft Windows NT Workstation 4.0 Developer Edition • Microsoft Windows NT Server 3.5 • Microsoft Windows NT Server 3.51 • Microsoft Windows NT Server 4.0 Standard Edition • Microsoft Windows 95 Service Pack 1 Back to the top Keywords: kbinterop KB128491 Back to the top
fj
一般會員


發表:20
回覆:12
積分:6
註冊:2004-11-23

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-03-22 15:40:11 IP:211.78.xxx.xxx 未訂閱
這個部分我已經試出來了,附上我的心得,希望對有需要的人有幫助 但我又遇上另一個問題是,如何透過網路連線Delphi的DDEServer 和  Delphi的DDEClient ================================================================= DDEServer端設定 1.執行DDEShare.exe出現如下畫面     2.新增一個新的共用如下(note: 名稱自取但一定要加$字號) 3.DDE共用內容如下設定 4.回到2.畫面中選取新增的DDE分享,然後按下[信任]鈕即出現下列畫面 設定如下圖,設定完後按下[設定],再按確定。 [note : 若完成修改動作,一定要從新作信任一次] 5.當設定完必須將專案所在資料夾設定共用分享(excel則是DDE伺服器分享的檔案) DDEClient 端設定 1. 開啟excel檔案 2. 在儲存格上輸入下面紅色框部分的指令後執行 ='\\MI857HP\NDDE$'|'DelphiTest$.ole'!DdeServerItem1 3. server端若有修改,則必須關閉檔案,並從新開啟,並鏈結。 4. 若是針對Excel 對Excel則必須從新設定指令,並從新開啟 ='\\MI857HP\NDDE$'|'SalesData$.ole'!'Sheet1!R1C1'
系統時間:2024-04-24 9:42:16
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!