Click here to Skip to main content
15,902,021 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question2-dimensional array of strings Pin
namy119-Dec-06 22:52
namy119-Dec-06 22:52 
AnswerRe: 2-dimensional array of strings Pin
sunit519-Dec-06 23:13
sunit519-Dec-06 23:13 
AnswerRe: 2-dimensional array of strings Pin
toxcct19-Dec-06 23:18
toxcct19-Dec-06 23:18 
AnswerRe: 2-dimensional array of strings Pin
sunit520-Dec-06 0:51
sunit520-Dec-06 0:51 
AnswerRe: 2-dimensional array of strings Pin
Sam Hobbs20-Dec-06 18:05
Sam Hobbs20-Dec-06 18:05 
Questionaccess violation Pin
neha.agarwal2719-Dec-06 22:42
neha.agarwal2719-Dec-06 22:42 
AnswerRe: access violation Pin
Naveen20-Dec-06 0:32
Naveen20-Dec-06 0:32 
QuestionMemory Leak in SQLExecuteDirect() Pin
apoorva_raje19-Dec-06 22:37
apoorva_raje19-Dec-06 22:37 
hi This is Apoorva raje.I am facing a problem with SqlExecuteDirect() function, my piece of code is doing deleting all the recods from 12 different table and then insert new records in those tables. each table will have approximate 100 to 1,00,000 records .For deletion i copy the query into a char array and then first allocate a statement handle execute it by SqlExecuteDirect()function and then free the statement handle but even we are freeing the statement handle the memory is not freed and its accumulating around 12mb. the code is given below:


//delete ARCDataSet //Same code for deleting data for 12 other tables
rc = SQLAllocHandle(SQL_HANDLE_STMT,ConHandle,&StmtHandle);
memset(szSQL,0,1024);
sprintf(szSQL,"delete from ARCDataSet");
rc = SQLExecDirect(StmtHandle,(SQLCHAR*)szSQL,strlen(szSQL));
rc = SQLFreeHandle(SQL_HANDLE_STMT,StmtHandle);
//

rc = SQLAllocHandle(SQL_HANDLE_STMT,ConHandle,&StmtHandle);
memset(szSQL,0,1024);
int m_Dsq =0;
m_Dsq = atoi(((ARCAdminDlg*)(AfxGetMainWnd()))->mp_ARCSecDb->m_chDSQ );
sprintf(szSQL,"INSERT INTO ARCDS (ARCDSQ,DBServer,DBSuperUser,DBSuPwd,DBSignature,DBComments,nDsq,noCats,noTabs,noCols,noSTC,noScopes,noDataSets,noEntrances,noEntSets,noPermits) values (\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',%d ,%d , %d, %d,%d ,%d , %d,%d ,%d, %d );"
rc = SQLExecDirect(StmtHandle,(SQLCHAR*)szSQL,strlen(szSQL));
rc = SQLFreeHandle(SQL_HANDLE_STMT,StmtHandle);
// 3.1 end parameters writing into ARCDS
------------------ user details start ------------------------------------*/

// 3.2 begin Isert into Security db , user details
rc = SQLAllocHandle(SQL_HANDLE_STMT,ConHandle,&StmtHandle);
unsigned int nUsq = ((ARCAdminDlg*)(AfxGetMainWnd()))->mp_ARCSecDb->m_noUsers;
int iVal=0;
for ( int nIdx = 0; nIdx < 35000 ; nIdx++)
{
iVal=0;
memset(szSQL,0,1024);
sprintf(szSQL,"insert into ARCdstc (type,dstcSeq,ARCdstcName) values (\'%s\',%d,\'%s\')", chType, ((ARCAdminDlg*)(AfxGetMainWnd()))->mp_ARCSecDb-mp_arcTables[nIdx]->tsq , ((ARCAdminDlg*)(AfxGetMainWnd()))->mp_ARCSecDb->mp_arcTables[nIdx]->tableName
);
rc = SQLExecDirect(StmtHandle,(SQLCHAR*)szSQL,strlen(szSQL));

}

rc = SQLFreeHandle(SQL_HANDLE_STMT,StmtHandle);
// 3.2 end Isert into Security db , user details

//Same code to insert data into 10 other different tables.

Thanks in advance , i will be thankfull to all.
AnswerRe: Memory Leak in SQLExecuteDirect() Pin
James R. Twine20-Dec-06 4:04
James R. Twine20-Dec-06 4:04 
GeneralRe: Memory Leak in SQLExecuteDirect() Pin
apoorva_raje20-Dec-06 22:52
apoorva_raje20-Dec-06 22:52 
QuestionImage segmentation Pin
Rishikant_Prince19-Dec-06 22:35
Rishikant_Prince19-Dec-06 22:35 
AnswerRe: Image segmentation Pin
567890123419-Dec-06 22:45
567890123419-Dec-06 22:45 
QuestionApplication Error Pin
Programm3r19-Dec-06 22:32
Programm3r19-Dec-06 22:32 
AnswerRe: Application Error Pin
Hamid_RT20-Dec-06 0:01
Hamid_RT20-Dec-06 0:01 
QuestionRe: Application Error [modified] Pin
Programm3r20-Dec-06 0:33
Programm3r20-Dec-06 0:33 
AnswerRe: Application Error Pin
Mila02520-Dec-06 1:47
Mila02520-Dec-06 1:47 
QuestionRe: Application Error [modified] Pin
Programm3r20-Dec-06 3:28
Programm3r20-Dec-06 3:28 
QuestionDisplay ActiveX Control in Shared Dll Pin
QuickDeveloper19-Dec-06 22:31
QuickDeveloper19-Dec-06 22:31 
QuestionHow can i create a Global Desktop Pin
SelvaKr19-Dec-06 22:29
SelvaKr19-Dec-06 22:29 
QuestionCListBox with lines? Pin
bosfan19-Dec-06 22:28
bosfan19-Dec-06 22:28 
AnswerRe: CListBox with lines? Pin
Monty219-Dec-06 22:41
Monty219-Dec-06 22:41 
GeneralRe: CListBox with lines? Pin
bosfan20-Dec-06 0:46
bosfan20-Dec-06 0:46 
AnswerRe: CListBox with lines? Pin
CPallini20-Dec-06 2:12
mveCPallini20-Dec-06 2:12 
AnswerRe: CListBox with lines? Pin
James R. Twine20-Dec-06 2:13
James R. Twine20-Dec-06 2:13 
QuestionHow can i disable an item of context popup menu when it appears on right click ? Pin
barunkumarsingh19-Dec-06 22:20
barunkumarsingh19-Dec-06 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.