CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2010
    Posts
    17

    Help me in coding....

    Hi..

    Am using vb6.0, crystal report 8.5 and sql 2000 server in my project.. I want to create one combo box in report form in which i ve to display some person names from database..

    I did it for date, when we select any date, report displays corresponding information. I had used stored procedure for dis.. Bellow code shows this stored procedure to display info based on date.. But am not getting coding for combo box..

    Plz help me in coding..

    Code:

    Code:
    CREATE PROCEDURE usp_CONTRIBUTION(@StDt Char(10),@EnDt Char(10)) AS      
    BEGIN      
          
     Declare  @numrows int,@errno int,@errmsg varchar(255),@error int,      
              @sDt Datetime,@eDt DateTime      
           
      SET NOCOUNT ON        
      SET DATEFORMAT MDy        
      set @sDt=@StDt      
      set @eDt=@EnDt      
          
     /* finding landed cost of each tool from bincards*/      
     SELECT BcTpSlNo,AVG(BcBprice) AS LC,TpSku AS ToolId      
     Into #LC1   
     FROM Bincards,ToProdut   
     WHERE BcTpSlNo=TpSlNo      
     GROUP BY BcTpSlNo,TpSKU     
     ORDER BY BcTpSlNo      
        
     /* finding landed cost of invoiced tools*/      
     SELECT ItIhSlno,ItQty,LC,(LC * ItQty) AS  TLC  INTO #LC2      
     FROM   InvoicTo,#LC1  
     WHERE  BcTpSlNo=ItTpSlNo     
    
     SELECT ItIhSlNo,SUM(ItQty) as Qty,SUM(LC) as LC,SUM(TLC) as TLC INTO #LC3 FROM #LC2
     GROUP BY ItIhSLNo ORDER By ItIhSlNo
    
     SELECT  Qty,LC,IhSKU,IhSubtotal as Discounts,IhItemTotal as ItemTotal,
             TLC,(IhItemTotal-IhSubTotal) as AmtAftDis,    
            AdOrganization,AdCity,AdState,Adzone,RtSKU        
     FROM  InvoicHe,#LC3,AddresMt,RatingMt      
     WHERE ItIhSlno=IhSlno       
     AND   IhAdSlno=AdSlno      
     AND   AdRtSlno=RtSlNo      
     AND   Ihdate BETWEEN @SDt AND @EDt
     ORDER BY Ihsku      
        
    END
    GO
    Last edited by HanneSThEGreaT; July 15th, 2010 at 02:51 AM. Reason: Added [CODE] Tags!

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Help me in coding....

    The report does nothing but pick two dates, and call the SP.

    It does it's thing, then spits out the date range to the report.

    You don't have any NAME field in your data, so, your report can't show it
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    May 2010
    Posts
    17

    Re: Help me in coding....

    Hi dglienna..

    Yes don ve any data in this SP, but i want same SP which ve to work for combo box.. I need to some names from db table n display it in combo box.. When we select one name, the report to be display information of that selected person..

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Help me in coding....

    arunvb, please make use of [CODE] tags when posting code, it makes it easier for us to read your code.

    Thank you,

    Hannes

  5. #5
    Join Date
    May 2010
    Posts
    17

    Re: Help me in coding....

    Hi Hannes ..

    I did it.. Please see in #1 of this thread...

  6. #6
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Wink Re: Help me in coding....

    Quote Originally Posted by arunvb View Post
    I did it.. Please see in #1 of this thread...
    Nope. you haven't. if you read the bottom part of your post very carefully, you will see that I have added the [CODE] tags.

    Let us leave it at that now. Thank you.

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Help me in coding....

    Not to mention the fact that T-SQL and Stored Procdeure has very little to do with VB6. You could write a simple query
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured