LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access 2007 freezes when calling LabVIEW 7.1 Shared Library (dll)

first of all, I've been struggling to get this to work for quite some time.  I'm using Microsoft Access 2007 to call a simple LabVIEW shared library that I created.  The dll takes two inputs (Num1, Num2) and returns the sum of the two numbers.  Here is the function that LabVIEW creates:

 

long AddNumbers(long Num2, long Num1)

 

 

In Access 2007, I use the following VBA code to call the dll:

 

Option Compare Database
Private Declare Function AddNumbers Lib "C:\AddNumberDll.dll" (ByVal num1 As Long, ByVal num2 As Long) As Long

 

Private Sub Command0_Click()

    MsgBox AddNumbers(2, 3)       ' application freezes at this point!

End Sub

 

 

 

Any suggestions?  Thanks!

0 Kudos
Message 1 of 12
(4,170 Views)
Any ideas?  Could I be missing some sort of library file or dll?
0 Kudos
Message 2 of 12
(4,148 Views)

Ok, here's some new information.

 

I copied the shared library to another computer, and used Microsoft Access 2007 to call the dll, and it worked!  Both machines have LabVIEW 7.1, and Microsoft Office 2007 installed.... so what could be different?

0 Kudos
Message 3 of 12
(4,132 Views)

Hi brents1,

 

A similar issue has been discussed at this thread. It appears that as you have already succesfully used LabVIEW 7.1 on both systems it could have to do with Access2007--the installation on one of the systems might be missing a component. 

 

Ipshita C.

National Instruments
Applications Engineer
0 Kudos
Message 4 of 12
(4,122 Views)

Here's the thread.

 

Ipshita C.

National Instruments
Applications Engineer
0 Kudos
Message 5 of 12
(4,117 Views)
I did look at that thread... actually I posted it awhile back.  It seems that when I use LabVIEW 8.6 to build the dll, it works fine on computer A with Access 2007.  However, computer B works with both 7.1 and 8.6.  That's why I'm so confused about this whole situation...
0 Kudos
Message 6 of 12
(4,085 Views)

I can't use LabVIEW 8.6 because of the following problems:

 

Our test software was created with LabVIEW 7.1, NI Vision Development Module 7.1, and Vision Builder 2.6.1.  Whenever I open the 7.1 project with LabVIEW 8.6, there are a bunch of errors due to the differences in the versions.  If I install NI IMAQ 4.1, Vision Builder 2.6.1 no longer works correctly.  For example, in VBAI 2.6 whenever I try to implement a pattern matching step, VBAI crashes due to a Call Library Node error.  So VBAI 2.6 is completley useless whenever NI IMAQ 4.1 is installed.  You would think NI would think about making their software backwards compatable, but I guess not... Smiley Mad

 

So as you can see, I cannot build my project using LabVIEW 8.6.  I MUST use 7.1. 

 

Please help!!!

Message Edited by brents1 on 11-10-2008 11:03 AM
0 Kudos
Message 7 of 12
(4,048 Views)

brents1,

 

So to confirm we have one computer that can use the dll with 7.1 & office 2007 and one that can't?  If so has the computer that can't use the dll ever worked with office 2007.  You might think about reinstalling Access.

 

Otherwise, could this be a path issue that the access program is looking for the dll in a specific spot.  I saw you reference it at C:\* was that where it was on both computers? 

 

What about speed what are the other physical differences between these 2 computers?

Sincerely,
Jason Daming
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 8 of 12
(4,034 Views)

Jason,

 

Yes, that is correct.  One computer can use the 7.1 built dll w/ Office 2007, and the other one can't, and never has.  I've tried it with Office Professional 2007, and Access Runtime 2007... same result.  I've uninstalled and reinstalled MS Access with no luck.  Still the same problem.

 

Yes, the dll is in the same spot on both computers.  I've attached a zip file containing the vi, build script, dll, and .mdb.  Just unzip it into the C:\ directory and give it a try. 

 

As far as physical differences between the computers: The computer that works: Pentium M 1.7 GHz, 512Mb RAM, Windows XP SP3.  The computer that does not work: AMD Athlon XP 2700+ 2.17 GHz, 768Mb RAM, Windows XP SP3.

 

Some other interesting things:  As you know, the 8.6 build dll works with Access 2007 w/ no problems.  In the MS Access form I created, if you click on the "Calculate with 8.6 dll" first, then click on "Calculate with 7.1 dll" next, it will work!  But if I click on "Calculate with 7.1 dll" first, MS Access and LabVIEW runtime will freeze.

 

0 Kudos
Message 9 of 12
(4,019 Views)
Something else that's interesting...  If I call the "AddFunction" LabVIEW 8.6 dll first, then call my actual 7.1 application dll next (to try to bypass the problem of MS Access/LV Runtime freezing), I get an error about memory.cpp line 611.  I only get this error if the dll includes IMAQ functions.  Any ideas about this error?
0 Kudos
Message 10 of 12
(4,004 Views)