Arts
Movies ,
Television ,
Music
Business
Jobs ,
Industries ,
Investing
Computers
Internet ,
Software ,
Hardware
Games
Video Games ,
RPGs ,
Gambling
Health
Fitness ,
Medicine ,
Alternative
Home
Family ,
Consumers ,
Cooking
K i d s and Teens
Arts ,
School Time ,
Teen Life
News
Media ,
Newspapers ,
Weather
Reference
Maps ,
Education ,
Libraries
Regional
US ,
Canada ,
UK ,
Europe
Science
Biology ,
Psychology ,
Physics
Sports
Baseball ,
Soccer ,
Basketball
World
Deutsch ,
Español ,
Français ,
Italiano ,
Japanese ,
Nederlands ,
Polska ,
Svenska
This example is for using forms and makes some assumptions. Be sure to
make the necessary changes.
That you want to use a physical path to the database.
That you use the Access driver, your database is named myDB and
the path is on the E drive.
That the table in your database is named myTable, one field is named
email and that the field in the form is named textbox1.
<%
Set Conn = Server.CreateObject("ADODB.Connection")
'assumption 1
FilePath = "E:\database\myDB.mdb"
'assumption 2
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
FilePath & ";"
'assumption 3
sql = "DELETE * FROM myTable WHERE email=" & Request.Form("textbox1")
Conn.execute(sql)
Conn.Close
%>
This example is for using query strings and makes many of the same
assumptions. Again, make the necessary changes.
That you want to use a physical path to the database.
That you use the Access driver, your database is named myDB and
the path is on the E drive.
That the table in your database is named myTable, one field is named
email and that the query string is named email.
<%
Set Conn = Server.CreateObject("ADODB.Connection")
'assumption 1
FilePath = "E:\database\myDB.mdb"
'assumption 2
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
FilePath & ";"
'assumption 3
sql = "DELETE * FROM myTable WHERE email=" &
Request.QueryString("email")
Conn.execute(sql)
Conn.Close
%>
Now go find out how to add or edit
a record the same way.
There are a few different options in building a DSN-LESS connection
to your database. To get a look at them all, check out the connection
page .
If you are unsure about using QUERY STRINGS, take a look at this
tutorial .
Bad or missing query parameters in request.