Eduardo Jauch
2008-03-26 17:51:17 UTC
Hi
I create this TSQLDataSet:
FCarsDocLDS := TSQLDataSet.Create(nil);
FCarsDocLDS.SQLConnection := FCarsConnection;
FCarsDocLDS.CommandType := ctStoredProc;
FCarsDocLDS.CommandText := 'msDocL';
FCarsDocLDS.Params.CreateParam(ftInteger, '@idDocAM', ptInputOutput);
Then, I use it like this:
with FCarsDocLDS do
begin
if Active then
Close;
ParamByName('@idDocAM').AsInteger := FCarsDocAMDS.FieldByName('idDocAM').AsInteger;
Open;
First;
end;
My problem is: All the involved DBexpress components are created on runtime, But when I try to execute the Open (Because the Sp returns a cursor) my Thread Exits.
The Open Start an Exception that I can't catch. My E (from E : Exception) is always nil.
So, I don't know what is happening...
If I use the value on FCarsDocAMDS.FieldByName('idDocAM').AsInteger; to execute the StoredProc on the SQL Query Analyser, it returns the data existent on the database.
I try to use the SchemaName := 'dbo', but it doesn't work...
On the contrary, start an exception saying that the @idDocAM parameter doesn't exist.
It's not a problem of connection, because I have others DataSets on this thread using the same connection (But simple SELECT statments) that work...
Any Idea?
Thanks!
I create this TSQLDataSet:
FCarsDocLDS := TSQLDataSet.Create(nil);
FCarsDocLDS.SQLConnection := FCarsConnection;
FCarsDocLDS.CommandType := ctStoredProc;
FCarsDocLDS.CommandText := 'msDocL';
FCarsDocLDS.Params.CreateParam(ftInteger, '@idDocAM', ptInputOutput);
Then, I use it like this:
with FCarsDocLDS do
begin
if Active then
Close;
ParamByName('@idDocAM').AsInteger := FCarsDocAMDS.FieldByName('idDocAM').AsInteger;
Open;
First;
end;
My problem is: All the involved DBexpress components are created on runtime, But when I try to execute the Open (Because the Sp returns a cursor) my Thread Exits.
The Open Start an Exception that I can't catch. My E (from E : Exception) is always nil.
So, I don't know what is happening...
If I use the value on FCarsDocAMDS.FieldByName('idDocAM').AsInteger; to execute the StoredProc on the SQL Query Analyser, it returns the data existent on the database.
I try to use the SchemaName := 'dbo', but it doesn't work...
On the contrary, start an exception saying that the @idDocAM parameter doesn't exist.
It's not a problem of connection, because I have others DataSets on this thread using the same connection (But simple SELECT statments) that work...
Any Idea?
Thanks!