我现的代码如下:
/ Profile workflow
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=workflow;UID=;PWD=',TableCriteria='t_organization'"
connect; //using sqlca;
if sqlca.sqlcode<>0 then
messagebox("数据库连接失败","错误:"+sqlca.sqlerrtext)
halt
end if
////////////////////////
int i_row
datastore datastore1
datastore1 = CREATE datastore
//datastore1.dataobject= "workflower"//////////
datastore1.settransobject(sqlca)
datastore1.retrieve()
i_row=datastore1.rowcount()
messagebox("",string(i_row))
它不停都是0行,应该是没有选到我的表“t_organization” 另外 datestore(或者说PB)如何传递sql语句?
------解决方案--------------------
1、//datastore1.dataobject= "workflower"//////////
你注释了干嘛,是正确的,你看看你的workflower数据窗口里有没有数据。。
2、另外 datestore(或者说PB)如何传递sql语句?
integer li_rowcount
select count(*) into :li_rowcount from t_organization;
试试
------解决方案--------------------
LZ 查一下
sqlca.syntaxFromSQL()
------解决方案--------------------
- C/C++ code
PB 的帮助里抄的:string ERRORS, sql_syntaxstring presentation_str, dwsyntax_strsql_syntax = "SELECT emp_data.emp_id,"& + "emp_data.emp_name FROM emp_data "& + "WHERE emp_data.emp_salary > 45000"presentation_str = "style(type=grid)"dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax, & presentation_str, ERRORS)IF Len(ERRORS) > 0 THEN MessageBox("Caution", & "SyntaxFromSQL caused these errors: " + ERRORS) RETURNEND IFdw_1.Create( dwsyntax_str, ERRORS)IF Len(ERRORS) > 0 THEN MessageBox("Caution", & "Create cause these errors: " + ERRORS) RETURNEND IFdw_1.retrieve()