VB6 - DBF - External Table is not in the expected format.
Posted on 2007-10-17
I needed to add a column to an existing table thru some SQL and that seems to work just fine.
Here is how I added the column:
Set updateConn = New ADODB.Connection
updateConn.ConnectionString = "Provider=vfpoledb;" & _
"Data Source=C:\DataFiles\;" & _
"Mode=ReadWrite;" & _
I then execute the following SQL:
updateConn.Execute "ALTER TABLE SHDIV ADD COLUMN State1TI Numeric(10,4) NULL;"
The column appears to be created correctly, and if I do lookups via the Ole driver everything seems to work just fine. My problem is there is another program that will also use this dbf file (not at the same time) and this other program is using the Jet Driver. And when it tries to read that table it gets an error: "External Table is not in the expected format." Unfortunatly switching this other program over to use the Ole driver is probably not an option.
The only other weird thing is that when I do view the newly modified table in a program called DBF Viewer 2000 I can see my new field, but there is an additional column that got created "_NullFlags" of type Memo. I do not see that field when I'm looking at the Field.Columns.Name though. Weird huh?