LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Connecting to MSDE through dll causes loss of dialogue box functionality

We are accessing a MSDE database using a "call library" function pointed to a dll.  Once this dll has been called and the database accesed, dialogue boxes will no longer appear including dialog boxes from functions such as "open file" with the prompt user for path option selected (an error is returned saying that the operation was cancelled by the user).  Even file-open from the Lab View menu bar will not bring up a dialogue box.  Only dialogue boxes in LabView are affected and functionality can only be restored by restarting Labview.  This problem is experienced on XP machines, but fails to occur on at least one Windows 2000 machine.  Has anyone else experienced this or have an idea of what might be causing this.
0 Kudos
Message 1 of 5
(725 Views)
I don't know if I can help much but what DLL and what function are you calling? Is this a DLL you wrote? I access an MSDE database constantly (at least my IS department says it's MSDE) with ADO ActiveX and SQL queries with no problems.
0 Kudos
Message 2 of 5
(718 Views)
We're actually using our own dll that we wrote to integrate some existing code into LabView.  When the code that contains the database calls is executed by its self, no problems arise, even if Labview is running.  When the exact same code is called from the call library function,  no more dialogue boxes in LabView.
0 Kudos
Message 3 of 5
(714 Views)


@birddog wrote:
We're actually using our own dll that we wrote to integrate some existing code into LabView.  When the code that contains the database calls is executed by its self, no problems arise, even if Labview is running.  When the exact same code is called from the call library function,  no more dialogue boxes in LabView.

I've written a DLL myself to interact through ODBC with a number of databases and I can't see this behaviour in any LabVIEW version from 6.0 up to and including 7.1. What API do you use in the DLL to contact MSDE? If it is ODBC are you using SQLDriverConnect or SQLConnect?

Rolf Kalbermatter
Rolf Kalbermatter
Averna BV
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
0 Kudos
Message 4 of 5
(706 Views)

We don't use SQLDriverConnect or SQLConnect.  We depend on whatever the class CDatabase uses.  This example just opens and closes the connection without doing any specific query, but that is enough to break things.

//Exported function
SOME_EXPORT_DEFINE long BECEXtract(  /* some params */  )
{
 AFX_MANAGE_STATE(  AfxGetStaticModuleState()  );

 //BEC01 is a PC name
 CString strConnect = "Driver={SQL Server};Server=BEC01;Database=BECLocal;Trusted_Connection=yes;";

 CDatabase db;
 BOOL bResult = db.OpenEx(  strConnect, CDatabase:Smiley SurprisedpenReadOnly|CDatabase::noOdbcDialog  );
 db.Close();
 return bResult;
}

0 Kudos
Message 5 of 5
(696 Views)