主题:[原创]有高手吗?VC++无法获得 【最大日期编号】 请各位高手帮忙解决,谢谢!
有高手吗?VC++无法获得 【最大日期编号】 请各位高手帮忙解决,谢谢!
long CDLgMain::GetRecordCount(CString sql)
{
long lcount;
try
{
m_pRs->raw_Close();
}
catch(_com_error e)//
{
CString stemp;
stemp.Format("无法获得记录总数:%s",e.ErrorMessage());
AfxMessageBox(stemp);
}
return lcount;
}
CString CDLgMain::GetNewBillID()
{
CString sql,snowtime;
CString sNewID,scurid,snewid;
long lnewid,lcount;
CTime now=CTime::GetCurrentTime();
snowtime=now.Format(_T("%Y%m%d"));//现在:年月日
if(lcount==0)
{
sNewID.Format("%s-00001",snowtime);
return sNewID;
}
try
{
//m_pRs.CreateInstance("ADODB.Recordset");
m_pRs->raw_Close();
}
catch(_com_error e)
{
CString stemp;
stemp.Format("无法获得最大编号!",e.ErrorMessage());
AfxMessageBox(stemp);
}
return sNewID;
}
说明:不检索数据库,程序直接跳过本段,默认数据库为空,直接执行以下程序进行赋值:
if(lcount==0)
{
sNewID.Format("%s-00001",snowtime);
return sNewID;
}
望高手解决,谢谢!本人邮箱:dymajinglei@163.com
long CDLgMain::GetRecordCount(CString sql)
{
long lcount;
try
{
m_pRs->raw_Close();
}
catch(_com_error e)//
{
CString stemp;
stemp.Format("无法获得记录总数:%s",e.ErrorMessage());
AfxMessageBox(stemp);
}
return lcount;
}
CString CDLgMain::GetNewBillID()
{
CString sql,snowtime;
CString sNewID,scurid,snewid;
long lnewid,lcount;
CTime now=CTime::GetCurrentTime();
snowtime=now.Format(_T("%Y%m%d"));//现在:年月日
if(lcount==0)
{
sNewID.Format("%s-00001",snowtime);
return sNewID;
}
try
{
//m_pRs.CreateInstance("ADODB.Recordset");
m_pRs->raw_Close();
}
catch(_com_error e)
{
CString stemp;
stemp.Format("无法获得最大编号!",e.ErrorMessage());
AfxMessageBox(stemp);
}
return sNewID;
}
说明:不检索数据库,程序直接跳过本段,默认数据库为空,直接执行以下程序进行赋值:
if(lcount==0)
{
sNewID.Format("%s-00001",snowtime);
return sNewID;
}
望高手解决,谢谢!本人邮箱:dymajinglei@163.com