Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM ODBC Driver » View Thread |
Messages 1 to 1 of 1 total |
Sporadic error when using DBISAM ODBC driver |
Wed, Jun 18 2014 10:15 AM | Permanent 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 |
This web page was last updated on Thursday, March 28, 2024 at 08:36 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |