I need to change the width of a .dbf char field but if someone knows how to create it I think I could adapt.
protected void CreateDbf()
{
using (var dBaseConnection = new OdbcConnection(@"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=C:\users\desenv\desktop"))
{
dBaseConnection.Open();
string str0 = "Create Table FUNCTES (CODCRA char(400), REGFUN char(6), NOMFUN char(30), DTANAS date, STATUS logical, DESCRI memo)";
var cmd = new OdbcCommand(str0, dBaseConnection);
cmd.ExecuteNonQuery();
dBaseConnection.Close();
}
}
And it gives me this ERROR:
ERROR [42000] [Microsoft][Driver ODBC para dBase] O tamanho do campo 'CODCRA' é muito longo.
Translating the last part .. "The size of the field 'CODCRA' is too large."
I've already tried to use other Providers and Drivers to generate the file but it didn't work.
So if someone could help me I would be very pleased.
I know that this is possible in Clipper by using the function DBCREATE()