Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a dbf table and I wish to automatically create another dbf table with a different name but with exactly the same structure i.e.fields as the existing table. Is there any ready code in VBA and ArcObjects for that? Thanks

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

A non ArcObject option within VBA would be to simply use the VB FileCopy function.

FileCopy "C:\Temp\Join_Output.dbf", "C:\Temp\Join_Output2.dbf"

share|improve this answer
    
Wouldn't this copy the data? I'm not sure Demetris wants to do that (he was unclear, though). –  Nathanus Jun 17 '11 at 15:31
2  
Might sound long handed, but wouldn't it be better to simply copy the whole data across and then delete it all? –  Hairy Jun 17 '11 at 17:14
    
No, I do not want to copy the data; only the structure i.e. fields. Does the FileCopy function copy the data as well? –  Demetris Jun 17 '11 at 20:16
add comment

I would expect that accessing the Create Table tool from IGeoProcessor2 factory might do exactly what you wish, as Create Table allows for a template table. You can find out more about executing GP tools here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.