Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Sporadic error when using DBISAM ODBC driver
Wed, Jun 18 2014 10:15 AMPermanent Link

Justin

Hi

We're evaluating the trial DBISAM ODBC Driver (4.39 Build 1) for integrating with a third-party application.
We've never encountered any issues with the driver during development.

We've given a beta-version of our application to the client for UAT. However, during their own testing, they randomly receive the following error:

ERROR [HY000] [Elevate Software][DBISAM] List index out of bounds (1)

We've gone through our code and can't see anything obvious that could be causing the problem.
Here are some code snippets (C#);

//Create the connection string
private string CreateConnectionString(string databaseFolder)
       {
           Guard.ArgumentNotEmpty(databaseFolder, "databaseFolder");

           return string.Format("Driver={{DBISAM 4 ODBC Driver}};ConnectionType=Local;CatalogName={0};", databaseFolder);
       }


//Query company details
public Task<CompanyDetailsDto> GetCompanyDetailsAsync(string companyDatabaseFolder)
       {
           Guard.ArgumentNotEmpty(companyDatabaseFolder, "companyDatabaseFolder");

           return Task.Factory.StartNew<CompanyDetailsDto>(() => {

               CompanyDetailsDto companyDetails = null;

               try {

                   using(OdbcConnection connection = new OdbcConnection(CreateConnectionString(companyDatabaseFolder))) {

                       connection.Open();
                       OdbcCommand command = new OdbcCommand("SELECT * FROM COMPANY", connection);

                       using(var reader = command.ExecuteReader()) {

                           while(reader.Read()) {
                               companyDetails = new CompanyDetailsDto();

                               
                               companyDetails.CompanyName = reader.GetValue<string>("COMPANYNAM");
                               companyDetails.Address1 = reader.GetValue<string>("ADDRESS1");
                               companyDetails.Address2 = reader.GetValue<string>("ADDRESS2");
                               companyDetails.Address3 = reader.GetValue<string>("ADDRESS3");
                               companyDetails.Address4 = reader.GetValue<string>("ADDRESS4");
                               companyDetails.CompanyTax = reader.GetValue<string>("COMPANYTAX");
                               

                               break;
                           }

                       }

                       command = new OdbcCommand("SELECT * FROM COMPANYDEFAULTS", connection);
                       using(var reader = command.ExecuteReader()) {


                           while(reader.Read()) {

                               companyDetails.DefaultPurchaseCost = reader.GetValue<int>("DefaultPurchaseCost");
                           }
                       }

                       connection.Close();
                   }
               }
               catch(Exception ex) {
                   throw new AggregateException(new ApplicationException(string.Format(Resources.IQRetail.Descriptions.IQRetail_Accounting_DBQueryError, ex.Message)), ex);
               }

               return companyDetails;

           });

       }


Any help or suggestions would be appreciated.

Thanks
Justin
Image