Click here to Skip to main content
15,896,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDrive name Pin
MsmVc7-Sep-08 18:41
MsmVc7-Sep-08 18:41 
AnswerRe: Drive name Pin
_AnsHUMAN_ 7-Sep-08 18:46
_AnsHUMAN_ 7-Sep-08 18:46 
GeneralRe: Drive name Pin
MsmVc7-Sep-08 19:31
MsmVc7-Sep-08 19:31 
GeneralRe: Drive name Pin
MsmVc7-Sep-08 19:36
MsmVc7-Sep-08 19:36 
GeneralRe: Drive name Pin
_AnsHUMAN_ 7-Sep-08 19:53
_AnsHUMAN_ 7-Sep-08 19:53 
AnswerRe: Drive name Pin
Naveen7-Sep-08 18:59
Naveen7-Sep-08 18:59 
QuestionCOM STA thread Pin
George_George7-Sep-08 16:03
George_George7-Sep-08 16:03 
AnswerRe: COM STA thread Pin
Roger Stoltz7-Sep-08 22:53
Roger Stoltz7-Sep-08 22:53 
GeneralRe: COM STA thread Pin
George_George7-Sep-08 23:08
George_George7-Sep-08 23:08 
GeneralRe: COM STA thread Pin
Roger Stoltz8-Sep-08 0:15
Roger Stoltz8-Sep-08 0:15 
GeneralRe: COM STA thread Pin
George_George8-Sep-08 0:39
George_George8-Sep-08 0:39 
GeneralRe: COM STA thread Pin
Roger Stoltz8-Sep-08 2:06
Roger Stoltz8-Sep-08 2:06 
GeneralRe: COM STA thread Pin
George_George8-Sep-08 20:21
George_George8-Sep-08 20:21 
QuestionExecutable COM Pin
RYU^^7-Sep-08 13:58
RYU^^7-Sep-08 13:58 
AnswerRe: Executable COM Pin
RYU^^7-Sep-08 16:31
RYU^^7-Sep-08 16:31 
Questionset values to charachter arrays which are entered [modified] Pin
toprogramminguy7-Sep-08 13:54
toprogramminguy7-Sep-08 13:54 
AnswerRe: set values to charachter arrays which are entered Pin
Vincen Wang7-Sep-08 15:04
Vincen Wang7-Sep-08 15:04 
GeneralRe: set values to charachter arrays which are entered [modified] Pin
toprogramminguy8-Sep-08 5:51
toprogramminguy8-Sep-08 5:51 
GeneralRe: set values to charachter arrays which are entered [modified] Pin
Vincen Wang8-Sep-08 16:09
Vincen Wang8-Sep-08 16:09 
GeneralRe: set values to charachter arrays which are entered Pin
toprogramminguy10-Sep-08 6:19
toprogramminguy10-Sep-08 6:19 
GeneralRe: set values to charachter arrays which are entered Pin
Vincen Wang15-Sep-08 15:03
Vincen Wang15-Sep-08 15:03 
Questioncannot open any more tables pls help Pin
GPat247-Sep-08 11:49
GPat247-Sep-08 11:49 
Cannot figure out i am doing wrong.
Program works fine, List with a check box. Initially ViewJob() is call in the On_InitDialog(). But on refreshing the data list after CheckBox check, get error saying "cannot open any more table"

//control notification
ON_NOTIFY(LVN_ITEMCHANGED, IDC_JOB_LIST, OnItemchangedLinksList)

//
void CICT_JOBS_ADMINDlg::OnItemchangedLinksList(NMHDR* pNMHDR, LRESULT* pResult)
{

CDaoDatabase onclickdb;
CDaoRecordset OnrecSet(&onclickdb);

int nItem = m_ViewJobs.GetItemCount();

CString strSQL;
onclickdb.Open("ICTNAS.mdb");

for(nItem =0 ; nItem < m_ViewJobs.GetItemCount();nItem++) {
BOOL bCheck = m_ViewJobs.GetCheck(nItem);
if( bCheck == 1)
{
CString sub = m_ViewJobs.GetItemText(nItem, 1);
OnrecSet.Open(AFX_DAO_USE_DEFAULT_TYPE,"SELECT * FROM Task WHERE Subject = '"+sub+"'",NULL);
OnrecSet.Edit();
OnrecSet.SetFieldValue("Task","TRUE");
OnrecSet.Update();
UpdateData(TRUE);
OnrecSet.Close();
onclickdb.Close();
ViewJobs(); *****Error With This line*****Refresh the Listbox***
}


}

*pResult = 0;


}
void CICT_JOBS_ADMINDlg::ViewJobs()
{

COleVariant var,varValue;
var.ChangeType(VT_BSTR, NULL);
CDaoDatabase vewdb;
CDaoRecordset rvewSet(&vewdb);

ListView_SetExtendedListViewStyle
(m_ViewJobs.m_hWnd, LVS_EX_CHECKBOXES | LVS_EX_GRIDLINES);

CString subJect,date;
vewdb.Open("ICTNAS.mdb"); // Open Clients.MDB
rvewSet.Open(AFX_DAO_USE_DEFAULT_TYPE,"SELECT * FROM Task WHERE Task=NO ",NULL);
while(!rvewSet.IsEOF()) // Do until EOF
{
int i = 0;

rvewSet.GetFieldValue("Subject",var);
subJect = (LPCSTR)var.pbstrVal;
m_ViewJobs.InsertItem(0,"",0);
m_ViewJobs.SetItemText(0,1,subJect);
rvewSet.GetFieldValue( "Start Date", varValue );
date = COleDateTime(varValue).Format(_T("%d/%m/%y"));
m_ViewJobs.SetItemText(0,2,date);
i=i++;
rvewSet.MoveNext();

}
rvewSet.Close();
vewdb.Close();
}

any help would be nice. Sniff | :^)

Gpat

AnswerRe: cannot open any more tables pls help Pin
Rane7-Sep-08 19:21
Rane7-Sep-08 19:21 
GeneralRe: cannot open any more tables pls help Pin
GPat248-Sep-08 1:49
GPat248-Sep-08 1:49 
QuestionRe: cannot open any more tables pls help Pin
Mark Salsbery8-Sep-08 6:29
Mark Salsbery8-Sep-08 6:29 

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.