First of all, I didn't have any problem using Microsoft Access 2002/2003 to call a LabVIEW Shared Library until I upgraded to Access 2007. However, since I upgraded to Access 2007, the same code and build will not work. It causes Access and the LabVIEW runtime to hang. Here is what I'm doing: (I'm using the example found here:
http://zone.ni.com/devzone/cda/tut/p/id/3188#toc0)
First I created a shard library by building it in LabVIEW 7.1:
void Numtes(unsigned char In3, double *In2, long In1, unsigned char *Out3, double *Out2, long *Out1)
I then declare the private sub in Access 2007:
Private Declare Sub Numtest Lib "C:\download\lvNumber\numtest.dll" Alias "Numtes" (ByVal i1 As Integer, ByRef i2 As Double, ByVal i3 As Long, ByRef o1 As Integer, ByRef o2 As Double, ByRef o3 As Long)
Here's the code that calls the sub and returns the result:
Private Sub Command1_Click()
On Error GoTo Err_Msg
Dim i1 As Integer, i2 As Double, i3 As Long, o1 As Integer, o2 As Double, o3 As Long
i1 = Text4
i2 = Text5
i3 = Text6
Call Numtest(i1, i2, i3, o1, o2, o3)
' Display the results
Text1 = o1
Text2 = o2
Text3 = o3
Exit Sub
Error_Msg:
MsgBox Err.Number & ": " & Err.Description
Exit Sub
End Sub
I'm not sure if this problem is Microsoft's, or if the LabVIEW 7.1 runtime engine doesn't support Access 2007. Any suggestions on what to try next? I'm planning on downloading the trial for LabVIEW 8.5 and re-building it tomorrow, but I just wanted to see if anyone has ever ran into this problem. Any thoughts?