Index: trunk/psLib/src/dataIO/psDB.c
===================================================================
--- trunk/psLib/src/dataIO/psDB.c	(revision 4262)
+++ 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);
 
