大家之不知道下面这个语句大概是个什么意思啊?语句如下:
_sceen.sqlstring=="SELECT tblFix.*,"+" ORDER BY"
全部的语句如下:
IF Thisform.opgFind.Value=1 &&查找全部记录
cWhere=" "
ELSE &&按指定条件查找
*!* 生成SELECT查询表达式
SELECT curFixStruct ------------第1个
DO CASE
CASE curFixStruct.FieldType="C" &&查找字符型数据
DO CASE
CASE Thisform.cboCondition.DisplayValue="等于"
cWhere="WHERE "+Thisform.cboField.DisplayValue+;
"='"+ALLTRIM(Thisform.txtContent.Value)+"'"
CASE Thisform.cboCondition.DisplayValue="不等于"
cWhere="WHERE "+Thisform.cboField.DisplayValue+;
"<>'"+ALLTRIM(Thisform.txtContent.Value)+"'"
CASE Thisform.cboCondition.DisplayValue="包含"
cWhere="WHERE "+Thisform.cboField.DisplayValue+;
"LIKE '%"+ALLTRIM(Thisform.txtContent.Value)+"%'"
ENDCASE
CASE curFixStruct.FieldType="M" &&查找备注型数据
cWhere="WHERE "+Thisform.cboField.DisplayValue+;
"LIKE '%"+ALLTRIM(Thisform.txtContent.Value)+"%'"
CASE curFixStruct.FieldType="N" &&查找数值型数据
cOperator=GetOperator(Thisform.cboCondition.DisplayValue)
cWhere="WHERE "+Thisform.cboField.DisplayValue+;
cOperator+ALLTRIM(STR(Thisform.txtContent.Value,19,2))
CASE curFixStruct.FieldType="D" &&查找日期型数据
cOperator=GetOperator(Thisform.cboCondition.DisplayValue)
cWhere="WHERE "+ALLTRIM(Thisform.cboField.DisplayValue)+;
cOperator+"CONVERT(DATETIME,'"+DTOC(Thisform.txtContent.Value)+"',101)"
ENDCASE
ENDIF
nHandle=GetConnHandle() &&获得连接句柄
IF nHandle>0
IF SQLGETPROP(nHandle,"ConnectBusy") &&检测连接是否忙碌,得到连接属性
=MESSAGEBOX("连接忙碌,请稍候再试!",0+48,"提示")
RETURN
ELSE
*!* 取得要执行的查询可以返回的记录总数
nRecordNumber=0
cSQLString='EXECUTE p_GetQueryRecordNumber "tblFix",'+'"tblAsset",'+;
'"tblFix.AssetNumber=tblAsset.AssetNumber","'+cWhere+'",?@nRecordNumber'
*WAIT WINDOW cSQLString
=SQLSETPROP(nHandle,"Asynchronous",.F.) &&设置为同步连接
IF SQLEXEC(_SCREEN.ConnectHandle,cSQLString)<=0 &&执行失败
=MESSAGEBOX("获取记录数目失败!",0+48,"提示")
RETURN
ENDIF
=ShowProgress(nRecordNumber) &&显示工具栏中的进度条
=SQLSETPROP(nHandle,"Asynchronous",.T.) &&设置为异步连接
_SCREEN.SQLString="SELECT tblFix.*,"+;
"tblAsset.AssetName,"+;
"tblAsset.AssetType,"+;
"tblAsset.AssetSet,"+;
"tblAsset.AssetGroup,"+;
"tblAsset.MadeComp,"+;
"tblAsset.MadeDate,"+;
"tblAsset.InDate,"+;
"tblAsset.Price,"+;
"tblAsset.Depart "+;
"FROM tblFix "+;
"INNER JOIN tblAsset "+;
"ON tblFix.AssetNumber=tblAsset.AssetNumber "+cWhere+;
" ORDER BY tblFix.AssetNumber,tblFix.FixDate"
_SCREEN.ExecMethodAfterSQL="frmQueryFix.SetGrid()"+CHR(13)+;
"frmQueryFix.cmdStop.Enabled=.F."+CHR(13)+;
"frmQueryFix.cmdStart.Enabled=.T."+CHR(13)+;
"frmQueryFix.grdFind.Setfocus" &&设置在读取数据完成后要执行的程序语句---=-第2个
_SCREEN.CursorName="curFix"
_SCREEN.TotleFetchRec=0 &&清空总记录数
=CURSORSETPROP("FetchAsNeeded",.T.,0) &&设置根据需要下载记录
*!* 下面的语句指定每次读取100条记录,如果希望进度条显示的更准确可以设置每次读取1条,
*!* 但是读取速度会明显下降
=CURSORSETPROP("FetchSize",100,0)
IF USED("curFix") &&关闭表,重新读取
USE IN curFix
Thisform.SetGrid()
ENDIF
=SQLEXEC(nHandle,_SCREEN.SQLString,"curFix")
oProgressBar.cntProg.tmrRefreshProg.Enabled=.T.
ENDIF
ENDIF
其中第1个中选择的数据表,其实在书中的编程中并没有啊?不知道他是怎么调用的?请高手指教阿!谢谢呵!
不知道大家有没有vfp+sql编程c/s版本(spt技术)的基本编程知识阿?好像其中用到的sql程序比较多 吧?
关于_sceen.sqlstring=="SELECT tblFix.*,"+" ORDER BY"的小问题?