|
-
Aug 7th, 2009, 03:18 PM
#1
Thread Starter
New Member
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
-
Aug 7th, 2009, 07:00 PM
#2
Addicted Member
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! 
-
Aug 8th, 2009, 06:43 AM
#3
Re: Module
Are you actually asking for help with VB6, or are you asking how to re-create the same thing in VB2005?
-
Aug 8th, 2009, 06:48 AM
#4
Thread Starter
New Member
Re: Module
yes
I want this for vb.net 2005
-
Aug 8th, 2009, 07:28 AM
#5
Re: Module
 Originally Posted by aninda55
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|