Subversion Repository Public Repository

ConnectionOdbcSdk

Diff Revisions 11 vs 12 for /trunk/ConnectionServer/ConnectionInformixAdoNetDatabaseFunctions.cs

Diff revisions: vs.
  @@ -272,12 +272,6 @@
272 272 DbFetchResult res = new DbFetchResult();
273 273 res.Successful = false;
274 274
275 - if (_iFxConnection == null)
276 - {
277 - res.ErrorDetails = "Database not connected";
278 - return res;
279 - }
280 -
281 275 //validate the name
282 276 if (string.IsNullOrEmpty(pDatabaseName))
283 277 {
  @@ -286,6 +280,12 @@
286 280 return res;
287 281 }
288 282
283 + if (_iFxConnection == null)
284 + {
285 + res.ErrorDetails = "Database not connected";
286 + return res;
287 + }
288 +
289 289 //make sure the DB name is valid
290 290 switch (pDatabaseName.ToUpper())
291 291 {
  @@ -303,6 +303,7 @@
303 303 default:
304 304 res.ErrorDetails ="(error) Invalid database name passed to ChangeActiveDatabase in clsConnectionServer:" +pDatabaseName;
305 305 RaiseErrorEvent(res.ErrorDetails);
306 + res.Successful = false;
306 307 return res;
307 308 }
308 309
  @@ -316,7 +317,7 @@
316 317 {
317 318 _iFxConnection.Open();
318 319 }
319 - catch (System.Data.Odbc.OdbcException ex)
320 + catch (Exception ex)
320 321 {
321 322 res.ErrorDetails = "(error) while changing databases in ChangeActiveDatabase: " + ex;
322 323 RaiseErrorEvent(res.ErrorDetails);
  @@ -395,6 +396,7 @@
395 396 {
396 397 res.Successful = false;
397 398 res.ErrorDetails="(error) in UpdateStaticsForMailstore:" + ex;
399 + return res;
398 400 }
399 401 }
400 402 }
  @@ -409,14 +411,14 @@
409 411 /// there's some common failure reasons that we can dig out and warn about in a friendly mannor - if it's something else
410 412 /// just pass through what the ODBC driver raises.
411 413 /// </summary>
412 - public string GetLoginErrorString(IfxException ex)
414 + public static string GetLoginErrorString(IfxException ex)
413 415 {
414 416 if (ex == null)
415 417 {
416 418 return "";
417 419 }
418 420
419 - string strErrorText = "The login attempt to " + DatabaseServerName + " failed." + "\n" + "\n";
421 + string strErrorText = "The login attempt failed." + "\n" + "\n";
420 422
421 423 //check system errors returned by Informix - there's a couple of common ones users trip up on a lot.
422 424 if (ex.Errors.Count > 0)
  @@ -565,7 +567,7 @@
565 567 {
566 568 string strRemoteFileName;
567 569
568 - if (StartNewCommand("csp_allocatevoicefile") == false)
570 + if (StartNewCommand("csp_allocatevoicefile",true) == false)
569 571 {
570 572 return "";
571 573 }