J
JimmyKoolPantz
IDE: Visual Studio 2005
Language: VB.NET
Fox Pro Driver Version: 9.0.0.3504
Problem: I currently have a problem altering a DBF file. I do not get
any syntax errors when running the program. However, after I alter the
table and open microsoft excel to look at any changes; I get the
following error: "This file is not in a recognizable format" If I do
open the file in excel it looks like its not formatted.
Further Information: I am not sure if I need to pack the DBF after
altering it (add a column), however, I did pack it to see if it would
solve my problem but that did not work.
Why am I trying to view the file in microsoft excel?
More than likely the user will be periodically open the DBF in excel
for viewing.
Code: (note I did not paste all the code just code I felt was needed)
cs = "Provider=VFPOLEDB.1;Data Source=" + FilePath + ";Mode=Share Deny
None;Extended Properties="""";Exclusive=ON"
qy = "Alter Table " + fname + " ADD MILES INT NULL"
Public Sub UpdateDBF(ByVal FilePath As String, ByVal qy As String,
ByVal FileExt As String)
Dim cs As String
Dim cn As OleDbConnection
Dim dc As OleDbCommand
cs = Connection_String(FilePath, FileExt)
cn = New OleDbConnection(cs)
cn.Open()
dc = New OleDbCommand(qy, cn)
dc.ExecuteNonQuery()
cn.Close()
End Sub
Language: VB.NET
Fox Pro Driver Version: 9.0.0.3504
Problem: I currently have a problem altering a DBF file. I do not get
any syntax errors when running the program. However, after I alter the
table and open microsoft excel to look at any changes; I get the
following error: "This file is not in a recognizable format" If I do
open the file in excel it looks like its not formatted.
Further Information: I am not sure if I need to pack the DBF after
altering it (add a column), however, I did pack it to see if it would
solve my problem but that did not work.
Why am I trying to view the file in microsoft excel?
More than likely the user will be periodically open the DBF in excel
for viewing.
Code: (note I did not paste all the code just code I felt was needed)
cs = "Provider=VFPOLEDB.1;Data Source=" + FilePath + ";Mode=Share Deny
None;Extended Properties="""";Exclusive=ON"
qy = "Alter Table " + fname + " ADD MILES INT NULL"
Public Sub UpdateDBF(ByVal FilePath As String, ByVal qy As String,
ByVal FileExt As String)
Dim cs As String
Dim cn As OleDbConnection
Dim dc As OleDbCommand
cs = Connection_String(FilePath, FileExt)
cn = New OleDbConnection(cs)
cn.Open()
dc = New OleDbCommand(qy, cn)
dc.ExecuteNonQuery()
cn.Close()
End Sub