Programmatically create a dbf database...

How to create a dbf file, programmatically?
LVL 15
JackOfPHAsked:
Who is Participating?
 
JackOfPHConnect With a Mentor Author Commented:
0
 
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
tusharkanvindeCommented:
Are you using VFP or are you using .NET as your front end?

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

All Courses

From novice to tech pro — start learning today.