Help - SQL 7.0 , ADO 2.5 , Store Procedure , VB6 and MSDataGrid 
Author Message
 Help - SQL 7.0 , ADO 2.5 , Store Procedure , VB6 and MSDataGrid

Hi

I have a store procedure in SQL 70 who name  is pf_frota
Then I write a program that run then sp

the function :

Public Function GetEspecial(Optional Pesca As String) As Object
Dim cmd As New adodb.Command
Dim rs As New Recordset
rs.CursorLocation = adUseClient
Set cmd.ActiveConnection = CnCha
cmd.CommandText = "pf_frota"
cmd.CommandType = adCmdStoredProc
Set rs = cmd.Execute
Set GetEspecial = rs
End Function

the connection CnCha is OK

 CnCha.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=MVP;Data Source=NORTEPDC"
....
the program

    Set rs = GetEspecial()
    If Not rs.EOF Then
        Set Adodc1.Recordset = rs
        Adodc1.Refresh
    Else
        MsgBox ("No Records Found !....")
        DataGrid1.Enabled = False
    End If
.....

And My PROBLEM

My problem is I cant display any data in the datagrid . If I use
MSFlexGrid everything is OK.

If I use a normal sql like this  

Public Function GetEspecial(Optional Pesca As String) As Object
Dim sCmd As String
Dim rs As Recordset
sCmd = " Select * from Frota "
Set rs = New Recordset
rs.CursorLocation = adUseClient
rs.Open sCmd, CnCha, adOpenForwardOnly, adLockReadOnly, adCmdText
Set GetEspecial = rs
End Function

is Ok too.

The MSDataGrid dont work with store procedures or I make some thing
wrong.

Thanks for any Help.



Tue, 18 Feb 2003 23:09:41 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Obtaining the count of records using ADO 2.5 and a stored procedure

2. Stored Procedure called by VB with ADO 2.5

3. Using ADO 2.5 Streams on SQL Server 7.0

4. ADO 2.5 / Win2K / VB IDE / SQL Server 7.0

5. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL

6. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL Syntax

7. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL Syntax

8. Seeking advice on VB6->ADO->SQL Stored Procedure Error Handling

9. Seeking advice on VB6->ADO->SQL Stored Procedure Error Handling

10. problem passing data from ASP to a Stored procedure in SQL 7.0

11. SQL 7.0 Stored Procedures and Visual Database Tools 1.0

12. SQL 7.0 Stored Procedures and Visual Database Tools 1.0

 

 
Powered by phpBB® Forum Software