iFix Lable Caption Refresh

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
I am trying to set the caption of a label
before doing a test of a connection to an SQL server

Private Sub SQL_Test_Button_Click()
Const NVGeneralBottleRecordConnString = "Provider=SQLNCLI10.1;Data Source=FASDB\FAS_MSSQLSERVER;Initial Catalog=BatchRecord;" & "User Id=SQLusrVb;Password=SQLusrVb1!"
Record_Str.Caption = "Please Wait, testing connection to SQL Server"
Record_Str.Refresh
TestConnectionToSqlServer (NVGeneralBottleRecordConnString)
End If
End Sub

However the caption is not updated until the call to the
TestConnectionToSqlServer has timed out
How do I get the caption to update before the call
Thanks
 
Your problem is that the VBA code is running in the same thread as workspace is using to update the UI. Put in another way, the UI will not be updated until the function is done executing or you manually tell VBA to process other events. You can tell workspace to process other events by adding a DoEvent after setting the label caption. Please note that DoEvent can make workspace crash if used incorrectly (it's fine in this case) so try not to use them too much.

Have you considered using VisiconX to connect to your database? IMO it will be a cleaner and solution without any - or very little - custom code.
 

Similar Topics

Dear all, I am beginer in ifix hmi programming. I have 2 ifix 6.0 pc with license FiX and client.. Can some one tell me how to configure sample...
Replies
0
Views
138
Hello, I have to deal with iFix again and am looking at the most efficient way to create alarms to display in iFix, i.e. not creating an...
Replies
0
Views
149
Hi everyone. I'm beginner with Ifix. I'm appreciate if you share me some document to understand how to play with Ifix 6.0. By the way, I have some...
Replies
11
Views
687
Hi everyone. Ifix scada is new for me. Please help help me to clarify is it possible to open Ifix scada runtime on dual monitor and how to do? Thanks
Replies
1
Views
436
Hi team! I'm starting some iFIX application migrations and some of them are being developed with the high performance library. Some objects that...
Replies
4
Views
807
Back
Top Bottom