Index: /trunk/psLib/src/dataIO/psDB.c
===================================================================
--- /trunk/psLib/src/dataIO/psDB.c	(revision 4268)
+++ /trunk/psLib/src/dataIO/psDB.c	(revision 4269)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:47:30 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 03:20:04 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -200,16 +200,24 @@
     bool            status;
 
+    // Verify the database object is not NULL
+    if(dbh == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL,true,PS_ERRORTEXT_psDB_INVALID_PSDB);
+        return false;
+    }
+
+    // Generate SQL query string
     query = psDBGenerateCreateTableSQL(tableName, md);
     if (!query) {
-        psError(PS_ERR_UNEXPECTED_NULL, false, "Query generation failed.");
-
-        return NULL;
-    }
-
+        psError(PS_ERR_UNEXPECTED_NULL, false, PS_ERRORTEXT_psDB_QUERY_GEN_FAIL);
+        return false;
+    }
+
+    // Run SQL query to create table
     status = p_psDBRunQuery(dbh, query);
     if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "Failed to create table.");
-    }
-
+        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psDB_TABLE_CREATE_FAIL);
+    }
+
+    // Free query string
     psFree(query);
 
@@ -775,7 +783,13 @@
 bool p_psDBRunQuery(psDB *dbh, const char *query)
 {
+    // Verify database object is not NULL
+    if(dbh == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL,true,PS_ERRORTEXT_psDB_INVALID_PSDB);
+        return false;
+    }
+
+    // Run query
     if (mysql_real_query(dbh->mysql, query, (unsigned long)strlen(query)) !=0) {
-        psError(PS_ERR_UNKNOWN, true, "Failed to execute query.  Error: %s\n", mysql_error(dbh->mysql));
-
+        psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_SQL_QUERY_FAIL, mysql_error(dbh->mysql));
         return false;
     }
@@ -880,12 +894,14 @@
     char            *colType;           // type lookup table
 
-    if (!table) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true, "table param may not be null.");
-
+    // Verify input parameters are not null
+    if ( (tableName==NULL) || (table==NULL) ) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true, PS_ERRORTEXT_psDB_TABLE_PARAM_NULL);
         return NULL;
     }
 
+    // Begin to create SQL string to create table
     psStringAppend(&query, "CREATE TABLE %s (", tableName);
 
+    // Set list iterator at head of list
     cursor = psListIteratorAlloc(table->list, 0, false);
 
@@ -922,4 +938,5 @@
     }
 
+    // Reset iterator to head of list
     psListIteratorSet(cursor, 0);
 
Index: /trunk/psLib/src/dataIO/psFileUtilsErrors.dat
===================================================================
--- /trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 4268)
+++ /trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 4269)
@@ -60,4 +60,8 @@
 psDB_FAILED_TO_CONNECT                 Failed to connect to database.  Error: %s
 psDB_FAILED_TO_CHANGE                  Failed to change database.  Error: %s
+psDB_TABLE_PARAM_NULL                  Create table parameters may not be NULL.
+psDB_QUERY_GEN_FAIL                    Query generation failed.
+psDB_TABLE_CREATE_FAIL                 Failed to create table.
+psDB_SQL_QUERY_FAIL                    Failed to execute SQL query.  Error: %s
 #
 
Index: /trunk/psLib/src/dataIO/psFileUtilsErrors.h
===================================================================
--- /trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 4268)
+++ /trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 4269)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:47:30 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 03:20:04 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -79,4 +79,8 @@
 #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"
+#define PS_ERRORTEXT_psDB_TABLE_PARAM_NULL "Create table parameters may not be NULL."
+#define PS_ERRORTEXT_psDB_QUERY_GEN_FAIL "Query generation failed."
+#define PS_ERRORTEXT_psDB_TABLE_CREATE_FAIL "Failed to create table."
+#define PS_ERRORTEXT_psDB_SQL_QUERY_FAIL "Failed to execute SQL query.  Error: %s"
 //~End
 
Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 4268)
+++ /trunk/psLib/src/db/psDB.c	(revision 4269)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:47:30 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 03:20:04 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -200,16 +200,24 @@
     bool            status;
 
+    // Verify the database object is not NULL
+    if(dbh == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL,true,PS_ERRORTEXT_psDB_INVALID_PSDB);
+        return false;
+    }
+
+    // Generate SQL query string
     query = psDBGenerateCreateTableSQL(tableName, md);
     if (!query) {
-        psError(PS_ERR_UNEXPECTED_NULL, false, "Query generation failed.");
-
-        return NULL;
-    }
-
+        psError(PS_ERR_UNEXPECTED_NULL, false, PS_ERRORTEXT_psDB_QUERY_GEN_FAIL);
+        return false;
+    }
+
+    // Run SQL query to create table
     status = p_psDBRunQuery(dbh, query);
     if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "Failed to create table.");
-    }
-
+        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psDB_TABLE_CREATE_FAIL);
+    }
+
+    // Free query string
     psFree(query);
 
@@ -775,7 +783,13 @@
 bool p_psDBRunQuery(psDB *dbh, const char *query)
 {
+    // Verify database object is not NULL
+    if(dbh == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL,true,PS_ERRORTEXT_psDB_INVALID_PSDB);
+        return false;
+    }
+
+    // Run query
     if (mysql_real_query(dbh->mysql, query, (unsigned long)strlen(query)) !=0) {
-        psError(PS_ERR_UNKNOWN, true, "Failed to execute query.  Error: %s\n", mysql_error(dbh->mysql));
-
+        psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_SQL_QUERY_FAIL, mysql_error(dbh->mysql));
         return false;
     }
@@ -880,12 +894,14 @@
     char            *colType;           // type lookup table
 
-    if (!table) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true, "table param may not be null.");
-
+    // Verify input parameters are not null
+    if ( (tableName==NULL) || (table==NULL) ) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true, PS_ERRORTEXT_psDB_TABLE_PARAM_NULL);
         return NULL;
     }
 
+    // Begin to create SQL string to create table
     psStringAppend(&query, "CREATE TABLE %s (", tableName);
 
+    // Set list iterator at head of list
     cursor = psListIteratorAlloc(table->list, 0, false);
 
@@ -922,4 +938,5 @@
     }
 
+    // Reset iterator to head of list
     psListIteratorSet(cursor, 0);
 
