[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB6:  connecting the dots from code to the Data Environment object to a stored proc?

Posted on 2003-11-10
3
Medium Priority
?
313 Views
Last Modified: 2013-12-25
So I've got a stored proc in my SQL Server2K db, and the stored proc is called fred.  
It's expecting an int from the code, and it will return a bunch of records.

I want to put this stored proc into my global Data Environment object (cleverly named "de1"), and then, from the code, call the Data Environment/stored proc (passing an integer), and get the results in a local recordset in my code.

Can someone show me a simple code example (with explanation, preferably) that illustrates these things?

Thanks!
0
Comment
Question by:edmund_mitchell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Author Comment

by:edmund_mitchell
ID: 9716781
Leon --

No choice on the DE, unfortunately -- at least for now.   I looked at that URL, and I didn't see anything that related to my question.  A mistake?
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 1000 total points
ID: 9716937
Sorry that was a wrong link.  I think you are looking for something like this:

Sub GetRecords()
Dim strSQL as String
    strSQL = "Exec fred " & Text1.Text
    With de1.rsCmd1
        If  .State=adStateOpen  Then .Close
        .Source = strSQL
        .Open
    End With
   
    If de1.rsCmd1.EOF and de1.rsCmd1.BOF Then
       MsgBox "There are records"
    Else
       MsgBox "There are " & de1.Recordset.RecordCount & " records in the recordset"
    End If
End Sub
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question