Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Converting TParams to ADO TParameters

Converting TParams to ADO TParameters

Converting TParams to ADO TParameters

I use this code from whosrdaddy back in 06/08/04. But I keep getting typecast errors {same problem as ehamlin}. Any help?

Code as below:

function ConvertToADOParms(Owner: TADOStoredProc; aParams: TParams): TParameters;

var i: integer;

// Convert a standard TParams object to an ADO-specific TParameters object
Result :=nil;
if aParams = nil then exit;
Result :=TParameters.create( Owner, TParameter);
for i:=0 to aParams.count - 1 do
if aParams[i] = nil then continue;
with Result.AddParameter do
Name := aParams[i].Name;
Datatype :=aParams[i].DataType;
Direction :=TParameterDirection(aParams[i].ParamType);
Size :=aParams[i].size;
Value :=aParams[i].value;
on e:exception do
Result :=nil;
showmessage('Could not convert standard parameter object to ADO parameter object: '+e.message);

RE: Converting TParams to ADO TParameters

Hi OhDelphi,

I need more information from you:

- what delphi version are you using?
- can you tell me which line throws the typecast error (step thorugh with the debugger)?


What You See Is What You Get
Never underestimate tha powah of tha google!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close