LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DBActivateMap guetting slower and slower

Solved!
Go to solution

Thanks Aurélien for your advices.

 

I will try to test your solution as soon as possible. I will come back afterwards to thank you or to ask some other questions, depending on the results of the test ...

Just to help to modify the script, do I only have to delete the commands concerning DBActivateMAP and DBDeactivateMap ?

 

Thanks,

Ptit Bleu.

 

------------------------------------------------------------------------------------------------------------------------

// Activate the link with the variables (my translation of the comments of the developer)
statementHandle = DBActivateMap (mapHandle, "Table1");
if (statementHandle < 0 )
{
sprintf ( errMessage, " Error Activating Database");
return 1;
}

// Create the record
resCode = DBCreateRecord (statementHandle);
if (resCode != DB_SUCCESS)
{
sprintf ( errMessage, " Error Creating Record Datadase");
return 1;
}

// Insert the data into the database
resCode = DBPutRecord (statementHandle);
if (resCode != DB_SUCCESS)
{
sprintf ( errMessage, " Error Putting Record Datadase");
return 1;
}

// Deactivate the links with variables
resCode = DBDeactivateMap(mapHandle);
---------------------------------------------------------------------------------------------

0 Kudos
Message 11 of 17
(2,181 Views)

Hi,

 

You can't delete DBActivateMAP and DBDeactivateMap, if you do this you will not be allow to use DBPutRecord. Can you post your CVI code here?You can replace DBPutRecord by DBImmediateSQL but it's miss some data in your code.

 

Best regards,

0 Kudos
Message 12 of 17
(2,175 Views)

Hello Aurélien,

 

I'm not sure I am allowed to post my script here. Could you give me an e-mail address ?

Sorry about that,

Ptit Bleu.

0 Kudos
Message 13 of 17
(2,142 Views)

Hello ajangot,

 

Still I haven't found a solution to my problem.

If I call NI in France and I ask someone at the LabWindows Development team, do I have a chance to talk to you ?

 

Do you think it is possible to substitute  DBActivateMap by a SELECT query on a particular number on a column with an index ?.

Will it connect to the database like with  DBActivateMap but faster ? If yes, how to write this ?

 

Thanks for your help,

Good week-end,

Ptit Bleu.

Message Edité par Ptit Bleu le 02-06-2009 05:28 AM
0 Kudos
Message 14 of 17
(1,997 Views)

Hi,

 

If you call NI france, you will have one of my colleague and he will create a support. He will transmit me the request and I will work on it.

 

With informations in my hand, I think that a select querry is better than DBActivateMap but if I can see your source code, maybe we be able to optimize this 😄

 

Regards,

0 Kudos
Message 15 of 17
(1,970 Views)

Hello ajangot,

 

I haven't found how to send you a private message (is it possible ?), so I use the forum to tell you that I asked for a NI technical support. The reference is : 9563-LZB512.

Thanks in advance for your help and advice.

Ptit Bleu.

 

0 Kudos
Message 16 of 17
(1,946 Views)
Solution
Accepted by topic author Ptit Bleu

Hi,

 

Just a small message to tell you that, thanks to the NI team, my problem is solved.

Withous going into details,

 

They subsituted the DBActivateMap command with 

dbHandle = DBConnect (SaveNomDataBase);
and create a query to insert the data with
sprintf (requete,"INSERT INTO ...

DBImmediateSQL (dbHandle, requete);
The deconnection is done with

resCode = DBDisconnect(dbHandle);

 

Since these modifications, there is no more decrease of the speed !!!

 

Again thank you to the NI team (especially for their patience with me).

Have a good day,

Ptit Bleu. 

0 Kudos
Message 17 of 17
(1,873 Views)