Programmatically create a dbf database...

How to create a dbf file, programmatically?
LVL 15
JackOfPHAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

tusharkanvindeCommented:
check out the CREATE TABLE command

CREATE TABLE TableName (SomeField AutoInc, SomeOtherField C(40), .....)
0
JackOfPHAuthor Commented:
Can you elaborate what you mean?
0
tusharkanvindeCommented:
Are you using VFP or are you using .NET as your front end?

0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
To create a database:
CREATE DATABASE [DatabaseName | ?]

To create a table in the database:
CREATE TABLE | DBF TableName1 [NAME LongTableName] [FREE]
    [CODEPAGE = nCodePage]
    ( FieldName1 FieldType [( nFieldWidth [, nPrecision] )] [NULL | NOT NULL]
    [CHECK lExpression1 [ERROR cMessageText1]]
    [AUTOINC [NEXTVALUE NextValue [STEP StepValue]]] [DEFAULT eExpression1]
    [PRIMARY KEY | UNIQUE [COLLATE cCollateSequence]]
    [REFERENCES TableName2 [TAG TagName1]] [NOCPTRANS]
    [, FieldName2 ... ]
    [, PRIMARY KEY eExpression2 TAG TagName2 |, UNIQUE eExpression3 TAG TagName3
    [COLLATE cCollateSequence]]
    [, FOREIGN KEY eExpression4 TAG TagName4 [NODUP]
    [COLLATE cCollateSequence]
    REFERENCES TableName3 [TAG TagName5]] [, CHECK lExpression2 [ERROR cMessageText2]] )
    | FROM ARRAY ArrayName

You can create a table without creating a database and it will be detached.

These are from the Help in FoxPro.
0
JackOfPHAuthor Commented:
so I  will just execute this query and then the dbf are created?
0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
CREATE TABLE Mytable (strngfield C(10), datefield D, memofield M, numfield N(10,2), ...)
INDEX ON datefield TAG datefield
INDEX ON strngfield TAG strngfield

This is how you create a table and index it from within FoxPro.

If you are doing it from .Net I don't know how. But I don't under why you would use a tool like .Net if you have FoxPro :-D.
0
JackOfPHAuthor Commented:
I don't have fox pro installed... My client just requires us that instead of the output textfile, the output is in foxpro.

But I don't under why you would use a tool like .Net if you have FoxPro
0
JackOfPHAuthor Commented:
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
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
With FoxPro you can manipulate data much easier than in .Net. That's why I said better in FoxPro than in .Net.
0
JackOfPHAuthor Commented:
@ramrom,

Hey! Watch your word! I tried to be specific in my question...

And I am not wasting YOUR VALUABLE TIME EITHER!!!
0
JackOfPHAuthor Commented:
@ramrom,

Also note, does finding the answer to my own questions, is a form of wasting Your precious time? or the time of the experts here?

I don't think so...

Jack
0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
Jack, it was not clear what you exactly wanted. Your question can be answered in so many different ways.

Also there is a difference between a query and a command.
0
JackOfPHAuthor Commented:
If the question is unclear then you can ask the author to clarify things... right?

I myself while answering other questions, if the question is unclear then I will ask the author to further explain the question so that me, and other experts here in this site, can help the author determine or find the answer appropriate for him or her.

The experts that participated in this thread never ask for any clarification, that is why I thought that my question is very clear.

>>That delays your getting the answer you want and wastes our time.

I just disappointed about ramrom, commented about wasting the time of experts here...

As a site administrator you should not commented that way!!!

Does his action is right by saying that I just waste the time of the experts here?



0
JackOfPHAuthor Commented:
***Note***

In almost nine years of using experts-exchange, I never had any intention to waste the time of those who wants to participate or help me find the answer to my question...

0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
You can see that I was trying to answer your questions as much as I understood them.

You should have mentioned you don't have FoxPro installed and if you were trying to create database or a free table dbf. In the past a table was called database.

Anyway, what has happened has happened :-)
0
JackOfPHAuthor Commented:
ok, but please, next time, don't put this line again...

>>That delays your getting the answer you want and wastes our time.

Note:

1.) ASK for clarification if the question is not clear.
2.) Even if you are moderator or an administrator, you should never use foul words because you might drive away a person for asking questions again.
 

0
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
Well Jack, there are a few Experts who got tired from certain askers and I for one refuse to answer two askers because they are never clear and they never treat us fairly. Some of these Experts stopped their activity on EE if you have noticed. I understand ramrom. He did not use foul words.

He is just saying when you don't write your answer clearly, you will delay getting your answer and wasting our time and yours. Don't take it personally :-).
0
JackOfPHAuthor Commented:

I am only trying to say that you should be careful what you post...

because he post

>>That delays your getting the answer you want and wastes our time.

and not what you have said:

"you will delay getting your answer and wasting our time and yours"
0
ramromconsultant Commented:
No one is questioning your intentions. No one is saying "you waste our time".

I am just asking you to give enough information so we know how to answer.

I am sorry that my comments were upsetting for you. That was not my intention.

You say "The experts that participated in this thread never ask for any clarification"

tusharkanvinde attempted to obtain more information from you by asking "Are you using VFP or are you using .NET as your front end?" That was a request for clarification! Perhaps it would have been better if he had asked "What are you using as your front end?" or "What are you programing in?"

It appears that you are using VB. Had you stated so initially or in response to tusharkanvinde's query we could have given you the answer quickly.

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
.NET Programming

From novice to tech pro — start learning today.