Results 1 to 5 of 5

Thread: Module

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2009
    Posts
    7

    Module

    This is my vb6 programme for creating recordset in a module. and call it in class
    and form
    module :ModMain
    Public Function getRec(strQry As String) As ADODB.Recordset
    Dim r As New ADODB.Recordset
    On Error Resume Next
    If r.State = adStateOpen Then r.Close
    r.CursorLocation = adUseClient
    r.Open strQry, Con, adOpenStatic, adLockReadOnly, adCmdText
    Set getRec = r
    End Function

    class:clsOrganization
    Public Function fillOrgName() As ADODB.Recordset
    strQry = "select NAME,CODE FROM ORGANIZATION ORDER BY NAME"
    Set fillOrgName = getRec(strQry)
    End Function


    is there any way to create dataset in a module and call it in a class????
    Last edited by si_the_geek; Aug 8th, 2009 at 06:38 AM. Reason: removed email address to prevent spam bots reading it - other members will contact you via the forums

  2. #2
    Addicted Member garyjohn_2000's Avatar
    Join Date
    Apr 2005
    Location
    Timbaland
    Posts
    243

    Re: Module

    This is the wrong place to post your question, mate. This section is for VB.NET code issues. Asking a question about VB6 code wont get much response.


    [Damn! I just realized its been years I've even seen VB6 IDE >.<]
    Last edited by garyjohn_2000; Aug 7th, 2009 at 07:06 PM.


    Anyone who has never made a mistake has never tried anything new. - Einstein
    Peace!

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Module

    Are you actually asking for help with VB6, or are you asking how to re-create the same thing in VB2005?

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2009
    Posts
    7

    Re: Module

    yes
    I want this for vb.net 2005

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Module

    Quote Originally Posted by aninda55 View Post
    yes
    I want this for vb.net 2005
    You should state that in the first post in future. Be clear. If we have to guess or assume then we may do so incorrectly.

    If you want a DataSet in a module then you simply declare a DataSet variable in a module. You can then get or set the value of that variable anywhere in your project. That goes for String, Integers, DataSets or anything else.

    If you're actually asking, without actually asking, how to get the data from the database, then I would suggest that you go to the Database Development forum and read the FAQ thread at the top. You can then follow the VB.NET links to some ADO.NET resources.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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