K8055 or K8056 usage with Access?

I have been using a sound file to indicate a certain condition in an Access database. Now I have the need to let a closing contact outside the PC to indicate the same thing and that way open a lock on a door. I think that either of K8055 or K8056 could be a good choice to do that. I have downloaded the sample programs but cannot find anything that could be used as the programs I see looks more to be used by clicking in the forms.

I would need to be able to activate a relay on the card after testing the condition in the Access program. Anyone know if that is possible?
/ Rolf

You can get access to the input and output terminals of the K8055 card from your application software (e.g. VBA) via the functions of the K8055D.DLL.
http://www.velleman.be/downloads/0/user/usermanual_k8055_dll_uk.pdf

Now I have bought the ready built card and should use the VBA code in the pdf file, but found that it was locked, so I could not copy the code. As it is quite extensive, I would try to avoid all the misspelling and just copy your supported code. Could you please assist with telling me how to do it or supply just those lines?
/ Rolf

Sorry that the PDF document is copy protected.
Actually the code in the document is not a VBA code but a normal Visual Basic source code. You find the whole VB project source files from the CD folder /velleman kits/k8055&vm110/demo pc soft source/vb/

See also the thread [forum.vellemanprojects.eu/t/k8055-programming-with-visual-basic-for-applications/311/1) how to get the data read from the K8055 card automatically and periodically updated on the Excel sheet.

Here are the K8055D.DLL function declarations and a couple of procedures copied from the source file form1.frm:

[code]Private Declare Function OpenDevice Lib “k8055d.dll” (ByVal CardAddress As Long) As Long
Private Declare Sub CloseDevice Lib “k8055d.dll” ()
Private Declare Function ReadAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long) As Long
Private Declare Sub ReadAllAnalog Lib “k8055d.dll” (Data1 As Long, Data2 As Long)
Private Declare Sub OutputAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAllAnalog Lib “k8055d.dll” (ByVal Data1 As Long, ByVal Data2 As Long)
Private Declare Sub ClearAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub SetAllAnalog Lib “k8055d.dll” ()
Private Declare Sub ClearAllAnalog Lib “k8055d.dll” ()
Private Declare Sub SetAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub WriteAllDigital Lib “k8055d.dll” (ByVal Data As Long)
Private Declare Sub ClearDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub ClearAllDigital Lib “k8055d.dll” ()
Private Declare Sub SetDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub SetAllDigital Lib “k8055d.dll” ()
Private Declare Function ReadDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib “k8055d.dll” () As Long
Private Declare Function ReadCounter Lib “k8055d.dll” (ByVal CounterNr As Long) As Long
Private Declare Sub ResetCounter Lib “k8055d.dll” (ByVal CounterNr As Long)
Private Declare Sub SetCounterDebounceTime Lib “k8055d.dll” (ByVal CounterNr As Long, ByVal DebounceTime As Long)

Private Sub Connect_Click()
Dim CardAddress As Long
Dim h As Long
CardAddress = 0
CardAddress = 3 - (Check1(0).Value + Check1(1).Value * 2)
h = OpenDevice(CardAddress)
Select Case h
Case 0, 1, 2, 3
Label1.Caption = “Card " + Str(h) + " connected”
Case -1
Label1.Caption = “Card " + Str(CardAddress) + " not found”
End Select
If h >= 0 Then Timer1.Enabled = True
End Sub

Private Sub Form_Terminate()
CloseDevice
End Sub[/code]

Many thanks for your support with tips and the code!

Now everything works just fine and I can do it with VBA code inside Access. Very little had to be changed, as it was very like Visual Basic.
/ Rolf