11-06-2008 03:26 AM
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);
---------------------------------------------------------------------------------------------
11-06-2008 03:44 AM
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,
Aurélien J.
National Instruments France
11-12-2008 07:28 AM
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.
02-06-2009 05:24 AM - edited 02-06-2009 05:28 AM
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.
02-09-2009 07:41 AM
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,
Aurélien J.
National Instruments France
02-12-2009 07:40 AM
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.
03-18-2009 02:28 AM
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.