dbexpress errors, anxious!

Category: Delphi -> Database Author: liyu99 Date: 2014-12-14 10:25:23
 
liyu99
2014-12-14 10:25:23
When using a stored procedure component dbexpress do a query for the first time be able to check out the data, but the second prompt: Project Invocesystem.exe raised exception class EDatabaseError with message 'Database Server Error: SQL State: HY000, SQL Error Code: 0
lxh623
2014-12-14 10:43:46
prompt like sql error,
is not your query control in the second when used without clear inside the sql statement?
zmddragon
2014-12-14 10:52:50
explain what a database, the stored procedure parameter list.
DBExpress executing the stored procedure when there were some minor problems
gong714914206
2014-12-14 11:06:31
Environment: Delphi2005 sp3, sqlserver2000 database, and patched
emptied when the second query SQL statement, stored procedure parameter certainly no problem, because the first time able to query
xiaoyi8586
2014-12-14 11:24:19
whether DBExpress component's error ah? This seems to be no error under D7
dision8705
2014-12-14 11:42:55
number of database connections may issue, first check the number of users sqlserver2000, or to re-initialize the second query stored procedure call control (close and then re-set the stored procedure name ), disconnect the server reconnects it can also solve the problem.
lyping163
2014-12-14 11:54:40
Will Sql where to set the number of users, ah, upstairs second query reset operation is already set up, or not
xiang123000
2014-12-14 12:04:06
no way call with the parameter
directly
begin
call xx;
end;
this way try
lianying0419
2014-12-14 12:22:39
have this call ah, a bit Strange Ha, can not give points detailed code examples
marilyn02
2014-12-14 12:27:12
01 procedure TLocalDataModuleForm.InvoceReport (date1, date2, payee, flag: String);
02 begin
03 ClientDataSet.Active: = False;
04 with SQLStoredProc do
05 begin
06 Close;
07 StoredProcName: = 'invocereport';
08 ; Params.ParamByName ('@ date1'). Value: = date1;
09 Params.ParamByName ('@ date2'). Value: = date2 ;
10 Params.ParamByName ('@ payee'). Value: = payee;
11 Params.ParamByName ('@ flag'). Value: = flag;
12 / / Prepared: = True;
13 ; / / Active: = True;
14 Open;
15 end;
16 ; DataSetProvider.DataSet: = SQLStoredProc;
17 ClientDataSet.Active: = True;
18 end;
above is a data module code, and the second query error, incorrect information, see the top floor, but will be 03,17 OK to remove it can query the data, but the client can not update
DBGrid connection mode as follows:
DBGrid-DataSource -ClientDataSet-DataSetProvider-SQLStoredProc
DBExpress no way due to logging mechanism, so with class three-tier structure
yang5253661
2014-12-14 12:37:22
For example, my stored procedure
create PROCEDURE abc
@ vchSourceSafeINI varchar (255) ='',
@ vchProjectName varchar (255) = ''
AS
select * from fee
GO

----
then I invoked directly SQLDataSet settings CommondText as:
exec abc '1 ', '3'
query data sets through ClientDataSet return to normal.
wogogogo
2014-12-14 12:42:16
good way, it is worth a try, but it seems that there are components DBExpress top floor of the problems, I wonder if there is no master encountered Yeah!
fovmer
2014-12-14 12:44:28
with ClientDataSet.EmptyDataSet try
cinderella_xp
2014-12-14 12:47:12
Thank you for your help, have to try
oxywell
2014-12-14 13:07:06
strange with SQLDataSet tried, everything is normal, why not pair it SQLStoredProc , a BUG ah?
elvenvaliya
2014-12-14 13:13:54
Why nobody back ah, depressed!
q_r_h
2014-12-14 13:20:09
SQLStoredProc.close;
SQLStoredProc.Params.Clear;
SQLStoredProc.StoredProcName: ='';
SQLStoredProc.SchemaName: = 'dbo';
SQLStoredProc.StoredProcName: = 'invocereport';
so look
sjy5327430
2014-12-14 13:23:58
Upstairs, or not, I think with 03 and 17-line statement on, remove the line
chaochaodexiaoyu
2014-12-14 13:41:18
There is no master ah, help Manga
weenyweeny
2014-12-14 13:45:57
The 03 ClientDataSet.Active: = False;
into
if ; ClientDataSet.Active = True then
ClientDataSet.Active: = False;
try