Jump to content

Select Data Source


Go to solution Solved by gjennings1,

Recommended Posts

 I'm having issues when the Select Data Source window opens to the 'File Data Source' tab rather than the 'Machine Data Source' tab.  How can I check the tab and switch it?

Run ("G:\Report Menu 80 DEV\WCFS700.EXE")
; Wait a second before continuing
WinWaitActive("Report Menu (CFS700)")
sleep(100)
#include <GuiListView.au3>
#Include <GuiTab.au3>

Dim $ttlWindow
Dim $hdlWindow
Dim $cidList
Dim $hdlList

Local $ttlWindow = "Select Data Source"

;$tabTxt = ControlGetText("Select Data Source", "", "SysTabControl321"
;Msgbox(0,"Tab",$tabTxt)

;Make sure we are on the correct tab
;$tabHwnd = ControlGetHandle ( "Select Data Source", "", "[CLASS:SysTabControl32; INSTANCE:1]" )
;_GUICtrlTab_SetCurFocus ( $tabHwnd, 0)
;_GUICtrlTab_SetCurSel ( $tabHwnd, 0)
sleep(100)

;ControlClick("Select Data Source", "", "[CLASS:SysTabControl32; INSTANCE:1]")

Local $cidList = "[CLASS:SysListView32; INSTANCE:1]"

Local $hdlWindow = WinGetHandle($ttlWindow)
Local $hListBox = ControlGetHandle($hdlWindow, "", $cidList)



;Pick the appropriate DSN
Local $index = 0
For $i = 0 To _GUICtrlListView_GetItemCount($hListbox)
      If $index = 0 Then
            If Not StringInStr(_GUICtrlListView_GetItemText($hListbox,$i), "DEVREP") = 0 Then $index = $i
      EndIf
   Next
sleep(100)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...