[AccessD] Ten most common tasks/problems in Access

Stuart McLachlan stuart at lexacorp.com.pg
Tue Oct 21 08:17:22 CDT 2014


On 21 Oct 2014 at 12:15, John Bodin wrote:

> Hi Stuart,
> 
> Do you have the declare statement you would include in Access for the
> DLL and a sample call?  I've used the .Exe in the past but would
> rather not have to shell out to run it if I can use the DLL
> references.  I couldn't find the info on the yahoo board nor in the
> blat Zip file (just updated a few days ago) so if you get a chance and
> can dig up the info, that would be much appreciated.
> 

The syntax for the DLL is just the same as for the Exe.   One thing to be careful of is only 
have a single space between parameters ( Not sure if that still applies, but earlier versions of 
the DLL had problems if you had multiple spaces).

Here's a simple one which builds a plain text message.  

Declare Function SendBlat Lib "blat.dll" Alias "Send" (ByVal sCmd As String) As Integer
...

Function SendMsg(message As String, address As String) As Long
Dim shellstr As String
             Open "Message.txt" For Output As #1
             Print #1, message
             Close #1
             shellstr = "Message.txt -to " & address & " -SERVER mail.camcopng.com -f 
survey at camcopng.com.pg"
             shellstr = shellstr & " -s " & Chr$(34) & "Program Survey" & Chr$(34) & " -O 
""CAMCo Ltd"""
             shellstr = shellstr & " -log BlatLog.txt -noh2"

             SendBlat shellstr
End Function




More information about the AccessD mailing list