Index: /trunk/psLib/src/dataIO/psDB.c
===================================================================
--- /trunk/psLib/src/dataIO/psDB.c	(revision 4261)
+++ /trunk/psLib/src/dataIO/psDB.c	(revision 4262)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:01:08 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 01:47:30 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -159,6 +159,15 @@
 bool psDBChange(psDB *dbh, const char *dbname)
 {
+    // Verify database object is valid
+    if(dbh == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
+                PS_ERRORTEXT_psDB_INVALID_PSDB);
+        return false;
+    }
+
+    // Attempt to select new database
     if (mysql_select_db(dbh->mysql, dbname) != 0) {
-        psError(PS_ERR_UNKNOWN, true, "Failed to change database.  Error: %s", mysql_error(dbh->mysql));
+        psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_FAILED_TO_CHANGE,
+                mysql_error(dbh->mysql));
 
         return false;
Index: /trunk/psLib/src/dataIO/psFileUtilsErrors.dat
===================================================================
--- /trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 4261)
+++ /trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 4262)
@@ -59,4 +59,5 @@
 psDB_INVALID_PSDB                      Invalid psDB has been specified.
 psDB_FAILED_TO_CONNECT                 Failed to connect to database.  Error: %s
+psDB_FAILED_TO_CHANGE                  Failed to change database.  Error: %s
 #
 
Index: /trunk/psLib/src/dataIO/psFileUtilsErrors.h
===================================================================
--- /trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 4261)
+++ /trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 4262)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:01:08 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 01:47:30 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -78,4 +78,5 @@
 #define PS_ERRORTEXT_psDB_INVALID_PSDB "Invalid psDB has been specified."
 #define PS_ERRORTEXT_psDB_FAILED_TO_CONNECT "Failed to connect to database.  Error: %s"
+#define PS_ERRORTEXT_psDB_FAILED_TO_CHANGE "Failed to change database.  Error: %s"
 //~End
 
Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 4261)
+++ /trunk/psLib/src/db/psDB.c	(revision 4262)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:01:08 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 01:47:30 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -159,6 +159,15 @@
 bool psDBChange(psDB *dbh, const char *dbname)
 {
+    // Verify database object is valid
+    if(dbh == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
+                PS_ERRORTEXT_psDB_INVALID_PSDB);
+        return false;
+    }
+
+    // Attempt to select new database
     if (mysql_select_db(dbh->mysql, dbname) != 0) {
-        psError(PS_ERR_UNKNOWN, true, "Failed to change database.  Error: %s", mysql_error(dbh->mysql));
+        psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_FAILED_TO_CHANGE,
+                mysql_error(dbh->mysql));
 
         return false;
