1
votes

I'm trying to create database files using Visual FoxPro OLE DB driver 9.0. The code below generates the .DBF file but I was assuming that it should create a .FPT memo file as well which it doesn't. Please advise as what is missing in the code.

`string connectionString = @"Provider=VFPOLEDB.1;Data Source=C:\Temp;Extended Properties = FoxPro 9.0";
        using (OleDbConnection connection = new OleDbConnection(connectionString))
        {
            using (OleDbCommand command = connection.CreateCommand())
            {
                connection.Open();

                command.CommandText = "CREATE TABLE TestTest (Id Integer, Name Varchar(100))";
                command.ExecuteNonQuery();`
1

1 Answers

4
votes

VARCHAR fields don't result in a .FPT file being created. Only the field types Memo, Blob and General (M, W and G respectively) will; they are truly variable-size fields. Varchar is still considered a fixed-width type in that the maximum size is physically present in every record.