String ls_SQL_1, ls_errors
String ls_1
Int I
For I=1 to dw_1. Rowcount ()
Ls_1=dw_1. Getitemstring (I, 0)
//IF Len (ls_errors) & gt; 0 THEN
//MessageBox (" error ", "SyntaxFromSQL () error:" + ls_errors)
//RETURN
//END IF
Ls_SQL_1=ls_SQL_1 + ls_1 + 'integer null, ~ r ~ n'
End for
String ls_sql="if (object_id (' PJNR ') is not null) drop table PJNR"
The execute immediate: ls_sql;
Ls_SQL_1="CREATE TABLE PJNR" + & amp;
"(no. Char (12) not null, PRIMARY KEY" + & amp;
"The name char (12) not null," + & amp;
Ls_sql_1 + & amp;
"Overall numeric (3) the not null)"
The EXECUTE IMMEDIATE: ls_SQL_1 USING sqlca;
commit;
If the sqlca. Sqlcode<> 0 then
Messagebox (" ", "fail")
The else
Messagebox (" ", "success")
End the if
Disconnect;
The connect.
If the sqlca. Sqlcode<> 0 then
Messagebox (" prompt ", "database connection error, please try again after checking!" , stopsign!)
The else
Messagebox (" prompt ", "database have connection again!" , information!
End the if
Runtime error, show as follows:
Error: the DataWindow colunm type dosed the not match the GetItem type at line 5 at clicked event of object cb_1 of w_zbgl.
Thought is to read the data sheet of the data type of the problem, but changed many times, are equally wrong, used numeric, decimal and char, cannot solve the problem, please give directions!
CodePudding user response:
Grammar:String dwcontrol. GetItemString (long row, an integer column {, DWBuffer DWBuffer, Boolean originalvalue})
CodePudding user response:
There is something wrong with the fifth line of codeLs_1=dw_1. Getitemstring (I, 0)
The second parameter should be column name in brackets, and using quotation marks,
CodePudding user response:
Ls_1=dw_1. Getitemstring (I, 0) to ls_1=dw_1. Getitemstring (I, 2) after can run smoothly, but reading is the second column of the data, with 0 or 1 is wrong, but I will read the first column of data, how to change?CodePudding user response:
The first column of the data types not char/varcharIf it is a data type getitemnumber ()
The date type getitemdatetime ()
CodePudding user response:
The first and second column data type is charCodePudding user response: