I was able to attack this issue with a clear mind this morning and found a solution. I realized that there was no output workspace defined. Here is my new code:
#Import COM dispatch and sys
import win32com.client, sys, os
#Create Geoprocessor object
GP = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
GP.SetProduct("arcview")
#Set the input workspace
GP.Workspace = "E:/gis_py_ex/shapefiles"
#Set the output workspace
outWorkspace = "E:/gis_py_ex/results/Testing.mdb"
try:
#Get a list of the featureclasses
fcs = GP.ListFeatureClasses("*")
#Reset the enumeration to make sure the first object is returned
fcs.reset()
#Get the first feature class name
fc = fcs.next()
while fc:
#Copy the features from the workspace to a geodatabase
outfc = GP.ValidateTableName(fc)
outFeatureClass = outWorkspace + "/" + outfc
GP.CopyFeatures_management(fc, outFeatureClass)
#Get the next feature class name
fc = fcs.next()
except:
GP.AddMessage(GP.GetMessages(2))
print GP.GetMessages(2)
As I said in my first post, the book/tutorial that I'm using seems to be full of mistakes. This is the second example that I tried and both times I had to modify the code to get it to work. Hopefully this might help anyone else that might be getting the same error.