 |
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
willfox
註冊時間: 2006-05-24 文章: 3
第 1 樓
|
發表於: 星期日 五月 28, 2006 9:48 am 文章主題: 如何解决同名的对象成员已经存在的错误 |
|
|
大家好!
我的多表多条件查询已经完成的差不多了,界面如下图.
当每次执行查询后生成临时表,并把临时表加载到"浏览查询结果"页面,但是如果重复执行第二次查询后,系统弹出错误:同名的对象成员已经存在.
查询按钮的部分代码如下:
if !used("temptable") &&temptable 临时表
use temptable alias temp in 0
else
sele temptable
endif
*组合sql查询语句
if thisform.pagefrm.querypage.optiongroup2.value=1
select * from &QueryTableStr into dbf temptable where &SqlWhere1
endif
if thisform.pagefrm.querypage.optiongroup2.value=2
sqlcond="where ("+SqlWhere1+")"+" and ("+SqlWhere2+")"
select * from &QueryTableStr into cursor temptable &sqlcond
endif
if thisform.pagefrm.querypage.optiongroup2.value=3
sqlcond="where ("+SqlWhere1+")"+" or ("+SqlWhere2+")"
select * from &QueryTableStr into cursor temptable &sqlcond
endif
*加载临时表
go top
thisform.pagefrm.activepage=2
thisform.pagefrm.listpage.addobject('gridcx','grid')
thisform.pagefrm.listpage.gridcx.visible=.t.
thisform.pagefrm.listpage.gridcx.left=0
thisform.pagefrm.listpage.gridcx.top=20
thisform.pagefrm.listpage.gridcx.width=546
thisform.pagefrm.listpage.gridcx.height=268
thisform.pagefrm.listpage.gridcx.deletemark=.F.
thisform.show
(注:附件文件只是个图片,并非代码,网友们不用下载.等我调试完毕,将把代码发上来,届时欢迎指正.) |
|
回頂端 |
|
 |
garfield Site Admin

註冊時間: 2003-01-30 文章: 2160
第 2 樓
|
發表於: 星期一 五月 29, 2006 9:45 am 文章主題: |
|
|
如果你在 use 時使用 alias
應該用 used( alis的別名) 來判斷 _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
 |
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|