Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Link a web to a database

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
paolobeltrami
Asked:
paolobeltrami
1 Solution
 
englishmanCommented:
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
 
paolobeltramiAuthor Commented:
(TO ENGLISHMAN)
Thank you for answering.
I'll take into consideration your effort, but before answering I prefer receive some more comments.


0
 
vendrigCommented:
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
 
englishmanCommented:
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
 
sybeCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now