[求助]关于GRID的问题
我想让我查询出来的数据在GRID中显示出来,请看我的代码
_______________________________________________
set safety off
close tables all
select 2
use lsb1
zap
use da in 0
sqlcx = "select bh,xm,xh,bm,zw,mpn,bj,fdy from da"
bfh=0
sql1 = ".t."
if thisform.check1.value = 1
sql1 = "bh = '"+alltrim(thisform.Text1.value)+"'"
bFH = 1
endif
sql2 = ".t."
if thisform.check2.value = 1
sql2 = "xh = '"+alltrim(thisform.Text2.value)+"'"
bFH = 1
endif
sql3 = ".t."
if thisform.check3.value = 1
sql3 = "xm = '"+alltrim(thisform.Text3.value)+"'"
bFH = 1
endif
sql4 = ".t."
if thisform.check4.value = 1
sql4 = "bm = '"+alltrim(thisform.combo1.value)+"'"
bFH = 1
endif
sql5 = ".t."
if thisform.check5.value = 1
sql5 = "fdy = '"+alltrim(thisform.Text5.value)+"'"
bFH = 1
endif
sql6 = ".t."
if thisform.check6.value = 1
sql6 = "bj = '"+alltrim(thisform.Text6.value)+"'"
bFH = 1
endif
select da
go top
if bFH = 1
sqlcx = sqlcx + " where "+sql1+" and "+sql2+" and "+sql3+" and "+sql4+" and "+sql5+" and "+sql6 +" into table lsb1"
else
sqlcx = sqlcx + " into table lsb1"
endif
thisform.grid1.recordsource = "lsb1"
use
________________________________________________________
高手帮帮忙哈~
[此贴子已经被作者于2006-8-17 0:50:18编辑过]