why can't i get the data

From: Foxe (feng_xia_at_sina.com)
Date: 07/14/04


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?



Relevant Pages

  • Re: Full text catalog just not populating
    ... exec sp_defaultdb N'NT Authority\System', N'master' ... means either the network guys in my company who don't know SQL but are admins ... > needs this login to log into SQL Server and you can either add back this ... >> fetching U ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Indexing delay for one row.
    ... script and WAITFOR and varying the delay from 1 to 18 seconds. ... could you confirm your exact version of SQL Server that you are seeing ... It is possible that a change was made to the pooling frequence under SP3 to ... exec sp_fulltext_table 'FTSTable','create','FTSCatalog','FTSTable_IDX' ...
    (microsoft.public.sqlserver.fulltext)
  • Re: storing and searching office docs in SQL
    ... You CAN both store and search the contents of the MS Word ... files stored in an SQL Table's FT-enable IMAGE column, ... FTS CONTAINS or FREETEXT to search the contents of that MS word document: ... exec sp_fulltext_database 'enable' -- only do this once! ...
    (microsoft.public.sqlserver.programming)
  • Re: SqlDataAdapter1.SelectCommand.CommandType= CommandType.StoredProcedure
    ... > kann man beim EXEC PROC keine Parameter beifügen. ... CommandType.StoredProcedure wird intern als RPC Command abgesetzt, ... SQL RPC siehe SQL Server Dokumentation, ... nach der Ausführung ungültig werden. ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • pls help for the script!
    ... my script do not run with the parameter " ... exec sp_executesql @sql ... --Dummy-Tabelle Spaltenname erstellen ...
    (microsoft.public.de.vb.datenbank)