Sign in to follow this  
Followers 0
lzamora

_IEAttach does not work!

5 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks,

I´ve got the solution, it does work at all!

;)

Peace

Share this post


Link to post
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
Sign in to follow this  
Followers 0