Jump to content

_IEAttach does not work!


lzamora
 Share

Recommended Posts

hi guys,

Im having another problem in my test...see if you guys can help me again.

I have a collumn im my database that shoud get the info i colect in a specific page...like this:

$IE=_IEAttach ($MyVariable)

msgBox(0,"", $IE)

and it returns as 0 (Zero)

How can i get the value that has in the specified field.

hope you folks understand!

Peace

Link to comment
Share on other sites

_IEAttach() doesn't return any "info i colect in a specific page", it returns an object reference to the specified IE Document from which you can get further information. What's in $MyVariable, and what are you expecting to get back?

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

$IE = _IEAttach($Nome_Cliente)
    msgbox (0,"", $IE)
    
    $Form = _IEFormGetObjByName ($IE, "importacaoForm")
    $oText = _IEFormElementGetObjByName ($Form, "cdOperacao")
    $IEcodigo= _IEFormElementGetValue ($oText)
    $NameText = _IEFormElementGetObjByName ($Form, "clienteRisco.nmPessoa")
    $IEnome= _IEFormElementGetValue ($NameText)
    
    msgbox (0,$IEcodigo, $IEnome)
        
    $dbname="db.mdb"
    $adoConn = ObjCreate("ADODB.Connection")
    $adoConn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comercial_QA\DataBase_COMERCIAL\BD_Cambio.mdb;Persist Security Info=False")
    $sql_insert = "insert into TB_Cambio_ConfirmaBoleto (codigo,nome) values('" & $IEcodigo & "','" & $IEnome & "')"
    $adoConn.Execute($sql_insert)
MVP,

In $Myvariable i have a number that is generated by the application, and i want get this number and stored it this variable in my mdb database.

So, i thought was the attach.The curious fact is that sometime it collects the number and sometimes is comes as (Zero)

Hope it clarify a litte bit.

tks

Link to comment
Share on other sites

Whether _IEAttach() works will depend on what's in $Nome_Cliente now. You could test that before continuing, but you should also verify the page is done before trying to pull data. _IECreate() would do that by default, but _IEAttach() doesn't. So:

$IE = _IEAttach($Nome_Cliente)
If @error Then
    MsgBox(16, "Error", "Failed to attach to IE: " & $Nome_Cliente & @CRLF & _
            "@error = " & @error & "; @extended = " & @extended)
Else
    _IELoadWait($IE)
    
    $Form = _IEFormGetObjByName ($IE, "importacaoForm")
    
    ; ... etc.
    
EndIf

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...