in reply to Re^2: problem with script transfered from VBS
in thread problem with script transfered from VBS

No problem :-)

Looking again at your original change, it was in the context of using value as a method to get the current value for an assignment.

You could try, instead of $rs->Fields('AEName')->value = $psProxyName;, $rs->Fields('AEName')->value($psProxyName);...

At last, a user level that overstates my experience :-))

Replies are listed 'Best First'.
Re^4: problem with script transfered from VBS
by xiaoyafeng (Deacon) on Aug 06, 2008 at 14:11 UTC
    Thanks for your prompt reply! I don't need to drain my brain as much since I got your help.
    I've tried as your suggestion, the good news is perl didn't throw any error. the bad news is it did do anything!:(
    I place print $rs->Fields('AEName')->value($psProxyName) after and before the statment. below are output
    VB script: wscript.echo "AEName old value is" wscript.echo rs.Fields( "AEName" ).value wscript.echo "ADAS_ID old value is" wscript.echo rs.Fields( "ADAS_ID" ).value rs.Fields( "AEName" ) = psProxyName rs.Fields( "ADAS_ID" ) = pnDeviceID wscript.echo "AEName new value is" wscript.echo rs.Fields( "AEName" ).value wscript.echo "ADAS_ID new value is" wscript.echo rs.Fields( "ADAS_ID" ).value wscript.echo rs.Fields( "AEName" ).value wscript.echo rs.Fields( "ADAS_ID" ).value __OUTPUT__ C:\>cscript cmp.vbs Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. AEName old value is Mp_Default ADAS_ID old value is null AEName new value is MyTestMeterProxy06 ADAS_ID new value is 1415 Meter proxy created having the ID: 673132 Script Finished
    perl script print "ADAS_ID old value is", $rs->Fields('ADAS_ID')->value."\n"; print "AEName old value is", $rs->Fields('AEName')->value."\n"; print "\$psProxyName value is $psProxyName\n"; print "\$pnDeviceID value is $pnDeviceID\n"; $rs->Fields('AEName')->value($psProxyName); $rs->Fields('ADAS_ID')->value($pnDeviceID); print "ADAS_ID new value is", $rs->Fields('ADAS_ID')->value."\n"; print "AEName new value is", $rs->Fields('AEName')->value."\n"; $nCheckoutID = $ctMgr->Checkout($pnContainerID, $aSec); __OUTPUT__ C:\>perl cmp2.pl ADAS_ID old value is AEName old value isMp_Default $psProxyName value is MyTestMeterProxy010 $pnDeviceID value is Win32::OLE=HASH(0x1987448) ADAS_ID new value is AEName new value isMp_Default Meter proxy created having the ID: Script Finished
    I'm confused with output above. It seems to me '->value($psProxyName)' doesn't work?
    How can I continue?

    BTW: what can I benifit from overstating my experience?

    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
      Hi ,

      Although the you didn't get a compile-time error, you may have experienced a run-time error - which wasn't caught.

      If it's the basic Win32::OLE module, any error from the last operation can be accessed via a call to Win32::OLE->LastError(), so try ...

      $rs->Fields('AEName')->value($psProxyName); die "value(\$psProxyName) failed - " . Win32::OLE->LastError() if Win3 +2::OLE->LastError();

      BTW, my sig is self-deprecating - it says that PM has a higher regard for my experience than I do;-)

      A user level that continues to overstate my experience :-))
        It throws:
        C:\>perl cmp2.pl value($psProxyName) failed - Win32::OLE(0.1709) error 0x8002000e: "Inv +alid numbe r of parameters" in METHOD/PROPERTYGET "Value"Meter proxy created having the ID: Script Finished
        What does it mean? and how do I walk around? Thanks in advance!

        I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction