Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Further DDE help needed. Anyone?

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I'm trying to write a function that is past a command as a string which it then sends to MS Access using a DDE conversation.

When I run the code it sticks at the "linkMode = 1" line and complains that "Foreign aplication wont perform DDE method or operation".

Heres the code (you can ignore most of it cos everything works apart from the DDE stuff):


Public Function OpenDatabase(Database, Control As String, Field As Integer) As String
Dim Chan As Double
Dim Temp
ID = GetLink(Field)
Chan = Shell("c:\program files\microsoft office\office\msaccess.exe g:\highways\highwaysdbs\" + Database + ".mdb", 1)
If Chan = 0 Then
OpenDatabase = "Failed to open Access"
Else
OpenDatabase = Database + " opening at: " + ID
End If
PublicHW.FieldData.LinkMode = 0
PublicHW.FieldData.LinkTopic = "MSAccess|System"
PublicHW.FieldData.LinkMode = 1
Debug.Print Control
PublicHW.FieldData.LinkExecute Control
End Function


Any help would be much appreciated!
Sorry to have to post code but I'm new to VB.

elziko
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top