PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
**RESOLVED** Deleting a Program???-VBForums
Results 1 to 17 of 17

Thread: **RESOLVED** Deleting a Program???

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679

    **RESOLVED** Deleting a Program???

    I am hoping that someone has run up against this problem...I launched my program on my NT Workstation...and It works fine, but I needed to make updates to the program...so I re-launched the program setup...and in the past it would overwrite the exsisting program...but now I am getting an error saying that it is unable to write over the program, because their is a sharing violation.

    I checked and double checked to see if the 3 other people who have access to the program were on it and they were not...so I kep trying but came to this conclusion...the program is set up to connect to 2 databases for data...these databases are shared by other users...

    So my question is: Do I have to make sure that those databases are not in use before I can make the change? And if so why..I mean if the program is not open why would it be concerned with the databases? If this is not the problem, does anyone know why, and also how can I either delete the program or overwrite it?

    I attempted to uninstall but it would not remove the program stating that I had to do it manually...

    Please HELP!!!
    Last edited by Salvatore; Mar 17th, 2004 at 01:26 PM.

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    I don't know that it is necessarily your problem, but the fact that you say other people have access to the DB's lead me to believe it might be --- what happens in some conditions is that the newwork manager that gets your app connected to the db (which I assume to be on a shared drive) somehow fails to note when you disconnect, SO ... Windows thinks you are still connected even though you aren't. You'll need to have your network administrator look to see if this is happening and if it is HE needs to do something to make the network more properly responsive. I've had this problem a couple of times at different client locations.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    I guess I am a bit confused...

    So I have to get the the Network Administrator involved?

    This may be a problem, since I work for a huge Bank, and I built this application so that it will assist a specific department...

    There is no way around this?...I mean if I were to get all users to dissconnect from the supporting databases, would that free up the program?...

    I hope that there are some alternatives...please...

  4. #4
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611
    Unplug the networkcable, restart the pc,, re-run the setup
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  5. #5

  6. #6
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    Yep, I'll also wager that your application is not being shutdown when you exit it.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    I think that you all are right!!!

    Below is the code that is found in my Login form..which opens a connection to (2) Access Databases:
    VB Code:
    1. OpenDBConn  ' open Sales2 database connection
    2.             ' OpenDBConn function is located in the DatabaseRtns module
    3.            
    4. OpenDepConn  ' open deposit2003 database connection
    5.             ' OpenDepConn function is located in the DatabaseRtns module
    6.            
    7. sSql = "SELECT * FROM tblLogin WHERE ID ='" & txtLogin.Text & "'"
    8. Set rst = New ADODB.Recordset
    9.  
    10. rst.Open sSql, CN, adOpenDynamic, adLockOptimistic
    11. 'etc and etc...
    Now here is what I have on all my forms when it is unloaded:
    VB Code:
    1. Private Sub Form_Unload(Cancel As Integer)
    2.     'This calls the module basModule where the code is for giving the Implode effect to
    3.     ' the form
    4. 'Close the recordset if the recordset is still open from the menuPrint routine
    5.    
    6.     If rs.State = adStateOpen Then
    7.         rs.Close
    8.         ImplodeForm Me.hWnd
    9.     Else
    10.         ImplodeForm Me.hWnd
    11.     End If
    12. End Sub
    I do have a sub routine for closing the (2)database connections:
    VB Code:
    1. Public Sub CloseDBConn()
    2.    'This is the routine for closing all open database connections
    3.    
    4.     If Not CN Is Nothing Then
    5.    
    6.         If CN.State <> adStateClosed Then
    7.             CN.Close
    8.         End If
    9.        
    10.         Set CN = Nothing
    11.        
    12.     End If
    13. End Sub
    14.  
    15. Public Sub CloseDepConn()
    16.    'This is the routine for closing all open database connections
    17.    
    18.     If Not DepCN Is Nothing Then
    19.    
    20.         If DepCN.State <> adStateClosed Then
    21.             DepCN.Close
    22.         End If
    23.        
    24.         Set DepCN = Nothing
    25.        
    26.     End If
    27. End Sub
    So I think that I should put the Close routine into the Unload events of all forms...right?
    Also, because this application is connecting to SHARED databases, is there something I should do to limit the problems that might occur with multiple querying?

    Thankx!!!!!!!!!!

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    Just as a side note...I did contact our LAN Administrator, and they stated that the 2 databases in question were still hanging out there as open connections, even though NO ONE is on the program....

    I appreciate ALL your feedback and suggestions!!

  9. #9

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    Thanks for your reply MartinLiss...

    The 2 Sub routines for closing the databases are housed in a module..The ImplodeForm is also within a module...

    I was thinking of calling those routines within the Unload event like this:
    VB Code:
    1. 'Close the Database connection to both the Sales2 and deposit2003 databases
    2.    
    3. CloseDBConn
    4. CloseDepConn
    5.    
    6. 'This calls the module basModule where the code is for giving the Implode effect to
    7. ' the form
    8.  
    9. ImplodeForm Me.hWnd
    Now my other issue is that I open and close recordsets like there was no tomorrow within this application...for example look at the code below..tell me if this looks ok:
    VB Code:
    1. ' Fill Group Total Units caption with productivity data
    2.     Dim GrpTotUnits As Integer
    3.     Dim GrpDepositTotUnits As Integer
    4.    
    5. 'below opens a recordset within the Sales database
    6.  
    7.     sSql = "SELECT * FROM Sales WHERE [Group] = '" & moduserdata.Group & "'AND EffectiveDate = #" & moduserdata.DatePick & "#"
    8.     Set rs = New ADODB.Recordset
    9.     rs.CursorLocation = adUseClient
    10.     rs.Open sSql, CN, adOpenDynamic, adLockOptimistic
    11.    
    12.     If rs.EOF Then
    13.         'do nothing
    14.     Else
    15.         rs.MoveFirst
    16.     End If
    17.    
    18.     Do Until rs.EOF
    19.         GrpTotUnits = GrpTotUnits + rs.Fields("Units").Value
    20.         rs.MoveNext
    21.     Loop
    22.    
    23. ' here we close the recordset by calling the routine from a module
    24.  
    25.     CloseRS rs
    26.    
    27. 'this opens a recordset within the Deposit database
    28.  
    29.     sSql = "SELECT * FROM Main WHERE [Group] = '" & moduserdata.Group & "' AND [Date Generated] = #" & moduserdata.DatePick & "#"
    30.     Set depositrs = New ADODB.Recordset
    31.     depositrs.CursorLocation = adUseClient
    32.     depositrs.Open sSql, DepCN, adOpenDynamic, adLockOptimistic
    33.    
    34.     If depositrs.EOF Then
    35.         'do nothing
    36.     Else
    37.         depositrs.MoveFirst
    38.     End If
    39.    
    40.     Do Until depositrs.EOF
    41.         GrpDepositTotUnits = depositrs.RecordCount
    42.         depositrs.MoveNext
    43.     Loop
    44.    
    45.     lblGrpTotUnits.Caption = GrpTotUnits + GrpDepositTotUnits
    46.    
    47. 'this calls the routine from the module to close the recordset
    48.  
    49.     CloseRS depositrs

  11. #11
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,081
    I'll let someone else help you with the opening and closing issue, but let's get back to your original problem. You say "I was thinking of calling those routines within the Unload event like this...". Does that mean that you aren't calling them now? Also, you didn't anser my question about your form(s). Do you have more than one?

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    I apologize...I have several forms within this project...

    Also prior to this thread my unloiad events for each form only closed any open recordsets but not any open connections...it also called the ImplodeFrm routine...below is that routine:
    VB Code:
    1. Public Sub ImplodeFormToMouse(hWnd As Long, Optional Reverse As Boolean = False, Optional IsFormCentered As Boolean = False)
    2.     On Error Resume Next
    3.     Dim f As RECT, I As RECT, p As POINTAPI
    4.     GetWindowRect hWnd, f
    5.     If IsFormCentered = True Then CenterRect f
    6.     GetCursorPos p
    7.     I.Left = p.x
    8.     I.Right = p.x
    9.     I.Top = p.y
    10.     I.Bottom = p.y
    11.     If Not Reverse Then
    12.         DrawAnimatedRects hWnd, IDANI_CAPTION, f, I
    13.     Else
    14.         DrawAnimatedRects hWnd, IDANI_CAPTION, I, f
    15.     End If
    16. End Sub
    So in your experience, will this do the job?

  13. #13
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,081
    That doesn't close the form. Since you have more than one form and I assume you allow the user to "end" you app via any of the forms' control box, you really should implement the following code
    in every form's Unload event. It can easily be made into a sub.

    VB Code:
    1. Dim frm As Form
    2.  
    3. For Each frm In Forms
    4.     Unload frm
    5.     Set frm = Nothing
    6. Next

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    I have no problem with implementing your suggestion...but I want to make sure that it will also close the connections I have to the Databases...

    As I stated earlier..within the Login form I open (2) databases by calling a global routine in a module....the connections are open throughout the app...so I figured that I would also need to close them within the Unload events of the forms...

    What do you think about this for the Unload events:
    VB Code:
    1. Dim frm As Form
    2.  
    3. 'Close the Database connection to both the Sales2 and deposit2003 databases
    4.    
    5. CloseDBConn
    6. CloseDepConn
    7.    
    8. 'This calls the module basModule where the code is for giving the Implode effect to
    9. ' the form
    10.  
    11. ImplodeForm Me.hWnd  'this give the imploding effext to the forms
    12.  
    13. For Each frm In Forms
    14.     Unload frm
    15.     Set frm = Nothing

  15. #15

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Location
    New York
    Posts
    679
    Thank you very much for assistance in making this program better!!!

    You all are the best!

  17. #17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width