v3.0 加快了诗词数据加载速度,诗词总页数达4500页
下载地址v3.1.5
下载地址
v3.2 完善了所有功能
下载地址
华军下载: http://www.newhua.com/soft/84610.htm
霏凡下载: http://www.crsky.com/soft/16464.html
中关村下载:http://xiazai.zol.com.cn/detail/36/356020.shtml
下载地址
《唐诗宋词》的精简版:《唐诗宋词三百首》,只收录唐诗300首,下载地址
SQL优化前后的代码:
void CLeftTree::ByDynasty()
{ CTreeCtrl* m_Tree=&GetTreeCtrl();
CString mytempsql;
// mytempsql=_T("select A.d_dynasty AS MYDYNASTY,A.d_author AS MYAUTHOR,P.d_title AS MYTITLE FROM\
/**//// ((t_author AS A RIGHT JOIN t_dynasty AS D ON A.d_dynasty=D.d_dynasty)\
// LEFT JOIN t_poetry AS P ON A.d_author=P.d_author )ORDER BY D.d_num ASC,A.d_author ASC ,P.d_author ASC");
mytempsql.Format(_T("select D.d_dynasty AS MYDYNASTY,A.d_author AS MYAUTHOR,P.d_title AS MYTITLE FROM\
((t_author AS A RIGHT JOIN t_dynasty AS D ON A.d_dynasty=D.d_dynasty) LEFT JOIN t_poetry AS P ON A.d_author=P.d_author )\
ORDER BY D.d_num ASC,%s ASC ,%s ASC"),str_AuthorByTime,str_ShiByTime);
myado.OnInitADO();
myado.m_pRecordset=myado.GetRecordSet((_bstr_t)mytempsql);
CString str_myDynasty,str_myAuhor,str_myTitle;
_variant_t varD,varA,varT;
try
{
while(!myado.m_pRecordset->adoEOF)
{
// varD = myado.m_pRecordset->GetCollect("MYDYNASTY");
// if(varD.vt!=VT_NULL)
// {
str_myDynasty=(TCHAR*)(_bstr_t)myado.m_pRecordset->GetCollect("MYDYNASTY");
if(wcscmp(str_myDynasty,oldD)!=0)
{
TreeItem[0]=m_Tree->InsertItem(str_myDynasty);
oldD=str_myDynasty;
// oldA=_T("");
}
// }
varA=myado.m_pRecordset->GetCollect("MYAUTHOR");
if(varA.vt!=VT_NULL)
{ str_myAuhor=(TCHAR*)_bstr_t(varA);
if(wcscmp(str_myAuhor,oldA)!=0)
{
TreeItem[1]=m_Tree->InsertItem(str_myAuhor,TreeItem[0]);
oldA=str_myAuhor;
}
}
varT=myado.m_pRecordset->GetCollect("MYTITLE");
if(varT.vt!=VT_NULL)
{
str_myTitle=(TCHAR*)_bstr_t(varT);
if(wcscmp(str_myTitle,oldT))
{
TreeItem[2]=m_Tree->InsertItem(str_myTitle,TreeItem[1]);
oldT=str_myTitle;
}
}
myado.m_pRecordset->MoveNext();
}
myado.ExitConnect();
}
catch(_com_error e)
{
MessageBox(e.Description());
return;
}
/**//* CTreeCtrl* m_Tree=&GetTreeCtrl();
try
{
myado.OnInitADO();
myado2.OnInitADO();
myado4.OnInitADO();
CString sqltempsql=_T("select d_dynasty from t_dynasty order by d_num asc");
myado.m_pRecordset=myado.GetRecordSet((_bstr_t)sqltempsql);
while(!myado.m_pRecordset->adoEOF)
{
str_dynasty=(TCHAR*)(_bstr_t)myado.m_pRecordset->GetCollect("d_dynasty");
TreeItem[0]=m_Tree->InsertItem(str_dynasty,0,0);
sql.Format(_T("select d_author from t_author where d_dynasty='%s' order by %s asc"),str_dynasty,m_strAuthorByTime);
myado2.m_pRecordset=myado2.GetRecordSet((_bstr_t)sql);
while(!myado2.m_pRecordset->adoEOF)
{
str_tempauthor=(TCHAR*)(_bstr_t)myado2.m_pRecordset->GetCollect("d_author");
TreeItem[1]=m_Tree->InsertItem(str_tempauthor,0,0,TreeItem[0]);
OnShowTitles(str_tempauthor);
myado2.m_pRecordset->MoveNext();
}
myado.m_pRecordset->MoveNext();
}
myado4.ExitConnect();
myado2.ExitConnect();
myado.ExitConnect();
}
catch(_com_error e)
{
MessageBox(e.Description());
return;
}*/
}
posted on 2009-05-01 22:20
fly931 阅读(1486)
评论(4) 编辑 收藏 引用