Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to append field to dbf file?

0 views
Skip to first unread message

Alan Cowan

unread,
Jun 29, 1998, 3:00:00 AM6/29/98
to

I am trying to append new fields onto an existing dbf file but get an error
stating the operation is not supported on a table that contains data. Is
the append method valid for populated dbf files? Any other methods?

VB Booksonline states that the append method is valid if tabledef.updatable
is True and only for Jet workspaces. I believe I am meeting both of these
requirements. Following is my test code.

Private Sub Command1_Click()

Dim dbfDb As Database
Dim dbfTabDef As TableDef
Dim wrkJet As Workspace

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbfDb = wrkJet.OpenDatabase("c:\vb_temps\", True, False, "dBASE
IV; ")

For Each dbfTabDef In dbfDb.TableDefs
If dbfTabDef.Name = "testApp" Then
Debug.Print "found the app"
Debug.Print "table def updateable: "; dbfTabDef.Updatable
dbfTabDef.Fields.Append dbfTabDef.CreateField("test",
dbInteger)
End If
Next

dbfDb.Close
wrkJet.Close

End Sub

Samuel

unread,
Jun 30, 1998, 3:00:00 AM6/30/98
to

How about using dBase or FoxPro? Even DOS version would do this well. :-)

Alan Cowan wrote in message <5RPl1.905$r73.9...@news.teleport.com>...

0 new messages