?
Solved

Question on MSHFlexgrid in VB

Posted on 2002-04-05
12
Medium Priority
?
298 Views
Last Modified: 2012-08-14
Hi All,

I am using MSHFlexgrid in my form.And i am showing data in the MSHFlexgrid.Its working find in my computer.I packaged my application, and i installed in my user m/c.When i test in user m/c its saying unexpected error 3704 ( operation is not allowed when the object is clossed.) I checked the MSHFlexgrid ActiveX control existed in user m/c.I tried back and forth in different ways to fix this problem. I didn't get the solution.

could you tell me what may be the problem.

Note: I am using the following procedure to load data into MSHFlexGrid control

Public Sub SetShowkeyRNo(oMSHFlexKey As MSHFlexGrid, sBill_Code As String, sSysDate As String, iRNo As Integer)
Rem This procedure is used for Depending on the Record number that was selected from the user.

Dim sSQL As String
Dim rstShwRNo As New ADODB.Recordset
Dim lcsrPrev As Long

On Error GoTo Err_SetShowKeyRNo

sSQL = ""
sSQL = "SELECT Distinct(Rec_No),Ind_Sys_Date,Fund_cont_val,Net_unbill,WIP_date,Cont_date_bill_amt,Last_inv_date," _
        & "Draft_inv_Amt,Cont_Type,Enga_start_date,Enga_end_date,Audit_comm" _
        & " FROM KeySumm WHERE Bill_Code = '" & sBill_Code & "' AND (Ind_Sys_Date <= #" & sSysDate & "#) AND (Rec_No <= " & iRNo & ") ORDER BY Rec_No DESC"
       
        If GetRcdSet(sSQL, cnnCAD, rstShwRNo) Then

    If rstShwRNo.State <> adStateClosed Then
        'Turn off redrawing to avoid flickering
        oMSHFlexKey.Redraw = False
        oMSHFlexKey.Clear
       
        If rstShwRNo.RecordCount > 0 Then
         
          Set oMSHFlexKey.Recordset = rstShwRNo
         
          oMSHFlexKey.ColWidth(0) = "600"
          oMSHFlexKey.ColWidth(1) = "1000"
          oMSHFlexKey.ColWidth(11) = "4000"
          oMSHFlexKey.RowHeight(oMSHFlexKey.Row) = 250
          'oMSHFlexKey.AllowUserResizing = True
          oMSHFlexKey.Redraw = True
          oMSHFlexKey.FocusRect = flexFocusLight
        Else
          'oMSHFlexKey.Redraw = True
          'oMSHFlexKey.ColWidth(5) = "3000"
          'oMSHFlexKey.RowHeight(1) = "500"
         
          oMSHFlexKey.Text = "No histary records found!"
         
        End If
       
    End If
   
End If
Rem close the record set
rstShwRNo.Close

Rem Exit from the procedure
Exit Sub
Err_SetShowKeyRNo:
      Select Case Err
    Case 0
      ReplaceCursor lcsrPrev
      Exit Sub
    Case Else
      AssertError modName & ".SetShowKeyRNo"
  End Select
  Resume Err_SetShowKeyRNo
  Resume

End Sub
0
Comment
Question by:pnc
[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
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 20

Expert Comment

by:hes
ID: 6921760
Where is your rstShwRNo.Open

(3704 This error occurs when the recordset has not been opened yet.)
0
 

Author Comment

by:pnc
ID: 6921762
And also when i ever i run the application, some times in the MSHFlexGrid control area is pasting with previous window.How i can get only Flexgrid data.

pnc
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6921765
i think you have some problems with ado.
did you load correct mdac on user's machine?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 5

Expert Comment

by:rkot2000
ID: 6921772
to hes
it's in GetRcdSet(sSQL, cnnCAD, rstShwRNo)


0
 
LVL 1

Accepted Solution

by:
soferstam earned 800 total points
ID: 6922111
Well,looks to mee the error inside GetRcdSet()
Please put break there and check a)is connection open properly? a)Can you open a recordset?
Regarding the second question,-do you mean how to clean-up the grid?-Use clear method.But then you have to rebuild the flex dinamically.
0
 

Author Comment

by:pnc
ID: 6929399
Hi All,

I observed i am getting error inside GetRcdSet().
Function GetRcdSet(aSQL As String, cnnDB As ADODB.Connection, rstRecordSet As ADODB.Recordset) As Boolean
On Error GoTo ErrHandler
    GetRcdSet = True
   
    rstRecordSet.Open aSQL, cnnDB, adOpenKeyset
   
    Exit Function

ErrHandler:
GetRcdSet = False

End Function
Its working in my development computer.But not in user m/c.Which one i installed data Access components.Like mdac_typ 2.5.1 or mdac_typ 2.5.2

But i already installed mdac_typ 2.5 service pack 2.But still i am getting same error.Do you know which one i install again.

pnc
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6929412
can you create a udl file on user's pc and test your connection to the database?
0
 
LVL 1

Expert Comment

by:soferstam
ID: 6929422
You connection as closed.
Can you chech your connection state inside this prosidure?
0
 

Author Comment

by:pnc
ID: 6934161
Hi All,

Do you know how i can Uninstall MDAC_TYP package in user computer.

PNC
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6934283
you can't Uninstall mdac.
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6934297
0
 

Author Comment

by:pnc
ID: 6937911
Thanks Soferstam,

Your answer is right in my case. Once again thanks for your help.

pnc
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

764 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