A beginner tutorial describing from beginning to end how to set up a three page website with a dynamic contact list combined with a detail page, the finished project is included for study.
This tutorial covers: Defining the site, building a page and copying it, setting up a quick Database, creating the connection, using the dynamic data and creating a detail page in full detail, no live objects here.
This tutorial is compatible with Dreamweaver MX, in MX the databindings panel is upgraded to what is now the Application panel.
Building a basic
site with Contact page
Part 2: Setting
up the database
Ok, so now we have
all three pages, but where do we store the employee info ?
We use databases for that, in this example I use MS-Access '97, so let's start
her up.
Creating the
database for our needs:
It comes up asking if we want to create a new one, use the wizard to make a
new one or open a existing one. We are making a new empty database, we give
it a name and remember where we save it, eventually this will end up in our
Data folder we created earlier...
So, now we have
a empty database, that isn't going to be much usefull so we create a new table,
we want to do this in design view so select that option in the menu that pops
up. Now comes the real heart of our page, what info do we want to display and
do we want a option so that people can visit a more detailed info page ?
In this case we
keep it simple... we want the following fields:
FirstName
LastName
Department
Position
EmailAdress
These are all text
fields, i always set the text field options to 255 characters and zero length
allowed to yes. So we got our basic fields, we forgot 1 thing, a Unique field
to relay to a optional detail page, so let's close this design view it asks
if we want to save these design changes, offcourse we reply yes, and it'll ask
for a name, name it Employees and continue, hmmm it recommends adding a unique
field, YES, we want one. So now we have our table and we can start entering
some data.
I think you all
can do alot better then me, the important thing is we have some data to play
around with :-)
We can close MS-Access now and switch back to UDev.
Making Connection:
Let's setup our system so that UDev can actually use this data, first we have
to build a connection for the site, open the contacts.asp page, go to menu Modify
-> connections, click on new, select DSN and give it a decent name, i
used connTut :-)
Then i had to define a new DSN entry, so i did, told it what driver, where the
.mdb file was and gave it a name, then i selected it and clicked on test, I
got a connection was made succesfully and we can ok the connection, ok the modify
connection too and we're back at the page.
We now want to
get the data in our page, so we open the server behaviors window (if it's not
open yet) by pressing CTRL + F9 and we click on the databindings tab
screen and click on the + icon and selecting Recordset (Query), we get
a window like this:
As you can see,
i allready set everything up the way it should be for this tutorial, we tell
it that the name for this data is rsTutContact, the connection used is connTutCont,
we set it up earlier, i want all columns and i sort on first name. If we click
on test we see it retrieves everything we entered, which is what we wanted.
Ok this window.
Goto
part 3
Comments
Fantastic!
Marvellous
Well done. This tutorial sets an excellent benchmark to be lived up to. I am going to brush up my efforts as this tute is making mine look bad!
R
RE: Marvellous
Is it really that good ?
I tried writing this as detailed and understandable as possible.
I think I succeeded :-)
Dennis
Recommended Reading
You must me logged in to write a comment.