VBA Error - Reflection.FTP.3 - vba

I had this error pop up on exactly the 3rd line of code below. There seem to be no explanation on the Internet for this behaviour.
I'm looking at why this error came up, and fixed itself after few minutes.
Set Ftp = CreateObject("Reflection.FTP.3")
Ftp.Open "xxx.xxx.xxx.xxx", "username", "password"
Ftp.SetCurrentDirectory "DirectoryName/DirectoryName/DirectoryName"
What was the error?
Run-time error '-2147418113 (8000ffff)':
Method 'SetCurrentDirectory' of object 'IReflectionFTP' failed
More details:
Application: Excel Macro
Language : VB (VBA)
*Is this because of a coding error? *
Not likely. The macro has been long running and this came up for the first time.
*Is it because of a FTP service disruption? *
May be. But logs have a recording for every second and there seems to be no outage.

It seems to me there is a connection problem here - maybe a timeout? I assume that your three lines of code don't execute one after another (ie the SetCurrentDirectory is after some more code). This error will come up if the Ftp object doesn't have a valid connection that is logged in. Change the IP for the Open command to an invalid one and you'll see you get the same error.
Try setting the following line of code before SetCurrentDirectory command.
If FTP.Status = rcLoggedIn + rcConnected Then
Ftp.SetCurrentDirectory "DirectoryName/DirectoryName/DirectoryName"
Else
'Error handle
End If
Note, that you are late binding the object so for it to work for you, you'll need the If statement to be:
If FTP.Status = 17 Then
Also, if it is a timeout problem then I'd set the Timeout period for the session to be longer, ie FTP.TimeoutSession = 300.

Related

vba selenium waitDisplay method not working

Who can tell me why the method of Selenium WebDriver.WaitDisplayed is not working in my code below?
I can share other code if needed?
Set a = webdriber.FindElementsByClass("search-global-typeahead__collapsed-search-button")
a.Item(1).WaitDisplayed(True).Click ' operation timed out after -1ms. Run-time err'21'
a.Item(1).Click ' gives an error
I added code below; without successful result
a.Item(1).WaitDisplayed(True, 100).Until(a.Item(1).IsDisplayed,10)
I guess to start with the most obvious, does it still cause an error after fixing the typo in the 'webdriber' identifier? I'm guessing your declaration is spelled 'webdriver'.

T24 - core banking

I am getting below error in t24 when executing Auth Routine.
FATAL ERROR IN (SENSITIVE ROUTINES CALLED IN LOCAL RTNS
the error appears when the routine gets executed and completed.
i have also tried to call a mainline routine which post OFS,
the problem is the code gets executed successfully, the OFS response is also retured.
but when the routine gets end, it shows this error.
I know some but wanna share everyone this issue was solved, please check below capture
Just add 1 line SENSITIVITY = '' after execute OFS.GLOBUS.MANAGER, all version routine when face this this issue we can do this way no need to create main routine.

VFP. Trapping COM errors

Trapping Excel COM errors from a VFP program.
A program is writing out an extract from several large tables to Excel using Automation.
Typical instructions include :
lCell = "I1234”
.sSheet1.Range(lCell).value = cCust.Name
This generally works fine, but if cCust.name has a value such as ‘=’ (which Excel does not like), this causes an OLE COM error.
Had tried using TRY .. . CATCH . . . ENDTRY to trap this error, but the OLE COM error still reports.
I suppose that I could find out all the possible errors in the data and clean them up, but is there any way of getting Automation to ignore the error and carry on (leaving the field unpopulated)?
Thank you.
I am adding this as an answer, since it contains some code that would otherwise cause a mess. With ON error it is working perfectly fine for me. ie:
*** Constant Group: XlSaveAction
#Define xlDoNotSaveChanges 2
#Define xlSaveChanges 1
Local loExcel As Excel.Application
Local lcValue
loExcel = Createobject('Excel.Application')
loExcel.Workbooks.Add()
loExcel.ActiveWorkbook.SaveAs('c:\temp\ExcelReadTest.xlsx')
loExcel.DisplayAlerts = .F.
*loExcel.Visible = .T.
On Error lcValue = .Null.
With loExcel.ActiveWorkbook.ActiveSheet
.Range('A5').Value = '=Like me'
lcValue = .Range('A5').Value
? m.lcValue
Endwith
On Error
loExcel.ActiveWorkbook.Close(xlSaveChanges)
loExcel.Quit()

Setting a timeout on webservice consumer built with org.apache.axis.client.Call and running on Domino

I'm maintaining an antedeluvian Notes application which connects to a SAP back-end via a manually done 'Webservice'
The server is running Domino Release 7.0.4FP2 HF97.
The Webservice is not the more recently Webservice Consumer, but a large Java agent which is using Apache soap.jar (org.apache.soap). Below an example of the calling code.
private Call setupSOAPCall() {
Call call = new Call();
SOAPHTTPConnection conn = new SOAPHTTPConnection();
call.setSOAPTransport(conn);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
There has been a change in the SAP system which is now taking 8 minutes to complete (verified by SAP Team).
I'm getting an error message as follows:
[SOAPException: faultCode=SOAP-ENV:Client; msg=For input string: "906 "; targetException=java.lang.NumberFormatException: For input string: "906 "]
I found a blog article describing the error message quite closely:
https://thejavablog.wordpress.com/category/jmeter/
and I've come to the hypothesis that it is a timeout message that is returning to my Call object and that this timeout message is being incorrectly parsed, hence the NumberFormat Exception.
Looking at my logs I can see that there is a time difference of 62 seconds between my call and the response.
I recommended that the server setting in the server document, tab Internet Protocols/HTTP/Timeouts/Request timeouts be changed from 60 seconds to 600 seconds, and the http task restarted with
tell http restart
I've re-run the tests and I am getting the same error, and the time difference is still slightly more than 60 seconds, which is not what I was expecting.
I read Michael Rulnau's blog entry
http://www.mruhnau.net/2014/06/how-to-overcome-domino-webservice.html
which points to this APR
http://www-01.ibm.com/support/docview.wss?uid=swg1LO48272
but I'm not convinced that this would apply in this case, since there is no way that IBM would know that my Java agent is in fact making a Soap call.
My current hypothesis is that I have to use either the setTimeout() method on
org.apache.axis.client.Call
https://axis.apache.org/axis/java/apiDocs/org/apache/axis/client/Call.html
or on the org.apache.soap.transport.http.SOAPHTTPConnection
https://docs.oracle.com/cd/B13789_01/appdev.101/b12024/org/apache/soap/transport/http/SOAPHTTPConnection.html
and that the timeout value is an apache default, not something that is controlled by the Domino server.
I'd be grateful for any help.
I understand your approach, and I hope this is the correct one to solve your problem.
Add a debug (console write would be fine) that display the default Timeout then try to increase it to 10 min.
SOAPHTTPConnection conn = new SOAPHTTPConnection();
System.out.println("time out is :" + conn.getTimeout());
conn.setTimeout(600000);//10 min in ms
System.out.println("after setting it, time out is :" + conn.getTimeout());
call.setSOAPTransport(conn);
Now keep in mind that Dommino has also a Max LotusScript/Java execution time, check this value and (at least for a try) change it: http://www.ibm.com/support/knowledgecenter/SSKTMJ_9.0.1/admin/othr_servertasksagentmanagertab_r.html (it's version 9 help but this part should be identical)
I've since discovered that it wasn't my code generating the error; the default timeout for the apache axis SOAPHTTPConnetion is 0, i.e. no timeout.

Invalid operation result set is closed errorcode 4470 sqlstate null - DB2 data extract

I am running a very simple query and trying to extract the results to a text file. The entire query is essentially what is below, I am selecting everything from one single table with one piece of where criteria which is limiting the data to one month's worth. After it has extracted around 1.2 gig this error shows up. Is there any way that I can work around this other than extracting smaller date ranges? I am trying to pull a couple of years worth of data so if I can only get it a few days at a time it will take a lot of manual work.
I am currently using the free trial of a DB2 query tool - Razor SQL if that makes a difference, I can probably purchase different software if it would help. I am trying to get IBM's tool but for some reason it freezes during the download so I am still working on that. I have searched about this error but everything I see seems much more complex than what I am doing and I can't tell if it applies or not. Thanks in advance.
select *
from MyTable
where date_col between date '2014-01-01' and date '2014-01-31'
I stumbled at this error too, found out it is related to db2jcc.jar (type 4) driver.
Excerpt: If there are no items in the result set left (or to begin with), the Result set is closed automatically and therefore the Exception. Suggestion is to handle it in the application, perhaps in my case, I started checking if(rs.next()) but otherwise, there is a work around. Check out the source link below for how you can set some properties to Data source and avoid exception.
Source :
"Invalid operation: result set is closed" error with Data Server Driver for JDBC
In my case, i missed some properties in WAS, after add allowNextOnExhaustedResultSet the issue is fixed.
1.Log in to the WebSphere Application Server administration console.
2.Select Resources > JDBC > Data sources > Application Center DataSource name > Custom properties and click New.
3.In the Name field, enter allowNextOnExhaustedResultSet.
4.In the Value field, type 1.
5.Change the type to java.lang.Integer.
6.Click OK.
Sometimes you need also check whether resultSetHoldability properties exists. Details refer to here.
I encountered this failure also when ugrading from JDBC Type 2 driver (db2java.zip) JDBC type 4 driver (db2jcc4.jar)
Statement statement = results.getStatement();
if (statement != null)
{
connection = statement.getConnection(); // ** failed here
statement.close();
}
Solution was to check if the statement is closed or not as follows.
Changed to:
Statement statement = results.getStatement();
if (statement != null && !statement.isClosed()) {
{
connection = statement.getConnection();
statement.close();
}
Creating property bellow with type Integer it's worked for me:
allowNextOnExhaustedResultSet:
I had the same issue on WAS 7 so i had to add and change few this on Admin Console.
This TeamWorksRuntimeException exception should be fixed by applying APAR JR50863 which is available on top of BPM V8.5.5 or included on BPM V8.5 refresh pack 6.
For the case that the APAR does not solve the problem, try following workaround:
Log in to the WebSphere Application Server admin console
Select Resources > JDBC > Data sources > DataSource name (TeamWorksDB) > Custom properties and click New
In the Name field, enter downgradeHoldCursorsUnderXa
In the Value field, type true
Change the type to java.lang.Boolean
Click OK to save your changes
Select custom property resultSetHoldability
In the Value field, type 1
Click OK to save your changes
Source of the Answer : https://developer.ibm.com/answers/questions/194821/invalid-operation-result-set-is-closed-errorcode-4/
Restarting the app may fix the problem if connection pool lost session to Db2. If using Tomcat then connection pool property of 'testonBorrow' may reestablish the connection to Db2.