Contents IndexExcel and WSQL DDE Server Visual Basic and WSQL DDE Server

User's Guide
   Part V. The SQL Anywhere Programming Interfaces
     Chapter 37. The WSQL DDE Server
      Word and WSQL DDE Server

Microsoft Word Basic supports DDE. The following example contains sample Word Basic code to access the WSQL DDE Server DDE server. The two different ways of retrieving the data are demonstrated: using the clipboard and receiving the data directly.

     Sub MAIN
         ' Initialize a DDE channel to the database
         chan = DDEInitiate("WSQLDDE", "dba,sql,sademo")
     
         ' Connect to the database
         DDEPoke chan, "connect", ""
     
         ' Get the data using the clipboard
         DDEPoke chan, "clip_data", \
             "select emp_lname \
             from employee where emp_id = 102"
         EditPaste
         
         ' Insert the data directly into the document
         DDEPoke chan, "clear", \
             "select emp_lname \
             from employee where emp_id = 105"
         Insert DDERequest$(chan, "data")
         
         ' Disconnect from the database
         DDEPoke chan, "disconnect", ""
     
         ' Terminate the DDE connection
         DDETerminate(chan)
     End Sub

Contents IndexExcel and WSQL DDE Server Visual Basic and WSQL DDE Server