Hi Ed, Please find the code below. I hope this is the solution for you problem.
StoredProc.Close; StoredProc.parameters.clear; ShowMessage(StoredProc.ProcedureName); StoredProc.ProcedureName := thenewprocedurename; StoredProc.Parameters.Refresh; //StoredProc.Parameters[1].Value := newvalue; * StoredProc.Parameters.ParamByName(paramname).Value := newvalue; * StoredProc.Open; Rashmikant On 8/27/07, edsynergy <[EMAIL PROTECTED]> wrote: > > HI, > I am using Delphi 7 enterprise OS = Win 2000 Prof > > I am trying to to use a Tadostoredproc so I can call its parameters > using parambyname. My code is something like this. This is a generic > Tadostoredproc and I feed it the storedprocedure name via a function. > > storedproc.close > storedproc.parameters.clear; > storedproc.procedurename := thenewprocedurename; > storedproc.parameters.refresh; > > After refreshing my expectation is that the storedproc knows about the > parameters names ...but it dos'nt and I get an error message when > using storedproc.parambyname['paramname'].value := newvalue > > This however, storedproc.Parameters[n].Value := newvalue works as > expected but I wish to use parambyname to make my code more readable. > Am I missing something out ? > > best wishes Ed > > > [Non-text portions of this message have been removed]

