Of course!
I have a TSQLConnection linked to a SQLServer 2000.
A TSQLDataSet, linked to this Connection, with the name of the stored procedure (ms_Teste).
The stored procedure is like this:
create procedure ms_Teste
@Id as varchar(12),
@Nome as varchar(12)
as
Select * from wtDocAM
Where convert(varchar(12), idDocAM) Like @Id and Num Like @Nome
Go
I have an TDataSetProvider linked to this TSQLDataSet and a TSQLClientDataSet linked to the TDataSetProvider.
A TDataSource linked to the TSQLClientDataSet and finally a DBGrid linked to the TDataSource
Something like this
TSQLConnection
|
TSQLDataSet
|
TSQLDataSetProvider
|
TSQLClientDataSet
|
TSQLDataSource
|
TDBGrid
I put two TEdit and a Button on the Form.
Only the TSQLConnection is activated.
When the user press the button, this code is executed (this is the only code on the program):
var
Temp: String;
begin
ClientDataSet1.Close;
if Edit1.Text = '' then
Temp = '%'
else
Temp = Edit1.Text;
SQLDataSet1.Params[0].AsString = Temp;
if Edit2.Text = '' then
Temp = '%'
else
Temp = Edit2.Text;
SQLDataSet1.Params[1].AsString = Temp;
ClientDataSet1.Open;
end;
For test on computer 1 (with Delphi installed), I executed the program and put
on Edit1: 8%
on Edit2: a%
Press the button and get the DBGrid fill with many rows from the database.
On the computer where I don't have the Delphi installed, I do the same, but receive a message telling: 'Procedure 'ms_Teste' expects parameter '@Nome', which was not supplied'
This error is generated by the SQL Server.
I then executed a Tracer with the SQL Profile, and found that to the SQL Server, on the computer without the Delphi installed, only the SECOND parameter was supplied (not the first, @Id), but he thinks that the missing was the Second.
On computer with delphi installed, both parameters were supplied.
I observed the TSQLDataSet. He corrects found the two parameters, but for any reason, pass only the last parameter.
I not test yet, but I think that probably he is passing only the last of the parameters, no matter how many are.
Because no DLL was asked, I think that none is missing.
dbxmss30.dll I supplied with the program. If it is not present, I get an error when the programs try to connect to database.
The Midas.dll I put inside the code, puting the MidasLib on the Uses (because I alread have an error with a different version of Midas on yet other machine, with other program).
For a test, I translate the code to C, and executed.
Again, on the computer with Delphi (RAD) instaled, all works perfectly.
On the other machine, only the last parameter is passed...
Because Stored Procedures works ok, and We have others programs that uses it a lot (commercial programs), and because on the sql server, I can use these sp with many parameter without error, I think that can be some Lib on these computers that are old or incompatible versions...
Only this can explain this...
But I can't find what is...
Do you have this problem or see it yet?
I really need to make this work, but can't find a workaround...