Solved

Link a web to a database

Posted on 1998-09-08
5
161 Views
Last Modified: 2013-12-25
I'm rather new in web authoring. I can make pages quite easily, through authoring programs and the HTML I've learned so far. But now I have to go deeper: I can't write 500 html pages for 500 different objects I have to list. I will make only one page linked to a Database that contains those 500 objects. The problem is that I don't know where to begin my job, what software I need ( I have MS Access 95 ) and how can I link my website to that database. I have to know everything. For this reason I will high-rate this question.
Thank you!
0
Comment
Question by:paolobeltrami
5 Comments
 
LVL 2

Accepted Solution

by:
englishman earned 500 total points
ID: 1854807
I'm fairly new to coding too however this is what you need:

Install MS Personal Web Server and asp.exe .
Give your dbase a System DSN in 32bit ODBC in control panel.
Create an executable directory.
In this directory put the following two files:

search.asp
(this file is used to provide the criteria by which you select the records to display)
<form method="post" action="results.asp">
Keyword: <input  type="text" name="Keywords" size="20">
<input type="submit" value="Search"><input
type="reset" value="Reset"></form>

results.asp
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
Keywords = Request.form("Keywords")
q = "SELECT * FROM tablename WHERE fieldname LIKE '%" &_Keywords & "%'
rs.Open q, "DSN=dsnname;", 3
%>
<%=rs("field1")%><BR>
<%=rs("field2")%><BR>
<%=rs("field3")%><BR>
<%=rs("field4")%><BR>

0
 

Author Comment

by:paolobeltrami
ID: 1854808
(TO ENGLISHMAN)
Thank you for answering.
I'll take into consideration your effort, but before answering I prefer receive some more comments.


0
 
LVL 2

Expert Comment

by:vendrig
ID: 1854809
What Englishman is trying to say, you need:
1. A Web-server. Personal Web-server is excellent for prototyping in Windows95 (and it is fully operatinal) but not intended for the real thing. If you have Windows NT there are a number of options, such as MS's Internet Information Server. Most people however forget that they have nothing to say about this, they depend on their ISP.
2. A scripting language environment. The ASP Englishman is talking about (Active Server Pages of MS) is a good example. CGI is the old-fashioned way. I've also used ColdFusion (easy to use but not so flexible). These environments require extensions on your Web-server, so it depends which you can use.
3. Connection from the scripting environment to your database. (Depends on 1 and 2 again.) With Access you can do a good job, if your database is not too big (500 items doesn't sound too big). In Englishman's example you can see how the scripting language (he uses server-side VBScript, everything between <% %>) connects to the database (via an ActiveX component) and performs a SQL query.

The case Englishman has given looks too easy to be true. But it is:-) An experimental environment is not that hard to set up. The nightmares come when you have a real site with real users who do everything you didn't think of.
0
 
LVL 2

Expert Comment

by:englishman
ID: 1854810
hi P and V,
I'm using access with a table of 20000 records and it works a treat (intranet only so far). I've heard that MSaccess only really becomes a problem when you have users writing to the dbase, though I haven't tried this. Of course the example I posted is the simplest senario.
Cheers.
0
 
LVL 28

Expert Comment

by:sybe
ID: 1854811
vendrig's comments are very usefull.

It depends on what system you currently have. With WinNt and IIS, it is simple to install ASP (ASP comes automatically with IIS4, if you use IIS3, you have to install it seperately).

It also very much depends on what your current knowledge is and how fast you learn. If you are familiar with HTML and VB, then you will find ASP (with VBScript) quite easy to learn.

Quite a good tool for developing ASP pages without having to do much coding is DrumBeat. I have seen people with only some HTML produce database driven web applications without too much effort.
DrumBeat produces JavaScript ASP.

To explain this: ASP can use different scripting languages. Standard it can handle VBScript and Javascript. But also Perlscript can be installed. I haven't seen other languages, but maybe there are.


0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now