Article ID: 113905
Article Last Modified on 1/8/2003
103807 : How to Convert a Text File into a New Access Database
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
96845 : How to Use DDE to Display Microsoft Access Data in VB
Additional query words: 3.00 4.00 vb416
Keywords: KB113905