Forgive my naivety, but I'm new to using Delphi with databases (which may seem strange to some).
I established a connection to my database (MSSQL) using TADOConnection. I am using TADOStoredProc to access my stored procedure.
My stored procedure returns 2 columns, a column with server names and a 2nd column full of users on the server. It usually returns around 70 records ... not much data.
How can I programmatically list this stored procedure? I can drop the DBGrid in my form and attach it to the TDataSource (which is then attached to my ADOStoredProc), and I can verify that the data is being retrieved correctly.
Ideally, I would like to list the returned data and move it to a TStringList.
I am currently using the following code to list ADOStoredProc, but it only returns "@RETURN_VALUE":
ADOStoredProc1.Open;
ADOStoredProc1.ExecProc;
ADOStoredProc1.Parameters.Refresh;
for i := 0 to AdoStoredProc1.Parameters.Count - 1 do
begin
Memo1.Lines.Add(AdoStoredProc1.Parameters.Items[i].Name);
Memo1.Lines.Add(AdoStoredProc1.Parameters.Items[i].Value);
end;
source
share