Why refresh method of the FlexGrid open new SQL connection
-
Public Connection1 As ADODB.Connection Public strConnectionString As String Public strUserWsd As String Public strUserID As String Set Connection1 = New ADODB.Connection Connection1.ConnectionString = strConnectionString 'we already catch the UserID and Pwd info in this stage strConnectionString = "DSN=Station Train Control;UID=" + strUserID + ";PWD=" + strUserWsd Connection1.Open strConnectionString, strUserID, strUserWsd 'in this stage of the program : open Connection1 establish a principal connection 'later in the program 'call flexGrid 'the control "MSRDC1" for the FlexGrid which manupulate with the information for the Grid frmDepArrival.MSRDC1.Connect = strConnectionString frmDepArrival.MSRDC1.UserName = strUserID frmDepArrival.MSRDC1.Password = strUserWsd 'the program keeping the same connection....everything it's still OK frmDepArrival.MSRDC1.SQL = " select 'Train #'=trn_no ,'Track #'=trk_no,'Schedule'=convert(char(5),sch_dep_tm,14),'Actual'=convert(char(5),act_dep_tm,14) ,'Delay(min)'=DateDiff(mi,sch_dep_tm ,act_dep_tm ) from actdep where trn_prcs_dt = '10-04-2001 12:00PM' and in_stn_ind ='N' order by sch_dep_tm asc " frmDepArrival.MSRDC2.Connect = strConnectionString frmDepArrival.MSRDC2.UserName = strUserID frmDepArrival.MSRDC2.Password = strUserWsd 'the program keeping the same connection....everything it's still OK frmDepArrival.MSRDC2.SQL =select 'Train #'=trn_no ,'Track #'=trk_no ,'Schedule'=convert(char(5),sch_arr_tm,14) ,'Actual'=convert(char(5),act_arr_tm,14) ,'Delay(min)'=DateDiff(mi,sch_arr_tm,act_arr_tm) from actarr where trn_prcs_dt = '10-04-2001 12:00PM' and in_stn_ind ='N' order by sch_arr_tm asc 'the program keeping the same connection....everything it's still OK 'in this stage the program opening new connection on Refresh method,Why? frmDepArrival.MSRDC1.Refresh 'in this stage the program opening new connection on Refresh method,Why? frmDepArrival.MSRDC2.Refresh The question : How I can keep the "Microsoft SQL Server 6.5 " from opening the new connection on Refresh method the FlexGrid's and using the old "one and only" connection in the program??? Lillian