Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    9

    Exclamation Unanswered: help in visual basic

    This statement doesnt give back any result in Visual Basic on SQL
    QUERY ANALYZER it returns "select * from @tab" how to make this a stored procedure


    declare @tab table (idur int, data_val smalldatetime, [description] char(200), debi numeric(16,2), kredi numeric(8,2), cum numeric(8,2))
    insert into @tab select idur,data_val,description,debi,kredi,0 as cum from transaksionet where partia = '0001' order by data_val,idur,brloc
    declare @cum numeric(16,2)
    set @cum = 0
    update @tab
    set @cum = cum = @cum + kredi - debi
    select * from @tab

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: help in visual basic

    1.Include the SQL statements in a SP
    2.In VB declare two vars as ADODB.command and ADODB.Recordset
    like:
    Dim cmd as New ADODB.Command
    Dim rcs as New ADODB.Recordset

    Set cmd.ActiveConnection = cn 'where cn is an ADODB.connection object
    cmd.CommandType = adCmdStoredProc
    cmd.CommandText = "your_SP_name"

    3.Populate the recordset with the values returned by cmd:

    Set rcs = cmd.Execute


    Originally posted by bashka_abdyli
    This statement doesnt give back any result in Visual Basic on SQL
    QUERY ANALYZER it returns "select * from @tab" how to make this a stored procedure


    declare @tab table (idur int, data_val smalldatetime, [description] char(200), debi numeric(16,2), kredi numeric(8,2), cum numeric(8,2))
    insert into @tab select idur,data_val,description,debi,kredi,0 as cum from transaksionet where partia = '0001' order by data_val,idur,brloc
    declare @cum numeric(16,2)
    set @cum = 0
    update @tab
    set @cum = cum = @cum + kredi - debi
    select * from @tab
    Steve

Posting Permissions

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