Home > database >  Can't find the problem
Can't find the problem

Time:10-04

String sql_syntax ls_errors, ls_sqlcreate, presentation

Sql_syntax="select datepart (hour, starttime) as per hour, the count (*) inbound volume" & amp;
+ "from dbo. CallStat_WaitInQueue" & amp;
+ "where year (starttime)='2007'" & amp;
+ "and the month (starttime)='6'" & amp;
+ "and" day (starttime) in (' 28 ', '29', '30') "& amp;
+ "group by datepart (hour, starttime)" & amp;
+ "order by 1
"
The presentation="style (type=grid) column (color=255),"

Messagebox (" ", sql_syntax)
Ls_sqlcreate=SQLCA. SyntaxFromSQL (sql_syntax, presentation, ls_errors)


If len (ls_errors) & gt; 0 then
MessageBox (" Error ", ls_errors)
The else
//according to the source code dynamically created data window object
Dw_1. Create (ls_sqlcreate)
Dw_1. Modify (" salary. Background. Mode=2 ")
Dw_1. Settransobject (SQLCA)
Dw_1. Retrieve ()
End the if


Don't know why, this code in the window display not to come out, even disappeared, the data window control which ace to help me see! ~ ~ ~ ~

CodePudding user response:

String s_error
.
Dw_1. Create (ls_sqlcreate s_error)
If len (s_error) & gt; 0 then
MessageBox (" Error ", s_error)
The else
Dw_1. Modify (" salary. Background. Mode=2 ")
Dw_1. Settransobject (SQLCA)
Dw_1. Retrieve ()
End the if
.
So try

CodePudding user response:

Looked, should be the problem of your SQL syntax, your statement is stored in a file, how to perform can see right in SQL -- -- -- -- -- -- -- -- --
String sql_syntax ls_errors, ls_sqlcreate, presentation

Sql_syntax="select datepart (hour, starttime) as per hour, the count (*) inbound volume" & amp;
+ "from dbo. CallStat_WaitInQueue" & amp;
+ "where year (starttime)='2007'" & amp;
+ "and the month (starttime)='6'" & amp;
+ "and" day (starttime) in (' 28 ', '29', '30') "& amp;
+ "group by datepart (hour, starttime)" & amp;
+ "order by 1
"//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- in SQL execution C: \ test. TXT in the SQL statement success
The integer li_FileNum

Li_FileNum=FileOpen (" C: \ test. TXT ", LineMode! The Write! , LockWrite! The Replace!

FileWrite (li_FileNum sql_syntax)
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The presentation="style (type=grid) column (color=255),"

Messagebox (" ", sql_syntax)
Ls_sqlcreate=SQLCA. SyntaxFromSQL (sql_syntax, presentation, ls_errors)


If len (ls_errors) & gt; 0 then
MessageBox (" Error ", ls_errors)
The else
//according to the source code dynamically created data window object
Dw_1. Create (ls_sqlcreate)
Dw_1. Modify (" salary. Background. Mode=2 ")
Dw_1. Settransobject (SQLCA)
Dw_1. Retrieve ()
End the if

CodePudding user response:

I am strange, even the most simple SQL statements are not to come out, now have another window also made similar dynamic data window, no problem, why can't this show? Is the problem statement? But in the SQL query analyzer is no problem,

CodePudding user response:

Too depressed, in a form that, but the head of the field AS Chinese characters, with the display when make the code the solution?

CodePudding user response:

Pick up points is king!
  • Related