Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Tools

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2010, 03:17 AM
dp_burtol dp_burtol is offline
Junior Member
 
Join Date: May 2010
Posts: 16
Default What is the best delphi component that will handle stored procedures?

WHAT IS THE BEST DELPHI COMPONENT THAT WILL HANDLE STORED PROCEDURES and VIEWS?

My database is SQL SERVER.
Reply With Quote
  #2  
Old 11-18-2010, 09:04 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

The one that doesn't use CAPSLOCK...

Enough fun, you can use the native components, but when switching to other database systems could be a real pain in the ass... Ok, at this point it's SQL Server (MS/My ???)...
My oppinion there are 2 options: ADO (comes with delphi), it links to A LOT of systems...
The other is the ZEOS components, 3th party which has some exotic (and larger) databases you can connect to...

But normally I would go for ADO... Easy and fast enough...
Reply With Quote
  #3  
Old 11-19-2010, 12:01 AM
dp_burtol dp_burtol is offline
Junior Member
 
Join Date: May 2010
Posts: 16
Default

I am using MySql. As of now i am using zeos and ADO component. The problem that I encountered is I cant get the Resultset of my stored procedure. How will I do that?
Reply With Quote
  #4  
Old 11-19-2010, 08:11 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

Instead of the table components use the query components...
Reply With Quote
  #5  
Old 11-20-2010, 05:21 AM
dp_burtol dp_burtol is offline
Junior Member
 
Join Date: May 2010
Posts: 16
Default

do you have a sample syntax on how to do that?

I dont know how to get the resultset of my stored procedure using query component...
Reply With Quote
  #6  
Old 11-22-2010, 11:54 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

Perhaps you could try something yourself???
If you look at the properties/methods you see that the TADOQuery also has an Open method... This will use the .SQL property as it's opening target... Databinding is the same as TADOTable, it has a datasource property...

So what's your specific problem???
Reply With Quote
  #7  
Old 12-15-2010, 07:16 AM
dp_burtol dp_burtol is offline
Junior Member
 
Join Date: May 2010
Posts: 16
Default

The problem is. I cant get the resultset of my stored procedure.

Like fore example:

In my stored procedure I have a query "select names from table1"

then the results are:
- Name1
- Name2
- Name3

This is what I want:

from delphi, I want to get the result or the data from my stored procedure which is (name1,name2,name3).

-----------------

what happening right now is. I can call to process the stored procedure but I cant get the result of my stored procedure.

delphi ------> stored procedure (X) ------- delphi

how will I do that?

I am using ZEOS.
Reply With Quote
  #8  
Old 12-15-2010, 07:54 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

Isn't it as straightforward as:
Code:
ADOQuery1.SQL.Text := 'call YourStoredProcedure();';
ADOQuery1.Prepare();
ADOQuery1.Open();
while not ADOQuery1.Eof do
begin
  ShowMessage(ADOQuery1.FieldByName('names').AsString);
  ADOQuery1.Next();
end;
But if you're only returning this resultset you're using the wrong type, this is a VIEW, not a stored procedure
Reply With Quote
  #9  
Old 12-16-2010, 05:06 AM
dp_burtol dp_burtol is offline
Junior Member
 
Join Date: May 2010
Posts: 16
Default

I see.. Is it okay if I use the ZEOS mysql component in returning a resultset?

thank you very much.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:06 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.