|
Databases and ASP
ASP has the ability to act as a front end to a database. A few years
ago most web sites were static, now days almost 90% of the big sites are
dynamic (store the content of their web site in a database and retrieving
it as and when required). Dynamic content allows interaction with the
user which encourages users to come back to your site frequently.
Microsoft Access and SQL are commonly used database tools for ASP pages.
Access is often used as a local data inputting tool, with data copied
to SQL for speed and high load performance. For smaller site Access alone
is sufficient, you have the option of running all sorts of scripts off
of a database you can download and upload at your will with changes etc.
There are other ways to add dynamic content to a website eg: Open source
simplicity of PHP and MySQL and CGI language perl and JSP.
Different Database connection strings
Here is OLE DB Method for Access:(Red lines are comments)
<% @ LANGUAGE="VBSCRIPT" %>
<%
' create an ADO
object to represent the connection to the database
Set adoDataConn = Server.CreateObject("ADODB.Connection")
' Database connection info and driver
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& Server.Mappath("database.mdb") & ";"
' Open the database connection
adoDataConn.Open strConnectionString
' Once you have finished with a connection you should
close it
strDataConn.Close
Set adoDataConn = Nothing
%>
|