Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Redraw problem Pin
vikas amin4-Nov-05 22:24
vikas amin4-Nov-05 22:24 
QuestionDatabase connectivity ? Pin
shivditya4-Nov-05 17:09
shivditya4-Nov-05 17:09 
QuestionIf anybody here ? Pin
shivditya4-Nov-05 18:14
shivditya4-Nov-05 18:14 
AnswerRe: Database connectivity ? Pin
cmk4-Nov-05 18:41
cmk4-Nov-05 18:41 
QuestionRe: Database connectivity ? Pin
shivditya4-Nov-05 20:14
shivditya4-Nov-05 20:14 
AnswerRe: Database connectivity ? Pin
cmk5-Nov-05 10:30
cmk5-Nov-05 10:30 
AnswerRe: Database connectivity ? Pin
vikas amin4-Nov-05 19:01
vikas amin4-Nov-05 19:01 
QuestionRe: Database connectivity ? Pin
shivditya4-Nov-05 19:21
shivditya4-Nov-05 19:21 
void OleList::ExecuteQuery(CString str,bool refreshcol,bool fillcheckbox)
{


ptr=new CObArray;
USES_CONVERSION;

CDataSource db;
-----> HRESULT hr = db.Open(_T("SQLOLEDB.1"), dbinit);
if (FAILED(hr))
{
AfxMessageBox("Failed To Connect Datasource");
return;
}

CSession session;
session.Open(db);
int i=0;
CCommand product;
CString temp=GenerateSQL();

LONG row;
char tt[50];
hr=product.Open(session,temp, NULL, &row, DBGUID_DEFAULT, true);
if (FAILED(hr))
{
AfxMessageBox("Failed To Create Table");
return;

}
if(refreshcol)
{
// coltype.RemoveAll();
DBTYPE pType;//=NULL;

for(ULONG j=0;j< product.GetColumnCount() && j < colsize;j++)
if(product.GetColumnType(j+1,&pType))
coltype->SetAt(j,pType);
}
i=0;
if(product.MoveFirst()==S_OK)
do{
CStringArray* sarr=new CStringArray;
sarr->SetSize(colsize);
for(int k=1;k<=colsize;k++)
{
CString st;
switch(coltype->GetAt(k-1))
{
case DBTYPE_STR :
{
char* tm=(char*)product.GetValue(k);
st=A2T(tm);break;
}
case DBTYPE_DBTIMESTAMP : st=GetTime(product.GetValue(k)); break;
case DBTYPE_BOOL : GetBool(product.GetValue(k),&st); break;
case DBTYPE_R4 : GetFloat(product.GetValue(k),&st); break;
case DBTYPE_R8 : GetDouble(product.GetValue(k),&st); break;
case DBTYPE_I4 : GetLong(product.GetValue(k),&st); break;
case DBTYPE_I2 : GetSort(product.GetValue(k),&st); break;
case DBTYPE_UI1 : GetUInt(product.GetValue(k),&st); break;
}
/*if(k==1)
InsertItem(i,st);
else
SetItemText(i,k-1,st);*/
st.TrimRight();
sarr->SetAt(k-1,st);
}
ptr->Add(sarr);
i++;
product.FreeRecordMemory();
}while(product.MoveNext()==S_OK);
if(checkarr!=NULL)
checkarr->RemoveAll();
checkarr=new CWordArray;
checkarr->SetSize(i);
for(int m=0;m checkarr->SetAt(m,fillcheckbox+1);
SetItemCountEx(i);
//char tt[50];
//AfxMessageBox(itoa(i,tt,10));
// SetItemCount(i);
Invalidate();
m_HeaderCtrl.listsize=i;
m_HeaderCtrl.checkarr=checkarr;
product.Close();
session.Close();
db.Close();
m_HeaderCtrl.ptr=ptr;
SetCursor(hcurSave);
}

My code is terminating on above line please help.
Actually senior programmer who developed code left for me to debug
help.


|| ART OF LIVING ||

-- modified at 1:25 Saturday 5th November, 2005
QuestionRe: Database connectivity ? Pin
shivditya4-Nov-05 19:25
shivditya4-Nov-05 19:25 
AnswerRe: Database connectivity ? Pin
vikas amin4-Nov-05 19:51
vikas amin4-Nov-05 19:51 
QuestionRe: Database connectivity ? Pin
shivditya4-Nov-05 20:12
shivditya4-Nov-05 20:12 
QuestionDoes OpenGL do alpha or not? Pin
Swinefeaster4-Nov-05 11:30
Swinefeaster4-Nov-05 11:30 
AnswerRe: Does OpenGL do alpha or not? Pin
Graham Shanks4-Nov-05 12:26
Graham Shanks4-Nov-05 12:26 
AnswerRe: Does OpenGL do alpha or not? Pin
El Corazon4-Nov-05 19:31
El Corazon4-Nov-05 19:31 
GeneralRe: Does OpenGL do alpha or not? Pin
vikas amin5-Nov-05 1:22
vikas amin5-Nov-05 1:22 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster7-Nov-05 8:55
Swinefeaster7-Nov-05 8:55 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon7-Nov-05 9:16
El Corazon7-Nov-05 9:16 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster7-Nov-05 12:41
Swinefeaster7-Nov-05 12:41 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon7-Nov-05 13:57
El Corazon7-Nov-05 13:57 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster14-Nov-05 15:40
Swinefeaster14-Nov-05 15:40 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon14-Nov-05 17:08
El Corazon14-Nov-05 17:08 
GeneralRe: Does OpenGL do alpha or not? Pin
Swinefeaster15-Nov-05 8:49
Swinefeaster15-Nov-05 8:49 
GeneralRe: Does OpenGL do alpha or not? Pin
El Corazon15-Nov-05 16:17
El Corazon15-Nov-05 16:17 
QuestionLPSAFEARRAY issues Pin
Axonn Echysttas4-Nov-05 9:46
Axonn Echysttas4-Nov-05 9:46 
AnswerRe: LPSAFEARRAY issues Pin
Mircea Puiu4-Nov-05 23:31
Mircea Puiu4-Nov-05 23:31 

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.