Quantcast
Channel: Forums - Geoprocessing
Viewing all articles
Browse latest Browse all 1751

Programming ArcObject with VBA

$
0
0
Hi all
Everyone can explain this code for me clearly :
I'm trying to select records from the attribute table of a FeatureClass but I get this error when I run this code.
" The Database was not found"
The error point to this line of code : Set pTable = pName.Open
Why I get error at this line?

' Part 1: Define the table.
Dim pWSName As IWorkspaceName
Dim pDatasetName As IDatasetName
Dim pName As IName
Dim pTable As ITable

' Get the dbf file.
Set pWSName = New WorkspaceName
pWSName.WorkspaceFactoryProgID = "esriCore.ShapefileWorkspaceFactory.1"
pWSName.PathName = "d:\LaptrinhGis\Phuhoa\nen\nha_25750"

Set pDatasetName = New TableName
pDatasetName.Name = "phong.dbf"
Set pDatasetName.WorkspaceName = pWSName
Set pName = pDatasetName

' Open the dbf table.
Set pTable = pName.Open

Viewing all articles
Browse latest Browse all 1751

Trending Articles