Jump to content

The script does not working after beta upgrade


Recommended Posts

@Gollum

AutoIt is not case sensitive and your suggested line is no good as you need to check @error right after a function call or else it resets with the next function call which RegRead would reset it.

Edit:

lsakizada. out of the loop and into to more problems...hmm

Edited by MHz
Link to comment
Share on other sites

@Gollum

AutoIt is not case sensitive and your suggested line is no good as you need to check @error right after a function call or else it resets with the next function call which RegRead would reset it.

Oops me and my big mouth :">

This get me the GUI up and running

Func ODBCsources($h_controlID, $s_RegEntry, $s_Type)
    Local $s_List, $i_dsncount, $s_VarNm, $s_Value, $i
    $i = 1
    $s_VarNm = RegEnumVal($s_RegEntry,  $i)
        If @error Then Return
    $s_Value = RegRead($s_RegEntry, $s_VarNm)
    While $s_VarNm <> ""
        $s_VarNm = RegEnumVal($s_RegEntry,  $i)
                If @error Then ExitLoop
        $s_Value = RegRead($s_RegEntry, $s_VarNm)
        If $s_VarNm <> "" Then
            GUICtrlCreateListViewItem($s_VarNm & "|" & $s_Type & "|" & $s_Value, $h_controlID)
            $i += 1
            $i_DSNcount += 1
        EndIf
    Wend
EndFunc
Link to comment
Share on other sites

Oops me and my big mouth :">

This get me the GUI up and running

Func ODBCsources($h_controlID, $s_RegEntry, $s_Type)
    Local $s_List, $i_dsncount, $s_VarNm, $s_Value, $i
    $i = 1
    $s_VarNm = RegEnumVal($s_RegEntry,  $i)
        If @error Then Return
    $s_Value = RegRead($s_RegEntry, $s_VarNm)
    While $s_VarNm <> ""
        $s_VarNm = RegEnumVal($s_RegEntry,  $i)
                If @error Then ExitLoop
        $s_Value = RegRead($s_RegEntry, $s_VarNm)
        If $s_VarNm <> "" Then
            GUICtrlCreateListViewItem($s_VarNm & "|" & $s_Type & "|" & $s_Value, $h_controlID)
            $i += 1
            $i_DSNcount += 1
        EndIf
    Wend
EndFunc
This is not working for me. Has the same error as I mentioned ... :whistle:

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

Yeah, sorry, was so intent on solution I forgot you're using beta only.

I'll slink away now. :whistle:

I may got a clue:

The ControlGetPos function in around line 146 does not working. It is not returning array as used to be.

Edited by lsakizada

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

There is 2 GuiSetState in this example. Comment one and then comment the other to see the change in effect.

GUICreate('')
$Button_1 = GUICtrlCreateButton ("Run Notepad",  10, 30, 100)
;~ GUISetState ()
ControlGetPos('', '', $Button_1)
If @error Then MsgBox(0, '', 'error')
GUISetState ()
Sleep(10000)

MHZ

Almost you done it.

That's bring up the GUI but messed up the "Query" tab item.

$tab_query=GUICtrlCreateTabitem (" Query ").

I commented 2 lines and it works for me fine. I commented:

;$lab_sql2 = GUICtrlCreateLabel($sql_str_1, 20, $b_size[1]- 15, 550, 150)

$c_size = ControlGetPos("", "", $lst_monitor1)

;$lab_sql2 = GUICtrlCreateLabel($sql_str_2, 20, $c_size[1]- 15, 550, 150)

But still why it is behave not normal ????

Guys, I will monitor this topic latter today. I must go now. Thanks and many :whistle: for your help.

Please think about this issue. might be an Autoit Bug

Edited by lsakizada

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

  • 8 months later...

In case you still care,

Your problem is here:

; DSN 
Global Const $s_ODBCregUser   = "HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
Global Const $s_ODBCregSystem = "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"

Func ODBCsources($h_controlID, $s_RegEntry, $s_Type)
    Local $s_List, $i_dsncount, $s_VarNm, $s_Value, $i
    $i = 1
    $s_VarNm = RegEnumVal($s_RegEntry,  $i)
        If @error Then Return
    $s_Value = RegRead($s_RegEntry, $s_VarNm)
    While $s_VarNm <> ""
        $s_VarNm = RegEnumVal($s_RegEntry,  $i)
                If @error Then ExitLoop
        $s_Value = RegRead($s_RegEntry, $s_VarNm)
        If $s_VarNm <> "" Then
            GUICtrlCreateListViewItem($s_VarNm & "|" & $s_Type & "|" & $s_Value, $h_controlID)
            $i += 1
            $i_DSNcount += 1
        EndIf
    Wend
EndFunc

If you trace those lines you'll find it loops infinately due to the fact that $s_VarNm never equals "". There are several SQL scripts floating around which have the same problem. The only solution I found is to hard code the DB name instead of trying to read it from the registry.

Edited by Teldin
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...