Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Why refresh method of the FlexGrid open new SQL connection

Why refresh method of the FlexGrid open new SQL connection

Scheduled Pinned Locked Moved Visual Basic
questioncssdatabasesql-serversysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups