Page 1 of 2 12 LastLast
Results 1 to 40 of 55

Thread: Help with Modal and no modal forms

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Question Help with Modal and no modal forms

    Hi, i'm having troubles when trying to show progress in a long operation, the problem is that i don't know how long is it going to take, because mi form calls a procedure in oracle and then returns with some information, can someone tell me any ideas on how to show progress without knowing how long is it going to be. I try to show a window saying "Processing..." but since my application is based on modal forms, i can't show it as no modal. Any ideas please????

    hope u understand my very basic english

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Maybe add a statusbar with "Processing" in it?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    mmm but there are no status before nor after that, it's a form that the user fill with some register information, and since the database server is slow and far, i need to show something that indicates that the application is still alive during the oracle procedure and then returns like nothing happened with a confirmation value and other steps follow.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    The status bar is a control that go across the bottom of a form for displaying "status" type information. Just add it to your form from the common controls.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Is there looping involved in this long process?

    If so, then that is where you would increment your progressbar.

    If not, then showing a static message like "Processing..." is about your only option.

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Its executing a stored procedure so its very difficult to retrieve any progress info.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by RobDog888
    Its executing a stored procedure so its very difficult to retrieve any progress info.
    That is very true, but a "procedure in oracle" does not necessarily equal a stored procedure in oracle.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Well yes, that could be subjective to how the thread poster means it. But still there isnt too many options on retrieving progres info no matter if its a sp, adhoc, function, etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    yes, it's a stored procedure in oracle, and there's no looping, it's only one procedure, that takes at least 10 minutes to return with a answer, and during that the application doesn't do anything and sometimes looks like dead, that's why i need to show that it's still working, is there any way to show some movement, not necesarilly a especific progress, but maybe something like "Processing." and then "Processing.." and then "Processing..." and then again "Processing." until oracle finish?

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    You can use a timer event to do the updating of "Processing." "Processing.." "Processing..." for a label caption or in some other control. Do use a DoEvents where your executing the sp.

    Or maybe play an AVI file.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by kathyms
    is there any way to show some movement, not necesarilly a especific progress, but maybe something like "Processing." and then "Processing.." and then "Processing..." and then again "Processing." until oracle finish?
    No...this would require sometype of looping so, if you could do that then you could update the progress with a progressbar. Your application will appear to be down and out. I would suggest using a statuspanel as Rob suggested, and along with "Processing", I would put something like..."Processing...this could take as much as 10 minutes, so please be patient."

    At the end, make sure you pop up a message box indicating it has completely so there will be no mistake with the user that it is actually done.

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    With SQL Server you can get some returns like records affected and such but I am not familiar with Oracle. You might want to search or check thier help file for any return parameters or switches.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    where do i use the DoEvents? beacuse i put it in the timer event, but i doesn't do anything when the procedure is running, and moves again when the procedure stops

  14. #14
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by kathyms
    where do i use the DoEvents? beacuse i put it in the timer event, but i doesn't do anything when the procedure is running, and moves again when the procedure stops
    Doevents is commonly used in loops, which you don't have here. Your procedure is taking up all of the processing time in your application because there is nowhere from within it to pause it long enough for your application to do something else, like update a progress bar.

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Or if you have timer event procedure processing at the same time your running a call to a db.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    can i have a timer running at the same time that the stored procedure is running?

  17. #17
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by RobDog888
    Or if you have timer event procedure processing at the same time your running a call to a db.
    Hmmm...now thats an interesting thought and something I've not tried.

    Will a timer continue to fire while executing a query or stored procedure?

  18. #18
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    AFAIK, the Timer control executes on a secondary process and not a secondary thread so it should work. I have seen the Timer event still fire even when a Modal MsgBox is being displayed.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  19. #19

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    i've tried and it but it hasn't worked for me, but maybe i'm not doing or wirting everything i'm supposed to..... when the procedure is running, everything else stops, is there a way that it doesn't stop??

  20. #20

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    Quote Originally Posted by RobDog888
    AFAIK, the Timer control executes on a secondary process and not a secondary thread so it should work. I have seen the Timer event still fire even when a Modal MsgBox is being displayed.
    u lost me

  21. #21
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by kathyms
    u lost me
    He is talking about how things work within the Windows Operating System environment.

    You said you tried it. Meaning you tried using a timer? What exactly did you do?

  22. #22

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    Lima, Peru
    Posts
    28

    Re: Help with Modal and no modal forms

    yes, i tried using a timer and the doevents for the label's caption every 100 miliseconds, but when i call the procedure, doesn't move anymore until the procedure is over.

  23. #23
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Ok, then its a synchronous call and unless you created an Out of Process ActiveX EXE to work in conjunction with your app, it wont be possible to do what you want.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  24. #24
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by kathyms
    yes, i tried using a timer and the doevents for the label's caption every 100 miliseconds, but when i call the procedure, doesn't move anymore until the procedure is over.
    Well, it was kind of a shot in the dark.

  25. #25
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    It does work with other logic like the Modal MsgBox scenerio I posted earlier but I guess the ADO call doesnt work the same way. Good thing I posted AFAIK.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  26. #26
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by RobDog888
    It does work with other logic like the Modal MsgBox scenerio I posted earlier but I guess the ADO call doesnt work the same way. Good thing I posted AFAIK.
    It would have been way cool if it did work, but then again Rob, you got to think that if it did work, someone would have posted an example of it by now (I would think anyway)

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    True in a sense that most members are spammers like us. Maybe there is some member that knows but isnt online or seen this thread yet or maybe a detailed search on MS and here would turn something up.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  28. #28
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by RobDog888
    True in a sense that most members are spammers like us. Maybe there is some member that knows but isnt online or seen this thread yet or maybe a detailed search on MS and here would turn something up.
    You and I both have been around this forum for a while and we both have seen questions on this issue. For that matter, in our professional lives we have both faced this issue. I've done some pretty intense Googling, and I've not found anything.

    Personally, I have always gone with your suggestion on the status panel, and a nebulus message indicating that the process could take a while.

  29. #29
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    The only person I can think of that would know, but for SQL Server and not Oracle, would be either szlamany or brucevde.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  30. #30
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help with Modal and no modal forms

    Quote Originally Posted by RobDog888
    The only person I can think of that would know, but for SQL Server and not Oracle, would be either szlamany or brucevde.
    We well see. I just sent a PM to both of them and GaryMazzone (he is a darn good Oracle dude) and asked them to take a look at this thread.

  31. #31
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Cool, I'll keep an eye out for any replies so I will know any possible solutions for next time.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  32. #32
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Help with Modal and no modal forms

    Starting with ADO 2.0 "asyncronous" calls are possible.

    I've never done one myself.

    Apparently they are only part of the CONNECTION and RECORDSET objects - so if you are using a COMMAND object, this might not be possible. Although you can execute a COMMAND from the CONNECTION object - not sure if that's the same.

    And I'm not even sure if the ORACLE driver supports ASYNC ADO calls.

    How are you calling the SPROC from VB?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  33. #33
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Thanks Steve for pointing out the obvious (Bangs head on desk).

    From the help file...

    VB Code:
    1. Dim conn As New ADODB.Connection
    2.            
    3. Conn.ConnectionString = _
    4. "Provider=SQLOLEDB;Data Source=sql65server;" _
    5.    & "User ID=sa;Password='';Initial Catalog=pubs"
    6. conn.Open , , , adAsyncConnect
    7.  
    8. 'Modified...
    9. If conn.State = adStateExecuting Then 'Or adStateFetching
    10.    Debug.Print "Still Executing"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  34. #34
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Found another more relevant code example.
    VB Code:
    1. Dim WithEvents conn As ADODB.Connection
    2.  
    3. Sub Form_Load()
    4.  
    5. Dim cmd As New ADODB.Command
    6. Set conn = New ADODB.Connection
    7.            
    8. conn.ConnectionString = _
    9. "Provider=SQLOLEDB;Data Source=sql65server;" _
    10.    & "User ID=sa;Password="""""";Initial Catalog=pubs"
    11. conn.Open
    12.  
    13. cmd.Execute "select * from authors", conn, adAsyncExecute
    14. Debug.Print "Command Execution Started."
    15.  
    16. End Sub
    17.  
    18. Private Sub conn_ExecuteComplete(ByVal RecordsAffected As Long, ByVal
    19.         pError As ADODB.Error, adStatus As ADODB.EventStatusEnum,
    20.         ByVal pCommand As ADODB.Command, ByVal pRecordset
    21.         As ADODB.Recordset, ByVal pConnection As ADODB.Connection)
    22.  
    23. Debug.Print "Completed Executing the Command."
    24.  
    25. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  35. #35
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Help with Modal and no modal forms

    RD - that was basically where I was headed - google for ADO that is not ADO.Net has become useless - so I was looking through a WROX book for examples...

    But those two appear to point out exactly what has to happen.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  36. #36
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Help with Modal and no modal forms

    apparently the command object does handle async (as RD has pointed out).

    My ADO 2.6 reference book says that as well...

    options are:

    adAsyncExecute - obvious
    adAsyncFetch - initial batch of rows are fetched, then remaining are fetched asyncronously
    adAsyncFetchNonBlocking - appears to be useful if you are going to be "searching" the recordset - returns last row if requested row not yet fetched

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  37. #37
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Ok, found a good example that you could use with the progressbar to show progress. The code example will need to be modified as its using a data grid.
    VB Code:
    1. Option Explicit
    2.  
    3.    Const strConn = "DSN=Pubs"
    4.    Const strDefaultSQL = "SELECT * FROM Titles"
    5.  
    6.    Dim cn As ADODB.Connection
    7.    Dim WithEvents rs As ADODB.Recordset
    8.  
    9.    Private Sub Form_Load()
    10.       Command1.Caption = "Go"  
    11.       Text1.Text = strDefaultSQL
    12.    
    13.       Set cn = New ADODB.Connection
    14.       cn.Open strConn
    15.    End Sub
    16.  
    17.    Private Sub Command1_Click()
    18.       Dim strSQL As String
    19.       strSQL = Text1.Text
    20.    
    21.       Set rs = New ADODB.Recordset
    22.       With rs
    23.          .CursorLocation = adUseClient
    24.      
    25.          .Properties("Initial Fetch Size") = 2
    26.          .Properties("Background Fetch Size") = 4
    27.      
    28.          Debug.Print "Start"
    29.          Debug.Print "Initial Fetch Size: " & _
    30.                      .Properties("Initial Fetch Size")
    31.          Debug.Print "Background Fetch Size" & _
    32.                      .Properties("Background Fetch Size")
    33.      
    34.          .Open strSQL, cn, , , adAsyncFetch
    35.       End With
    36.    End Sub
    37.  
    38.    Private Sub rs_FetchProgress(ByVal Progress As Long, _
    39.                                 ByVal MaxProgress As Long, _
    40.                                 adStatus As ADODB.EventStatusEnum, _
    41.                                 ByVal pRecordset As ADODB.Recordset)
    42.                                
    43.       Debug.Print "Fetch: " & Progress & _
    44.                   "  Max: " & MaxProgress
    45.      
    46.    End Sub
    47.  
    48.    Private Sub rs_FetchComplete(ByVal pError As ADODB.Error, _
    49.                                 adStatus As ADODB.EventStatusEnum, _
    50.                                 ByVal pRecordset As ADODB.Recordset)
    51.                              
    52.       If adStatus <> adStatusOK Then
    53.          Debug.Print "Failed"
    54.          Debug.Print "Error: " & pError.Number & " - " & pError.Description
    55.       Else
    56.          Set DataGrid1.DataSource = pRecordset
    57.          Debug.Print "Done"
    58.       End If
    59.    
    60.    End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  38. #38
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Help with Modal and no modal forms

    btw - I've got a couple of places where SPROCS take 10 or 15 minutes - I've been wanting to switch to ASYNC mode myself...

    kathyms - please get back to us with your success in using this method - thanks!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  39. #39
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help with Modal and no modal forms

    Ya, me too. See I am still learning new VB 6 code even to this day
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  40. #40
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Help with Modal and no modal forms

    I haven't found a method yet in oracle. The call to an Oracle SP is different the for SQL Server. The command object will not accept a for asyncronous operations.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Page 1 of 2 12 LastLast

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