各位请看:为何这个程序不能成功

camposs 2003-10-16 06:37:05
其中dw_1是一个数据窗口
string ls_sql
string ls_mysql
string ERRORS
ls_sql = "SELECT 'school'.'school_id','school'.'schoolname' FROM 'school' "
ls_mysql = SQLCA.SyntaxFromSQL(ls_sql, "", ERRORS)
dw_1.create(ls_mysql)
dw_1.settransobject(sqlca)
dw_1.retrieve()
if dw_1.create(ls_mysql)=1 then
messagebox("提示","创建成功")
end if
为什么动态创建数据窗口不能成功
...全文
27 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqjj7758 2003-10-16
  • 打赏
  • 举报
回复
string dwsyntax
dwsyntax='release 9;~n'+&
'datawindow(units=0 timer_interval=0 color=1073741824 processing=1 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no grid.lines=0 )~n'+&
'header(height=80 color="536870912" )~n'+&
'summary(height=0 color="536870912" )~n'+&
'footer(height=0 color="536870912" )~n'+&
'detail(height=84 color="536870912" )~n'+&
'table(column=(type=char(1) update=yes updatewhereclause=yes key=yes name=code dbname="tb_product_code.code" )~n'+&
' column=(type=char(20) update=yes updatewhereclause=yes name=s'+this.object.code[row]+'_type dbname="tb_product_code.s'+this.object.code[row]+'_type" )~n'+&
' column=(type=char(20) update=yes updatewhereclause=yes name=s'+this.object.code[row]+'_measure dbname="tb_product_code.s'+this.object.code[row]+'_measure" )~n'+&
' retrieve="PBSELECT( VERSION(400) TABLE(NAME=~~"dbo.tb_product_code~~" ) COLUMN(NAME=~~"dbo.tb_product_code.code~~") COLUMN(NAME=~~"dbo.tb_product_code.s'+this.object.code[row]+'_type~~") COLUMN(NAME=~~"dbo.tb_product_code.s'+this.object.code[row]+'_measure~~")) " update="dbo.tb_product_code" updatewhere=1 updatekeyinplace=no )'+&
'text(band=header alignment="0" text="Code" border="0" color="33554432" x="9" y="8" height="64" width="146" html.valueishtml="0" name=code_t visible="1" font.face="穝灿砰" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="136" background.mode="1" background.color="536870912" )~n'+&
'text(band=header alignment="0" text="S'+this.object.code[row]+'_Type" border="0" color="33554432" x="165" y="8" height="64" width="471" html.valueishtml="0" name=s'+this.object.code[row]+'_type_t visible="1" font.face="穝灿砰" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="136" background.mode="1" background.color="536870912" )~n'+&
'text(band=header alignment="0" text="S'+this.object.code[row]+'_Measure" border="0" color="33554432" x="645" y="8" height="64" width="485" html.valueishtml="0" name=s'+this.object.code[row]+'_measure_t visible="1" font.face="穝灿砰" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="136" background.mode="1" background.color="536870912" )~n'+&
'column(band=detail id=1 alignment="2" tabsequence=10 border="0" color="33554432" x="9" y="8" height="64" width="146" format="[general]" html.valueishtml="0" name=code visible="1" edit.limit=1 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 edit.displayonly=yes font.face="Courier New" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )~n'+&
'column(band=detail id=2 alignment="0" tabsequence=20 border="0" color="33554432" x="165" y="8" height="64" width="471" format="[general]" html.valueishtml="0" name=s'+this.object.code[row]+'_type visible="1" edit.limit=20 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="穝灿砰" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="136" background.mode="1" background.color="536870912" )~n'+&
'column(band=detail id=3 alignment="0" tabsequence=30 border="0" color="33554432" x="645" y="8" height="64" width="485" format="[general]" html.valueishtml="0" name=s'+this.object.code[row]+'_measure visible="1" edit.limit=20 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="穝灿砰" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="136" background.mode="1" background.color="536870912" )~n'+&
'htmltable(border="1" )~n'+&
'htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )~n'+&
'export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )~n'+&
'import.xml()~n'+&
'export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )'

dw_sourcing_typemeasure.Create(dwsyntax)

dw_sourcing_typemeasure.settransobject(sqlca)
dw_sourcing_typemeasure.retrieve()
这样创建的dwo比较适用
qqjj7758 2003-10-16
  • 打赏
  • 举报
回复
up
提示的错误是什么
annyzgf 2003-10-16
  • 打赏
  • 举报
回复
应改为:
string ls_sql
string ls_mysql
string ERRORS
ls_sql = "SELECT 'school'.'school_id','school'.'schoolname' FROM 'school' "
ls_mysql = SQLCA.SyntaxFromSQL(ls_sql, "", ERRORS)
dw_1.create(ls_mysql,errors)
if Len(errors) = 0 then
messagebox("提示","创建成功")
else
messagebox("error",errors)
return
end if
dw_1.settransobject(sqlca)
dw_1.retrieve()
camposs 2003-10-16
  • 打赏
  • 举报
回复
你以为我没试过吗??
ximm 2003-10-16
  • 打赏
  • 举报
回复
FT,你就不能改过来先试试
我动态生成时除非是用到常量才'"相结合。
camposs 2003-10-16
  • 打赏
  • 举报
回复
不是这样的,上面有一个SQLCA.SyntaxFromSQL(ls_sql, "", ERRORS)函数已经把它转化成了pb可以识别的sql语句
ximm 2003-10-16
  • 打赏
  • 举报
回复
ls_sql = "SELECT school_id,schoolname FROM school "
szpqq 2003-10-16
  • 打赏
  • 举报
回复
动态产生的没怎么用过,是否审核:'school'.'school_id'这些单引号需要吗?


1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧