VB 6.0 - how to call a stored procedure in SQL Server?

Asked By Ralph Acido on 27-Mar-06 08:48 PM
i have a program that will retrieve records from SQL server.. how i call these one using VB and by passing a parameter in the Procedure?

Here - Asked By Robbe Morris on 27-Mar-06 09:13 PM


link - Asked By Kevin Scott on 27-Mar-06 09:32 PM

Scroll to the code at the bottom of this page:


try this - Asked By Amit Khurana on 28-Mar-06 03:16 AM

' Cmddata Is Command Object
'GoConn is ur connection string
 ' GuiGetHospitalname Stored Procedure name  
' "@retStatus" return value
' and u can pass parameters too to sp  
With cmddata
        .ActiveConnection = goConn
        .CommandText = "GuiGetHospitalname"
        .CommandType = adCmdStoredProc
        .CommandTimeout = 0
        .Parameters.Append .CreateParameter("@retStatus", adInteger, adParamReturnValue)
        Set rs = .Execute
        If .Parameters("@retStatus").value <> 0 Then
            MsgBox "Error in getting list of Hospital list"
            Me.MousePointer = vbDefault
            Set cmddata = Nothing
            Exit Sub
        End If
hi -check this - Asked By Rupali Randhave Kolhe on 28-Mar-06 04:26 AM


How to call store procceudre in VB 6 - Gopi nathan replied to Ralph Acido on 16-May-08 05:41 AM

How to call store procceudre in VB 6.

I need how to call the Sql Store procceure in VB 6.0 with Example.

How should I create a generic stored procedure - Muhammad Ghous Mughal replied to Ralph Acido on 01-Jul-09 01:08 AM
How should I create a generic stored procedure in SQL2000 that is created once but saves data from every form in a vb6.0 project