??xml version="1.0" encoding="utf-8" standalone="yes"?>
数据库是mssql2005,在JzData.rar文g?附加卛_;
如果你用的是sql 2000的数据库,请将debug目录下的access数据库jzdata.mdb转换成sql server数据?在查询分析器里执?
exec sp_configure 'show advanced options',1 reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1 reconfigure
create database jz
go
use jz
SELECT *
INTO car
FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0',
'Data Source="D:\GCLsoft\jz\Debug\jzdata.mdb";User ID=Admin;Password=' )...car
SELECT *
INTO moto
FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0',
'Data Source="D:\GCLsoft\jz\Debug\jzdata.mdb";User ID=Admin;Password=' )...moto
use jz
alter table car alter column id int not null
go
alter table car add constraint pkKey1 primary key (id)
alter table moto alter column id int not null
go
alter table moto add constraint pkKey2 primary key (id) --讄主键
数据库名?jz
代码是C++写的,用vc6打开
代码写的不好,如果你有什么好的徏?Ƣ迎与我联系
源代码下载地址
在sql2000?点考试会出现错?如果语句中包?UNION q算W,那么 ORDER BY 子句中的就必须出现在选择列表中。解x?改用视图,在代码里要修改一?
if exists
(select * from dbo.sysobjects where id = object_id(N'[dbo].[v1]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view v1
go
create view v1 as
select top 30 * from car where zhanjie=1 ORDER BY NEWID()
go
if exists
(select * from dbo.sysobjects where id = object_id(N'[dbo].[v2]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view v2
go
create view v2 as
select top 20 * from car where zhanjie=2 ORDER BY NEWID()
go
select * from v1
union all
select * from v2
如果不想使用视图,sql语句q样?也可以解决问?
select * from
(
select * from
(
select top 30 * from car where zhanjie=1 ORDER BY NEWID()
) as a1
union all
select * from
(
select top 20 * from car where zhanjie=2 ORDER BY NEWID()
) as a2
) as a3
?img border="0" alt="" src="http://m.shnenglu.com/images/cppblog_com/fly931/rssdy.jpg" />Q点击这个图案,把它的网址复制_脓到Y件的最上面的RSS一栏中Q点“dRss”卛_完成d?br />你也可以d新闻订阅Q只要是Rss都可以用<博客沙发王〉订阅?br />到更新后,会有声音提示Q屏q右下角提示?
2.收发短信前请先连接短信猫,插入SIM手机?/p>
3.导入txt电话L文g应以start开?endl束,电话L换行昄
4.SQL数据库设|里Q主机名?27.0.0.1?local)
密码要改成你的密码,再按保存修改才生?br> 数据库名字是MYNOTE
1.0版本Q?a title=下蝲地址 href="http://m.shnenglu.com/Files/fly931/MYNOTE.rar">下蝲地址
1.1版本Q?a title=下蝲地址 href="http://m.shnenglu.com/Files/fly931/MYNOTE11.rar">下蝲地址 修改了查询收发日志的一个错误,修改了连接数据库的设|?br>1.2版本Q?a title=下蝲地址 href="http://m.shnenglu.com/Files/fly931/Mynote12.rar">下蝲地址 修改了插入常用短信短语中删除的错误,修改了发短信内容字数140个的限制
1.5版本Q?a title=下蝲地址 href="http://m.shnenglu.com/Files/fly931/MYNOTE15.rar">下蝲地址 Ҏ了自动发送短信的功能Q减了不必要的数据
1.5Access版本(无须安装SQL Server):下蝲地址
1.5.5Access版本(无须安装SQL Server):下蝲地址 Ҏ自动发送短信订单的一个错?MSSQL版本的没有错?br>1.6Access版本(无须安装SQL Server):下蝲地址
华军下蝲: http://www.newhua.com/soft/84610.htm
霏凡下蝲: http://www.crsky.com/soft/16464.html
中关村下?http://xiazai.zol.com.cn/detail/36/356020.shtml
下蝲地址
《唐诗宋词》的_版:《唐诗宋词三N》,只收录唐?00首,下蝲地址
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;
}*/
}
void CTangshiView::OnInitialUpdate()

{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
AddComboKindData();
SetFirstFont();
b_MidText=GetPrivateProfileInt("setting","midtext",0,IniFile);
SetTimer(100,0,NULL);
// KillTimer(100);
}
void CTangshiView::OnTimer(UINT nIDEvent) 

{
if(nIDEvent==100)
{
CMainFrame* m_p=(CMainFrame*)AfxGetApp()->m_pMainWnd;
m_p->m_LeftTree->AddTreeData();
m_p->m_LeftTree->GetAllNum();
char mystrbuf[102];
CString strtemp_Dynasty,strtemp_Author,strtemp_Title;
GetPrivateProfileString("load","dynasty","当代",mystrbuf,102,IniFile);
strtemp_Dynasty=mystrbuf;
GetPrivateProfileString("load","author",NULL,mystrbuf,102,IniFile);
strtemp_Author=mystrbuf;
GetPrivateProfileString("load","title",NULL,mystrbuf,102,IniFile);
strtemp_Title=mystrbuf;
m_p->m_LeftTree->FirstLoad(strtemp_Dynasty,strtemp_Author,strtemp_Title);
// SASSSSSSSSSSSSSSSSSSSSSS
m_p->b_midplay=GetPrivateProfileInt("setting","midplay",1,IniFile);
GetPrivateProfileString("setting","mid","tangshi.mid",m_p->buf,1024,IniFile);
if(m_p->b_midplay)
m_p->PlaySoundAA(m_p->buf);
KillTimer(100);
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEE
}
CFormView::OnTimer(nIDEvent);
}
void CSearch::OnButtonSearch() 

{
UpdateData();
m_strSearch.TrimLeft();
if(m_strSearch=="")
{
MessageBox("误入要搜烦的诗?/span>","唐诗宋词",64);
m_EditSearch.SetFocus();
return;
}
if(m_checkBaidu)
{
ShellExecute(NULL,NULL,"http://www.baidu.com/s?wd="+m_strSearch,NULL,NULL,SW_SHOWNORMAL);
// return;
}
if(m_checkBaike)
{
ShellExecute(NULL,NULL,"http://baike.baidu.com/list-php/dispose/searchword.php?word="+m_strSearch,NULL,NULL,SW_SHOWNORMAL);
// return;
}
CString sql_search, sql_or,sql_num;
sql_or=m_checkTitle?"d_title":m_checkAuthor?"d_author":"d_poetry";
myado.OnInitADO();//GROUP BY number HAVING COUNT(number) > 1
// sql_search.Format("select count(*) as num from t_poetry where %s like '%'%s'%'",sql_or,m_strSearch);
CString temp_strSearch;
temp_strSearch=m_strSearch;
temp_strSearch.Replace("'","''");
sql_search.Format("select distinct d_title,d_poetry,d_author from t_poetry where %s like '%s%s%s' order by d_author",sql_or,"%",temp_strSearch,"%");
myado.m_pRecordset.CreateInstance(__uuidof(Recordset));
myado.m_pRecordset->Open((_bstr_t)sql_search,myado.m_pConnection.GetInterfacePtr(),adOpenKeyset,adLockOptimistic,adCmdText);
if(myado.m_pRecordset->RecordCount>0)
{
int j;
j=0;
m_List.DeleteAllItems();
while(!myado.m_pRecordset->adoEOF)
{
m_List.InsertItem(j,"");
m_List.SetItemText(j,0,(char*)(_bstr_t)myado.m_pRecordset->GetCollect("d_title"));
m_List.SetItemText(j,1,(char*)(_bstr_t)myado.m_pRecordset->GetCollect("d_poetry"));
m_List.SetItemText(j,2,(char*)(_bstr_t)myado.m_pRecordset->GetCollect("d_author"));
myado.m_pRecordset->MoveNext();
j++;
}
CString str_myshow;
str_myshow.Format("共找?#8220;%s”%d?/span>",m_strSearch,j);
SetDlgItemText(IDC_STATIC_SHOW,str_myshow);
}
else
{
SetDlgItemText(IDC_STATIC_SHOW,"未找?#8220;"+m_strSearch+"”Q百度一下吧Q?/span>");
}
myado.ExitConnect();
}