[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

OLE or DDE exchange Word 6 to Access 2

I have a Word 6 online form with text fields and dropdown boxes for input, how do I link the text fields to an Access 2 database table or form by OLE or DDE so a button click exchanges the data automatically?

Background:

Computer Telephony Integration using Windows95 TAPI to 'Screen Pop' a Word 6 script for agents to input data into an online form to exchange, create or update an Access 2 backend database.

Thanks in advance
0
MattWilliams
Asked:
MattWilliams
1 Solution
 
robandrwCommented:
I suppose this is an answer that you expected to get but I risk stating the obvious. One wonders why you are not using an Access form to input the data. Would save many hassles.

Anyway, you can't use OLE as Word can only act as an OLE Server, not a Client. Which means that you have. There are many examples in the MS-Acces 2.0  and MS-Word help files under search topic  DDE. In the MS-Access help file there is a complete section on using MS-Access as a DDE server.

Thje following piece of code (courtesy the MS Access help file) shows a word basic macro that access a MS-Access data base.

Sub MAIN
' Using the System topic, open the NWIND.MDB database.
' The database must be open before you can use other DDE topics.
      Chan1 = DDEInitiate("MSAccess", "System")
      DDEExecute Chan1, "[OpenDatabase C:\ACCESS\SAMPAPPS\NWIND.MDB]"
' Get all the data from the Customer List query.
      Chan2 = DDEInitiate("MSAccess", "NWIND;QUERY Customer List")
      MyData$ = DDERequest$(Chan2, "All")
      DDETerminate Chan2
' Close the database.
      DDEExecute Chan1, "[CloseDatabase]"
      DDETerminate Chan1
' Insert the data into a text file.
      Open "MYDATA.TXT" For Append As #1
      Print #1, MyData$
      Close #1
End Sub


0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now