p;MessageBox(NULL,"无法读取数据库
资料,可能数据库连接已经断开,请重新连接、然后重试。","连接问题",MB_ICONINFORMATION);
#endif
return FALSE;
}
if((*m_prsThis)->adoEOF)
{
cVal[0]=''\0'';
return FALSE;
}
value = (*m_prsThis)->GetCollect(vIndex);
}
catch(_com_error)
{
ReportError();
// AfxMessageBox("数据库字段访问错误!");
return FALSE;
}
catch()
{
AfxMessageBox("数据库字段访问未知错误!请检查数据库是否改动。",MB_ICONINFORMATION);
return FALSE;
}
if(VerifyVTData(value))
{
switch(value.vt)
{
case VT_BSTR:
c = (char *)_com_util::ConvertBSTRToString( V_BSTR(&value) );
if(VerifyVTData(c))
{
if(nFieldLen<=0)
{
strcpy(cVal,(char*)c);
}
else
{
strncpy(cVal, (char*)c, nFieldLen);
}
}
delete c;
c=NULL;
break;
case VT_I4:
case VT_DECIMAL:
case VT_UI4:
case VT_I8:
case VT_UI8:
case VT_INT:
case VT_UINT:
long lVal;
lVal = long(value);
ltoa(lVal,cVal,10);
break;
case VT_DATE:
dt=value.date;
da=COleDateTime(dt);
// str=da.Format("%Y-%m-%d %H:%M:%S");
str=da.Format("%Y-%m-%d ");
c=new char[64];
memset(c,0,sizeof(char)*64);
strcpy(c,str.GetBuffer(0));
str.ReleaseBuffer();
if(VerifyVTData(c))
{
if(nFieldLen<=0)
{
strcpy(cVal,(char*)c);
}
else
{
strncpy(cVal, (char*)c, nFieldLen);
cVal[nFieldLen]=''\0'';
}
}
delete c;
c=NULL;
&