Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DBF

Posted on 2004-10-21
5
Medium Priority
?
482 Views
Last Modified: 2010-04-04
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..
0
Comment
Question by:Kristao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 11

Expert Comment

by:calinutz
ID: 12369842
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
 

Accepted Solution

by:
DynamicMonsieur earned 120 total points
ID: 12370134
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
 
LVL 1

Author Comment

by:Kristao
ID: 12370570
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
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12372216
> 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
 
LVL 1

Author Comment

by:Kristao
ID: 12431055
i'm creating that programm :P
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question