Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / January 2007



Tip: Looking for answers? Try searching our database.

How do you create a database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jfuentes12 - 29 Jan 2007 07:34 GMT
How do I create a database? I have microsoft access installed but I read
somewhere that, if possible, it is better to use some other program to build a
database (something about if I use access then it uses my computer as opposed
to my webhosted database).

I have also installed microsoft server express 2005 or whatever it is called.
I have bought the book Sams teach yourself SQL in 10 mins. It is easy enough to
understand but it is teaching sql language to make use of the database, but I
don't know how to create a database....

Please tell me if it is ok to use access and if there is any book specifically
about building databases or something like that.

Is there any way to create databases in access, upload them to the webhost
that I am using ..... will that work? Please let me know how it all ties in
together..
A3gis - 29 Jan 2007 11:27 GMT
pheeeeeeew that one's a minefield man. Access... where do you start? I'm sure
they've changed it since I started in this game but it used to have major
issues with having more than 5 users accessing it concurrently. I believe it
still suffers from the problem of opening the database directly while your CF
app tries to use it - Access locks the database file so only that user can
view/edit/whatever at that point in time.

used to have an issue where updating the access file in your development
environment, if you then went and re-uploaded it to the live server, you had to
recreate the ODBC connection. (probably not such an issue now as I think CF's
inbuilt dsn management stuff makes that easier (someone correct me if i'm wrong
there!))

Ideally, for a database you're learning with, look into something like MySQL -
it's free, easy to install, the DB tools are relatively straightforward and
there's some nice free tools for it. Heaps of docos at www.mysql.org . Be aware
though, that whichever database you use, they all have their own extra little
commands within their SQL implementations - so if you switch databases mid
project for whatever reason this may be something you need to be aware of.

But as to the process of creating a database - most DB tools nowadays are
roughly the same:
1) filemenu (or somewhere like that) there should be a Create Database option
- click it and follow the prompts, naming your database etc NOTE: WHATEVER
DATABASE YOU USE, SEARCH GOOGLE FOR A LIST OF RESTRICTED WORDS THAT MAY NOT BE
USED IN DATABASE/TABLE/COLUMN/VIEW/TRIGGER/etc naming - also no spaces in
names, only punctuation you should use is underscore.

2) if you were not prompted to create a user account for the database - do so
now, usually there will be a USERS option somewhere near where the new database
shows in your interface (assuming you arent doing this over command line).
create a new user - name it whatever (remember point about naming above) - give
it a password - remember these details, you'll need them for the CF
Administrator's datasource setup. assign the user to the new database (usually
in the user creation process but sometimes you're required to go back to the
database itself and find a users section in it's options) - assign the user
whatever permissions you need - read, write, delete, update, whatever.

3) open the database up and add a new table to it, name it whatever -you
should be taken to the point where you create columns at this stage - give your
table an ID column - numeric/int - autoincrement - and set it to primary key...
from here on  create whatever columns you need, reference your chosen
database's docos for descriptions of the column datatypes and assess them to
see which ones meet your needs.

note, some of the above bits may be arse-about depending on your DB/toolset.

Cheers
A3gis - 29 Jan 2007 11:30 GMT
ergh that'll learn me to read your ENTIRE POST before replying...

you can create in access yes. get a book from the o'reilly family if someone
else doesnt suggest something better. Uploading the database will depend on
your webhost - as the ODBC connection will likely need to be recreated each
time you do this.
LL@Work - 29 Jan 2007 14:06 GMT
Please see this TechNote: http://www.adobe.com/go/tn_17034
tclaremont - 29 Jan 2007 15:02 GMT
If you are THAT new to creating databases, I would like to suggest that you
avoid Access altogether. Start with MySQL or SQL Server. The reason I say this
is because once you are up and running with Access, you will no doubt want to
move to a more capable database anyway. Not only that, but some of the stuff
you learn for Access will contradict or at least confuse you with regards to
SQL databases.

Access is a desktop database, and not intended for multiple-use situations,
even though you can "get by" with it in some cases.

It is just not a good idea.
Dan Bracuk - 29 Jan 2007 15:04 GMT
If your sql book does not say much about data modelling, or how to design a
database, you really want more reference material.  If you google "data
modelling" or "database normalization", you should find an online tutorial.
Dinghus - 29 Jan 2007 18:59 GMT
Hmmmm. I hate to intrude with a reality check but when you use Access in a web
environment you only have ONE connection, not muliple like when it is being
used as an application itself.

Access is a nice way for newbies and small websites to have a database that is
easy to create and manage.  It does NOT require redoing the ODBC everytime you
reload it. (where does this stuff come from?)

The nice thing is that a person can create the whole thing, test it, and then
upload it right on their local computer without going thru cumbersome
interfaces.

That being said, if you are looking for power etc then go with MS SQL.  I
highly recommend against MySQL. It has some flaws and lacks some features that
will drive you nuts.  Of course MSSQL will probably cost you some  extra on
your host, but yo could use godaddy where it won't.
A3gis - 29 Jan 2007 23:20 GMT
[q][i]Originally posted by: [b][b]Dinghus[/b][/b][/i]
Access is a nice way for newbies and small websites to have a database that is
easy to create and manage.  It does NOT require redoing the ODBC everytime you
reload it. (where does this stuff come from?)
[/q]

as i said in my post, it was years ago I used Access - it USED to require the
ODBC connection be recreated in the ODBC control panel - this was before CF
handled that side of things for you, and I've not used Access since. At that
time we were using it for ASP and CF training and everytime a student/trainer
modified one of the DBs and handed it to us to reupload to the server, the
connection HAD to be recreated or it broke.

[q][i]Originally posted by: [b][b]Dinghus[/b][/b][/i]
That being said, if you are looking for power etc then go with MS SQL. I
highly recommend against MySQL. It has some flaws and lacks some features that
will drive you nuts. Of course MSSQL will probably cost you some extra on your
host, but yo could use godaddy where it won't.[/q]

Just out of curiosity, which lacking features and flaws are you talking about
here with MySQL (PS: not trying to get into a mysql v mssql debate) - we use
both DBs extensively here and I know we dont do much more with the two apart
from treat them as flat files, far from ideal, but what are the main lacking
features? so far my only issue between the two DBs is mssql's lack of a decent
equivalent to mysql's LIMIT clause.
Jfuentes12 - 30 Jan 2007 06:28 GMT
Thanks for all of the replies everyone. I am trying to use "SQL Server
Management Studio Express"... That should work right? I opened the program,
right clicked on "databases" and selected "New Database".

I then named the database "agents" as I am creating this for a training
website for insurance agents. That is about how far I got.

Forum poster "Dan Bracuk" recommended  the following:

"If your sql book does not say much about data modelling, or how to design a
database, you really want more reference material. If you google "data
modelling" or "database normalization", you should find an online tutorial."

Is that the best and easiest advice on creating and managing databases? I am
learning SQL which seems easy enough, it is just the database creation &
management that is giving me trouble. What is the fastest way to learn that? I
don't need to know all of the major intricacies just basic stuff.

Please let me know if mssql server express is ok to use, and or if anyone
knows a website or book that has a very easy explanation of creating and
managing databases... Thank you very much.
Dinghus - 30 Jan 2007 17:30 GMT
Jfuentes12, you won't learn db design or the such from a 10 minute book.  You
need some hard core books to do so. One of the best books to start with when it
comes to db design is
http://www.amazon.com/gp/product/0201752840?ie=UTF8&tag=donomite-20&linkCode=as2
&camp=1789&creative=9325&creativeASIN=0201752840

Learn to create solid databases from the ground up and you will be saved many
headaches later on.  Then find a good book on writing queries.
Dan Bracuk - 31 Jan 2007 04:06 GMT
[q][i]Originally posted by: [b][b]Jfuentes12[/b][/b][/i]
Forum poster "Dan Bracuk" recommended  the following:

"If your sql book does not say much about data modelling, or how to design a
database, you really want more reference material. If you google "data
modelling" or "database normalization", you should find an online tutorial."

Is that the best and easiest advice on creating and managing databases?[/q]
Yes.  You have to know what to create before you create it.
tclaremont - 29 Jan 2007 19:46 GMT
There is more than one connection to an Access database if you have someone opening the database in Access at the same time a web user is accessing the database through CF.
tclaremont - 30 Jan 2007 14:26 GMT
There are people dedicating their careers to database creation and
administration. "Teach yourself SQL in 10 minutes" is not going to teach you
everything you need to know.

It is entirely possible to set up a lousy, poorly performing database that
will work with ColdFusion in a matter of minutes. It is quite another project
if you want it to be fast, reliable, and easily maintainable.

You will get out of it what  you put into it. How good do you want it to be?
Dinghus - 30 Jan 2007 17:21 GMT
What I've run into is things like embedded queries don't work, tho somebody
told me that was fixed in the newest version.  Just doesn't meet ANSI
standards.  Time after time simple queries that are doable in even Access won't
work in MySQL.    Of course from what I understand now v5 has fixed a lot of
the problems and even has some limited stored procedure ability but that still
has a ways to go too it seems.

Anyway, when you say that you have to recreate the ODBC connection, what do
you mean? You mean like in ASP, .NET etc etc where you have to open a
connection to the db everytime you want to use it but in CF you don't have to
do that?

I've used CF since v4 and many people were using Access for dbs because it was
the easiest thing to use at the time and never had any trouble with the ODBC
needing to be redone everytime the db was reloaded.  I can't even see any
reason for it unless you changed the name or path.  I think you had a bug or
something for that to happen.
A3gis - 31 Jan 2007 01:02 GMT
[q][i]Originally posted by: [b][b]Dinghus[/b][/b][/i]
Anyway, when you say that you have to recreate the ODBC connection, what do
you mean? You mean like in ASP, .NET etc etc where you have to open a
connection to the db everytime you want to use it but in CF you don't have to
do that?

I've used CF since v4 and many people were using Access for dbs because it was
the easiest thing to use at the time and never had any trouble with the ODBC
needing to be redone everytime the db was reloaded.  I can't even see any
reason for it unless you changed the name or path.  I think you had a bug or
something for that to happen.[/q]

Ditto on using CF since version 4 - but the issue was definately there, and
not with deleteing the access DB first, just doing overwrites - it could've
been a bug, after all i setup the NT server it was all running on... and I'd
been a mac-user only for the 10 years prior =)

PS: sorry for hijacking your thread Jfuentes!
tclaremont - 30 Jan 2007 17:30 GMT
I think I vaguely remember having to recreate the ODBC connection if you did
something like the following:

Say you have an Access database in use with a hosting provider.

You have a local copy of the database that you make some changes to.

You now want to replace the host copy with your local copy.

If you DELETE the host copy, and then UPLOAD your local copy, you THEN need to
recreate the datasource.

This is going back many years at this point. Does that ring a bell with
anyone???
Sabaidee - 30 Jan 2007 17:35 GMT
[q][i]Originally posted by: [b][b]tclaremont[/b][/b][/i]
...
If you DELETE the host copy, and then UPLOAD your local copy, you THEN need to
recreate the datasource.
This is going back many years at this point. Does that ring a bell with
anyone???[/q]

I vaguely remember something like that, though I think since CF6.1 even that
did not call for re-creation of ODBC connections...
tclaremont - 30 Jan 2007 18:16 GMT
I made the mistake of NOT getting a solid foundation in database design before
developing a lot of my sites. I have regretted it many times over.

At this point I grab every opportunity to build on my database design skills.

And now, thanks to Dinghus, I just bought the book he mentions above, for 8.50
on Amazon (used).

Even if I look throught it once a month it has to be worth $8.50!!!
Dinghus - 31 Jan 2007 22:11 GMT
Actually let me back up. If you DELETE your database you remove the ODBC
connection also.  If you just overwrite the db then you don't.  But then there
is normally no need or reason to DELETE a db before uploading the new version.  
Especially if it is a live db.  You could lose data that way.

Of course I have seen dbs that were so messed up that deleting them was the
kindest thing I could do for them.  Put them out of their misery.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.