Board index » delphi » Create a new database

Create a new database

Hello
I am an old clipper programmer that I am learning how to program in
Delphi to develop databases applications.I chose Delphi because I
believe that it is a very good product and also because I trust the
Borland programs.
I am programming with the version 4 (Professional).
Up to now all goes well but I found my first problem when wanting to
create a database. All the books that I prepare try as already managing
databases created but none tells me as, with which and where to create
them.
I need to make a simple program. To create a database and can make it
discharges, drops and modifications. My only problem (for the time
being) it is as to create the database and to tie it to the TEdit.
In clipper it would create the database with dBase or DBU and then it
would use it with
USE mydata NEW
As it would create it in Delphi.? With the Databese Explorer, Database
Desktop??
If somebody can help me I will thank it a lot.
And if somebody needs something of Clipper with pleasure I would help
him
Luis Taballione
ldt...@satlink.com

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 

Re:Create a new database


On Wed, 26 Jan 2000 09:33:58 -0800, Luis Daniel Taballione

Quote
<ldtabaNOldS...@satlink.com.invalid> wrote:
>Hello
>I am an old clipper programmer that I am learning how to program in
>Delphi to develop databases applications.I chose Delphi because I
>believe that it is a very good product and also because I trust the
>Borland programs.
>I am programming with the version 4 (Professional).
>Up to now all goes well but I found my first problem when wanting to
>create a database. All the books that I prepare try as already managing
>databases created but none tells me as, with which and where to create
>them.
>I need to make a simple program. To create a database and can make it
>discharges, drops and modifications. My only problem (for the time
>being) it is as to create the database and to tie it to the TEdit.
>In clipper it would create the database with dBase or DBU and then it
>would use it with
>USE mydata NEW
>As it would create it in Delphi.? With the Databese Explorer, Database
>Desktop??
>If somebody can help me I will thank it a lot.
>And if somebody needs something of Clipper with pleasure I would help
>him
>Luis Taballione
>ldt...@satlink.com

>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
>The fastest and easiest way to search and participate in Usenet - Free!

Hallo, I am also an "old" (34) dbase programmer and I have (had) the
same the problems like you. BTW: Im living in Germany.

I have learned to understand (or I think I did so) how to create a
database. There are some completely different ways of thinking in
dbase/Clipper and delphi. It was very easy to create db in dbase and
work with them with "select" and "Use". You will miss it...

First you have to create an Alias with the BCE-Config-Programm in
Systemcontrol (Windows). Set the Name, Path and Database type.
Save it.
Then use Database desktop (in Germany its called "database surface".)
and create your database...(New/Table)

In your own Application Form, you have to place tables and datasources
and define their properties... Its very complex - when you are doing
it for the first time. second time it will be simpler...

Thats all for now...

Tino Bellmann

Re:Create a new database


Quote
Tino Bellmann wrote:
> I have learned to understand (or I think I did so) how to create a
> database. There are some completely different ways of thinking in
> dbase/Clipper and delphi. It was very easy to create db in dbase and
> work with them with "select" and "Use". You will miss it...

> First you have to create an Alias with the BCE-Config-Programm in
> Systemcontrol (Windows). Set the Name, Path and Database type.
> Save it.

Wait-- I hear "help" like this all the time.  "first you..." then some bizarre
thing that makes no sense when I attempt it.  What is the "BCE Config Programm"
in Windows?  In Control Panel?  Do you mean the BDE Program?

The other day, someone said on the newsgroup: that's easy, just configure the
native oracle driver.  So I rushed to my computer, called up the menu he
described, and there IS NO ORACLE driver.  Now what?

Re:Create a new database


On Wed, 26 Jan 2000 09:33:58 -0800, Luis Daniel Taballione

Quote
<ldtabaNOldS...@satlink.com.invalid> wrote:
>I am an old clipper programmer that I am learning how to program in
>Delphi to develop databases applications.I chose Delphi because I
>believe that it is a very good product and also because I trust the
>Borland programs.

[...]

One way to programmatically create a table is with the TTable.CreateTable
method. See the online help topic for this method. It has a fairly
comprehensive source example.

Another way is with the local SQL statement CREATE TABLE, executed from a
TQuery. Local SQL (the SQL implementation the BDE uses for dBASE, Paradox,
and FoxPro tables) is documented in the online help file LOCALSQL.HLP,
found in the main BDE directory. This help file is a language reference of
the local SQL implementation (subset) of SQL-92. The copy of this file that
came with BDE 4.x (and earlier versions) was seriously out of date and
contained little useful information. It has since been rewritten. It has
been updated again concurrent with C++Builder 5. Updated copies will have
the topic "VIEWs" in the index (and lack of this topic indicates a
pre-update copy). I can e-mail you a copy of the updated file if you need
and desire it.

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx

Re:Create a new database


Hello,
creating a database first time in Delphi/dBase is more complex than in the
dBase language.
Once you have done the steps required and learned how to, it is more
flexible to work with and far beyond the limits of the dBase script
language.
The BDE program is shipped with your Delphi CD-rom, if you have not already
installed it.
This program can create a new table and then add indexes to it.  Select
Working Directory and type your directory for data.
I have found it useful to create one directory for the project, and inside
it - one for the data and one for the units.
By using the Working Directory in BDE program you don't have to move to your
data directory every time you start BDE.

In DBE program : Create dBase tables in your MyProject\data directory. Then
add indexes.
In Delphi program :
1. Create your new project in your MyProject\units directory.
2. Create a new datamodule. This is a special form containing your table and
datasource icons. Useful when the program is crowded by tables.
3. Drop one table icon and one datasource icon on this form.
4. Select the table icon and fill in databasename (The full path of your
projects data directory, or an alias for the path) Then select your newly
created table in the Tablename property.
5. Select the Table Icons name in the datasource icon's property. Then set
the Table icons Active property to true.
Now you have the connection to your table. In your main form, add your
datamodule name to the uses clause. Then your DBEdits can see your data.

The clue is:
The Table icon sees your physical table and distribute it's data through the
datasource icon.
Now we are at the point: Your DBEdit retrieves its data from the datasource
icon, and put changes back in.
In table icon you also select one of the indexes you created previously.

The complex chain of
Physical Table -> Table icon -> DataSource icon -> DBEdit
may seem horrible, but is really useful when program grows and a lot of
connections are to be maintained.

This was from the top of my head, ask if something was foggy.

BTW, if you are familiar with dBase language, it can be used when creating
more complex expression indexes. (More than one field, and with range
settings etc)
This is why I always use dBase tables. Then I can tweedle the indexes as I
want to.

--
Kind regards
Kai Inge

{The limit of my Delphi
is my lack of knowledge}

Quote
Luis Daniel Taballione wrote in message

<01d9cd66.a8dfd...@usw-ex0103-023.remarq.com>...
Quote
>Hello
>I am an old clipper programmer that I am learning how to program in
>Delphi to develop databases applications.I chose Delphi because I
>believe that it is a very good product and also because I trust the
>Borland programs.
>I am programming with the version 4 (Professional).
>Up to now all goes well but I found my first problem when wanting to
>create a database. All the books that I prepare try as already managing
>databases created but none tells me as, with which and where to create
>them.
>I need to make a simple program. To create a database and can make it
>discharges, drops and modifications. My only problem (for the time
>being) it is as to create the database and to tie it to the TEdit.
>In clipper it would create the database with dBase or DBU and then it
>would use it with
>USE mydata NEW
>As it would create it in Delphi.? With the Databese Explorer, Database
>Desktop??
>If somebody can help me I will thank it a lot.
>And if somebody needs something of Clipper with pleasure I would help
>him
>Luis Taballione
>ldt...@satlink.com

>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
>The fastest and easiest way to search and participate in Usenet - Free!

Re:Create a new database


Quote
>Wait-- I hear "help" like this all the time.  "first you..." then some bizarre
>thing that makes no sense when I attempt it.  What is the "BCE Config Programm"
>in Windows?  In Control Panel?  Do you mean the BDE Program?

>The other day, someone said on the newsgroup: that's easy, just configure the
>native oracle driver.  So I rushed to my computer, called up the menu he
>described, and there IS NO ORACLE driver.  Now what?

Hello Mr. Van Dyk,

its not so easy to help somebody who speaks another language, has
other Software versions (My software  an OS is completely in
german)... and dont know how much to write is enough. But, BCE is
really a mistake (fingers are too big for one key...) ;-)

And: Please show me where I wrote it would be easy... my message was
completely different...

The first time I wanted to create databases, I gave up and bought a
book... But this is not the sense of a newsgroup...

Greetings from the ore mountains,

Tino Bellmann

Other Threads