DBF

Heeeeelow :)

i'm creating and connecting to DBF files

Here is my problem when i open created file colum name is interesting XCOLUMNAME_ why there is 'X' and '_'

my coneection string
Provider=MSDASQL.1;Persist Security Info=False;Data Source=dBASE Files;Initial Catalog=C:\TEMP

i thout it is ADO who dousn't understand DBF file, but when i open it with MSExcel or DateBase desktop its the same XCOLUMNAME_

thx..
LVL 1
KristaoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

calinutzCommented:
my dbf files do not look like that when I open them with Excel. The column names are ok.
What version of Fox did you use to create the dbf?
0
DynamicMonsieurCommented:
Hi,

Could you tell, how do you create these files?
I suggest you to use BDE componets to create
and access to DBF files:

Add these components to your form or data module:

Database: TDatabase;
Query: TQuery;

Procedure CreateDBF(FilePath, FileName: string);
Begin
  Database.Params.Add('PATH=' + FilePath);
  Database.DatabaseName := 'AnyName';
  Database.Connected := True;
 
  Query.DatabaseName := 'AnyName';
  Query.SQL.ADD('CREATE TABLE "FileName" (Column1Name DataType1, ColumnName2 DataType2, [ColumnNameN DataTypeN)');
  Try
    Query.ExecSQL;
  Except
    ShowMessage('File probably already exists');
  End;
End;

Procedure CallFileCreation;
Begin
  CreateDBF('C:\Temp', 'anyfile.dbf');
end;

If you don't know, how to access to DBF files, I could help you.
Just let me know.

Bye
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KristaoAuthor Commented:
ADO is much better than DBE and DBE needs to have instalation pack to run it on some other computer :|.

Hey calinutz what did u wrote in connection string? and how did u made expresion to make DBF file with ADO?

this is what i wrote in adoquery

CREATE TABLE 321.DBF
(
'3' VarChar (25)
)



0
Wim ten BrinkSelf-employed developerCommented:
> i thout it is ADO who dousn't understand DBF file, but when i open it with MSExcel or DateBase desktop its the same XCOLUMNAME_

Well, let me say something simple to you... The field is just called XCOLUMNAME_ so ask the person who created that table why he did it. He must have had some reason for it. It's not a bug.

And one more thing... Fieldnames CANNOT be numeric values! Change it to:

CREATE TABLE 321.DBF
(
'F3' VarChar (25)
)

Fieldnames cannot start with a number and neither can they be numeric... And there are a few other limitations too.
0
KristaoAuthor Commented:
i'm creating that programm :P
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.