Forum Discussion

sabhari's avatar
sabhari
Occasional Contributor
12 years ago

[Microsoft][ODBC Excel Driver] Ststem Resource Exceeded

I use the below peace of code to connect to .xls files to access the test data.



It works fine with Windows 7, with XP it was working fine for some time, but now Whenever i execute I get the Error dialog as seen in the attachment. I also closed all the connections whenever I opened them.So it is not due to multiple simultaneous connections.



adoConn = new connector();

var ConnStr = "DRIVER=Microsoft Excel Driver (*.xls);DBQ=";



        adoConn.Connection = Sys.OleObject("ADODB.Connection");

        adoConn.Connection.ConnectionString = ConnStr + filePath + "\\" + fileName + ";ReadOnly=1;";

        adoConn.Connection.Open();
  • googleid_105613's avatar
    googleid_105613
    Occasional Contributor
    I had a problem with ADO and my scripts crashing a few years ago, and I solved it by collecting my own garbage.  Before I exit any function, I set all variables I created within the function to null, except for any outbound data.



    Kinda like this:



    function foo(inboundParam)

    {

      var a;

      var b;



      //do some tests



     a=null;

     return b;

    }



    I discovered this because I was reading something like 500,000 records from a database for data validation, and not cleaning up after myself.