VF题,帮忙看一下……在线等待!!!
1.XS中包含学号(字符型)和出生日期(日期型)字段;查询与学号12060201同一天出生的学生信息(包含本身),查询结果按学号升序排列,存于CX.TXT中
SELECT * FROM XS
WHERE 出生日期 [1]
(SELECT [2] FROM XS WHERE 学号=‘12060201’)
ORDER BY 学号
[3 to file CX.TXT]
运行程序时,在表单Form1的TEXT1上输入学号,当鼠标单击FROM2的“查询”按钮时将显示该学生的相关信息
From2 的 Init事件代码
[1]
use XSB
Do Form form1.SCX name TF
Form2的“查询”按钮的click时间按代码:
[2] &&取表单Form1中的学号
LOCATE ROR ALLTRZM (F_XH)==X
IF [3]
THIS FORM.LABEL1.CAPTION = F_XM
THIS FORM.LABEL2.CAPTION = IIF(F_XB="1",‘男’,'女')
ELSE
ME SSAGEBOX('没找到'+X)
end if
[解决办法]
请参考:
Select A.* Into Cursor T1 From XS A Inner Join XS B On A.学号=B.学号 And A.出生日期=B.出生日期 Where Alltrim(B.学号)=="12060201" Order By A.学号
Select T1
Copy To CX.TXT Delimited With Blank &&以空格为分隔符
或
Select 学号,出生日期 Into Cursor T1 From XS Where Alltrim(学号)=="12060201"
Select * Into Cursor T2 From XS A Inner Join T1 B On A.学号=B.学号 And A.出生日期=B.出生日期
Select T2
Copy To CX.TXT Delimited With Blank &&以空格为分隔符