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

C / C++ / MFC

 
QuestionWhere to delete item data with CListCtrl Pin
followait4-Sep-05 16:24
followait4-Sep-05 16:24 
AnswerRe: Where to delete item data with CListCtrl Pin
Jose Lamas Rios4-Sep-05 19:12
Jose Lamas Rios4-Sep-05 19:12 
GeneralThank you. It works. Pin
followait4-Sep-05 19:54
followait4-Sep-05 19:54 
AnswerRe: Where to delete item data with CListCtrl Pin
Kelly Herald4-Sep-05 20:06
Kelly Herald4-Sep-05 20:06 
GeneralRe: Where to delete item data with CListCtrl Pin
Jose Lamas Rios4-Sep-05 20:26
Jose Lamas Rios4-Sep-05 20:26 
GeneralIt doesn't help to delete item data. Pin
followait4-Sep-05 20:43
followait4-Sep-05 20:43 
GeneralRe: It doesn't help to delete item data. Pin
Kelly Herald6-Sep-05 4:07
Kelly Herald6-Sep-05 4:07 
QuestionConnection to SQL? Pin
Member 21004814-Sep-05 16:22
Member 21004814-Sep-05 16:22 
Hello all,
I have a function - UpdateTimes() - that connected to SQL server. It will increases the Times value in my database if this value less than 5.
The code like this:
void UpdateTimes()
{
CDatabase m_Db;
CRecordset m_Rs(&m_Db);

m_Db.OpenEx(_T("DSN=MyData;UID=sa;PWD=sa"),0);
CString sSQL_Sel = "SELECT ConID,ChkTimes FROM tblList";
m_Rs.Open(CRecordset::forwardOnly, _T(sSQL_Sel));

while (!m_Rs.IsEOF())
{
short ind = 0;
CString sID;
m_Rs.GetFieldValue(ind, sID);

ind = 1;
CDBVariant varTimes;
m_Rs.GetFieldValue(ind, varTimes);

if (varID.m_iVal <= 5)
{
varID.m_iVal ++;

CString sTemp;
sTemp.Format("%d", varTimes.m_iVal);

CString sSQL_Upd = "UPDATE tblList SET [ChkTimes] = " + sTemp + " WHERE ConID like '" + sID + "'";

m_Db.ExecuteSQL(sSQL_Upd);
}
m_Rs.MoveNext();
}
m_Rs.Close();
m_Db.Close();
}

If my database has only 1 record, this code is OK. But if I have more than 2 records, it has an error message, say "Connection is busy ...".
So do you have another way to do it? Pls help me ...
Thank you very much.
AnswerRe: Connection to SQL? Pin
Steve S5-Sep-05 0:11
Steve S5-Sep-05 0:11 
QuestionPrinting Pin
Ivan Cachicatari4-Sep-05 16:00
Ivan Cachicatari4-Sep-05 16:00 
QuestionHow to determine if a window has scroll bar? Pin
followait4-Sep-05 15:25
followait4-Sep-05 15:25 
AnswerRe: How to determine if a window has scroll bar? Pin
Jose Lamas Rios4-Sep-05 19:22
Jose Lamas Rios4-Sep-05 19:22 
GeneralCListCtrl, any way? Pin
followait4-Sep-05 19:55
followait4-Sep-05 19:55 
GeneralRe: CListCtrl, any way? Pin
Jose Lamas Rios4-Sep-05 20:04
Jose Lamas Rios4-Sep-05 20:04 
GeneralIt's ok. Thank you very much. Pin
followait4-Sep-05 20:29
followait4-Sep-05 20:29 
QuestionHow to play *.rm ? Pin
alias00184-Sep-05 15:20
alias00184-Sep-05 15:20 
AnswerRe: How to play *.rm ? Pin
Christian Graus4-Sep-05 15:35
protectorChristian Graus4-Sep-05 15:35 
QuestionNeed help with my code for infix to postfix... Pin
residually4-Sep-05 14:36
residually4-Sep-05 14:36 
AnswerRe: Need help with my code for infix to postfix... Pin
G Haranadh5-Sep-05 21:00
G Haranadh5-Sep-05 21:00 
Questionwhy does CListCtrl.InsertItem return -1? Pin
/*Trucker*\4-Sep-05 12:40
/*Trucker*\4-Sep-05 12:40 
AnswerRe: why does CListCtrl.InsertItem return -1? Pin
Christian Graus4-Sep-05 14:24
protectorChristian Graus4-Sep-05 14:24 
GeneralRe: why does CListCtrl.InsertItem return -1? Pin
/*Trucker*\4-Sep-05 16:39
/*Trucker*\4-Sep-05 16:39 
Questionrefactoring tool Pin
wb4-Sep-05 11:47
wb4-Sep-05 11:47 
AnswerRe: refactoring tool Pin
Christian Graus4-Sep-05 11:59
protectorChristian Graus4-Sep-05 11:59 
QuestionIExplorer 6 runtime error! Pin
EA6_Panther4-Sep-05 8:48
EA6_Panther4-Sep-05 8:48 

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.