Passing a Dataenvironment.rsMyRecordset to a sub routine.

Visual Basic

    Next

  • 1. TreeList View
    Hi ! I need a TreeList view control. Is there any free control available? I've seen the Super Grid control in code project...but thats for VC++ MFC stuff......can i get something like that for my dear VB6.0 app? Sinex
  • 2. Speed up text addition to richtextbox?
    I remember seeing a procedure for this but I cant find it now, so maybe someone can help: I have a program which performs a lot of updates to a database. The operations it performs will be logged to a richtextbox. Currently I use "rt1.text = rt1.text & vbcrlf & newtext" which works, but as the box fills up it gets slower and slower as it is manipulating a larger and larger string each time. I think the solution I saw involved putting the cursor at the end and somehow appending the text, but I dunno how? Thanks, James.
  • 3. Message Box Question
    Rather than using MsgBox, you could add a new form to your project and display that: This will let you put some code behind the form and give you more control about when it ChrisM "Joe" < XXXX@XXXXX.COM > wrote in message news: XXXX@XXXXX.COM ... > For every retry, the program will call MsgBox("Retry " & ftpRetryCounter & " Time"). The problem is user needs to click OK button to continue, is it a way that user don't need to click ok button, but still continue? If the user doesn't click OK button, it will just stayed in the current Retry number, and don't go forward. I want to show the dialog "Retry 1 time", "Retry 2 time" , "Retry 3 time", etc... User can see the status, but no need to press ok button for the dialog to continue the process. > > Any ideas? Thanks!
  • 4. ListView ColumnHeader Right Click
    "Kevin Cornwell" < XXXX@XXXXX.COM > wrote in message news: XXXX@XXXXX.COM ... > How do I capture a "right click" (up or down) event on a column header in a > listview control for the purpose of adding a context menu like MS Explorer? > > Thanks all, > Kevin It seems the column headers are contained in a child window of the listview window. I think you'll have to subclass that window and react to the mouse messages. You can obtain the handle to the "columnheaders" window by calling GetWindow with the GW_CHILD relationship. '---------- Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _ ByVal wCmd As Long) As Long Private Const GW_CHILD = 5 Function GetColumnHeadersHWnd(ListViewHWnd As Long) As Long GetColumnHeadersHWnd = GetWindow(ListViewHWnd, GW_CHILD) End Function '---------- For further information about subclassing I suggest Google.

Passing a Dataenvironment.rsMyRecordset to a sub routine.

Postby Marty » Fri, 28 Jan 2005 06:10:12 GMT

Hi,

What is a type of a Dataenvironment.rsMyRecordset if I want to pass it 
to a sub routine?

'Can it be a recordset? I tried different type, but didn't got the right 
one...

private sub mySub(rsDEObj as ADODB.RecordSet)
'...
end sub

Thanks you

Marty

Re: Passing a Dataenvironment.rsMyRecordset to a sub routine.

Postby Jeff Johnson [MVP: VB] » Fri, 28 Jan 2005 07:27:25 GMT







Debug.Print TypeName(Dataenvironment.rsMyRecordset) 



Re: Passing a Dataenvironment.rsMyRecordset to a sub routine.

Postby Marty » Fri, 28 Jan 2005 23:55:55 GMT

Thank you Jeff,

Now I get this:

 > Debug.Print TypeName(Dataenvironment.rsMyRecordset)
That give me "Recordset"

'The sub that receive the Dataenvironment.rsMyRecordset.
Private Sub mySub(rsRecordset As Recordset)
'...
End Sub

in my code I call:
mySub(Dataenvironment.rsMyRecordset)

Then I get a "Type mismatch" error. Is it really a "Recordset" type?

Thanks you

Marty












Re: Passing a Dataenvironment.rsMyRecordset to a sub routine.

Postby Jeff Johnson [MVP: VB] » Sat, 29 Jan 2005 00:25:34 GMT







Lose the parentheses:

    mySub Dataenvironment.rsMyRecordset 



Re: Passing a Dataenvironment.rsMyRecordset to a sub routine.

Postby Marty » Sat, 29 Jan 2005 00:53:22 GMT

That works very well, thanks Jeff.

Marty










Re: Passing a Dataenvironment.rsMyRecordset to a sub routine.

Postby Ralph » Sat, 29 Jan 2005 00:55:47 GMT






You can also just pass the DataEnvironment.

Private Sub mySub( refDE As DataEnvironment )
     refDE.rsSomeDefinedCommandReturningARS
     ...
End Sub
....
    mySub DataEnvironment1

-ralph



Similar Threads:

1.Passing a Dataenvironment.rsMyRecordset to a sub routine.

Hi,

What is a type of a Dataenvironment.rsMyRecordset if I want to pass it 
to a sub routine?

'Can it be a recordset? I tried different type, but didn't got the right 
one...

private sub mySub(rsDEObj as ADODB.RecordSet)
'...
end sub

Thanks you

Marty

2.Passing parameter to DataEnvironment

Hi,

Is it possible to pass parameter to a dataenvironment?

I want it to execute a SQL query, but the query is builded using the SQL 
builder in the dataenvironment.  I want that rsMyRecordset being made on 
different table that I specify.

DataEnvironment1.rsMyRecordset.RecordCount

Something like a "SELECT * FROM " & strMyTable executed in the 
DataEnvironment1.rsMyRecordset

Can this be done?

Thanks you very much

Marty



Return to Visual Basic

 

Who is online

Users browsing this forum: No registered users and 86 guest