Wednesday, January 14, 2015

How to fix SQL query exceeds specified time limit or storage limit against AS400 Data Source


 I implmented an data loading with VB script that executing in the Look Server, I have the following connection string to access the data source.

VarConString = "DRIVER=Client Access ODBC Driver (32-bit); UID=as400User;PWD=mypassword;SYSTEM=MyDataBaseName"

But I got a very weird error on the execution. the error message is shown below



Microsoft OLE DB Provider for ODBC Drivers
[IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0666 - SQL query exceeds specified time limit or storage limit.



the google search suggest the fix is to modify the ODBC configuraton to increase the execution time limit and storage limit.

However it is a better approach to use a different data driver. such as the IBM iSeries driver to solve those issue.

i simply replace the connection string with the following connection string, the the error is gone and data return from the execution.

VarConString = "Provider=IBMDA400; User Id=as400User;Password=mypassword;Data source=MyDataBaseName"











 

1 comment:

  1. For my this was works, edit cmd OdbcCommand before execute.....
    OdbcCommand cmd = new OdbcCommand(string.Format("")
    cmd.CommandTimeout = 0;
    OdbcDataAdapter da = new OdbcDataAdapter(cmd);

    ReplyDelete