why can't i get the data
From: Foxe (feng_xia_at_sina.com)
Date: 07/14/04
- Next message: Andy: "Re: why can't i get the data"
- Previous message: Rohit Dhamija: "Re: BDE vs ADO"
- Next in thread: Andy: "Re: why can't i get the data"
- Reply: Andy: "Re: why can't i get the data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 14 Jul 2004 14:27:26 +0800
I use the tadostoredproc to exec. sql server's Procedure!
Q:
SQL :
===========================================
CREATE PROCEDURE dbo.my_quserproject
@qUsername Char(15)
AS
IF @qUsername IS NULL
BEGIN
RAISERROR('Username is empty!',14,1)
RETURN
END
SELECT a.proj_name FROM tb_proj a, (SELECT c.proj_id FROM tb_userproj c JOIN
tb_user d ON c.[user_id] = d.[user_id] WHERE d.[user_name] = @qUsername) b
WHERE a.proj_id = b.proj_id
GO
=========================================================
Delphi(server):
=========================================================
procedure Tworkser.Quserproj(const UName: WideString);
begin
adosp_1.Close;
adosp_1.ProcedureName := 'my_quserproject';
adosp_1.Parameters.AddParameter.Name := '@qUsername';
adosp_1.Parameters.ParamValues['@qUsername'] := UName;
adosp_1.Prepared;
adosp_1.Open;
end;
=========================================================
Client
=========================================================
with DM1 do
begin
Cds_1.Close;
DcomC_1.AppServer.Quserproj(str_login_name);
Cds_1.Open;
dbgrid1.DataSource := ds_1;
=========================================================
dbgrid1's display is Null,sql server can return the result:
==========================================================
proj_name
---------------
HW
Srvate
DDesign
Metek
============================================================
what is wrong with my codes?
- Next message: Andy: "Re: why can't i get the data"
- Previous message: Rohit Dhamija: "Re: BDE vs ADO"
- Next in thread: Andy: "Re: why can't i get the data"
- Reply: Andy: "Re: why can't i get the data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|