LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not put data to MS Access Database when make a CVI release version .

Hello ,

I make an application with CVI 7.1, and using SQL toolkit 2.0 to saving data record. under debug condition , I can find the record has written to the database , but once build it into a release version , it can not write any data , what is wrong? please give an advise.

Here is the source file , and in the ODBC manager , set the data source name as "MRS_TagData",which map to the database:MRSData.mdb.
Just access the tblTagReads table.

Thanks!
0 Kudos
Message 1 of 3
(2,810 Views)
The issue with your application was that your void convertDataFormat (char *dateStr) function was not working properly. The resulting string after this function was run was not correct in Release mode, and it also appeared that the function was running off the end of the char[] array and corrupting data used by other variables. I replaced your function with the one below and the application works as expected in Debug and Release mode.

It will be easier to find problems such as this if you include more error checking in your code. I would suggest looking at the following example program, and implementing similar error checking.

Example Program: LabWindows/CVI SQL Toolkit with MS Access 97

void convertDataFormat (char *dateStr)
{
char timeDate[11];
timeDate[0] = dateStr[6];
timeDate[1] = dateStr[7];
timeDate[2] = dateStr[8];
timeDate[3] = dateStr[9];
timeDate[4] = '-';
timeDate[5] = dateStr[0];
timeDate[6] = dateStr[1];
timeDate[7] = '-';
timeDate[8] = dateStr[3];
timeDate[9] = dateStr[4];
timeDate[10] = '\0';
strcpy(dateStr, timeDate);

}
Message 2 of 3
(2,785 Views)
Hi AE-Scott,

Thank you very much!


David
0 Kudos
Message 3 of 3
(2,767 Views)