I want to create a table (.DBF file) with an Integer(4) field using Microsoft Jet dBase Provider. There is my code :
Dim conn As New OleDb.OleDbConnection
Dim comm As New OleDb.OleDbCommand
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DBFSamples;Extended Properties=dBASE 5.0;"
conn.Open()
comm.Connection = conn
comm.CommandType = CommandType.Text
'First Solution
comm.CommandText = "Create table Test8(FirstName Integer,LastName Char(50) )"
'Second Solution
'comm.CommandText = "Create table Test10(FirstName Numeric(4,0),LastName Char(50) )"
comm.ExecuteNonQuery()
conn.Close()
MessageBox.Show("OK")
This code creates the FirstName field Numeric(20,5) with the First Solution and Numeric(20,0) with the Second Solution. Is there another solution?