[AccessD] DDE (was: What is this?)

Gustav Brock Gustav at cactus.dk
Tue Jun 23 10:27:36 CDT 2009


Hi John

Welcome to the Office Antique Store at 1 Memory Lane. Wonder how you located that page? 
Anyway, as Charlotte states, this is true old stuff dated back to Access 1.0! It is documented here:

http://support.microsoft.com/kb/98791

It works but, these days, only for the fun. One of the major drawbacks is, as I remember, that DDE runs in the same thread as Access itself meaning that any action on the DDE channel will pause your frontend. Also, error handling is nil, so if it doesn't work you will get no clue on what happened nor what to do.

/gustav


>>> jwcolby at colbyconsulting.com 23-06-2009 16:15 >>>
I just found code that does the TransferText in a completely different way.  I have never seen a 
text control use these properties and methods.  Is this something new in 2007 or does this go back 
to some previous version?  What is the advantage of this over the normal TransferText?

http://support.microsoft.com/kb/113905 

    Sub Command1_Click ()
       Dim cmd As String      ' Holds DDEExecute command.
       On Error GoTo DDEerr   ' Error trap.

       ' Make sure there isn't an existing DDE conversation:
       text1.LinkMode = 0

       ' Set up the DDE link:
       text1.LinkTopic = "MSACCESS|C:\ACCESS\NWIND.MDB"
       text1.LinkItem = "All"
       text1.LinkMode = 2

       ' DDEExecute command to import text file into Microsoft Access Table:
       cmd = "[TransferText ,,'Shippers','C:\ACCESS\SHIPPERS.TXT']"

       ' Execute the TransferText command and close the DDE link:
       text1.LinkExecute cmd
       text1.LinkMode = 0
       MsgBox "Transfer OK"
       Exit Sub

    DDEerr:
       ' An error has occurred.
       MsgBox Error
       MsgBox "Error in transfer."
       Exit Sub
    End Sub


-- 
John W. Colby
www.ColbyConsulting.com 





More information about the AccessD mailing list