There are a few different ways to connect to an Access database using a DSN-LESS connection. You can use the Access driver, an OLEDB provider connection, a physical path or a virtual path. Here is an example of each as well as a DSN-LESS SQL Server connection.
Nuts Own Code

Asp Directory

Nuts Web Search
Web Directory
Web Search

Nuts ASP Code
Functions
Scripts
Tutorials
Wizards
Fonts
Download Fonts
Download Dll Files
Dll Files
Relaxing Games
Online Games
Take Our Poll
Do you use .Net?
Yes
No
Not Yet
Dot What?
Really, Take It!
Get The Source
About Nuts4Asp
Privacy
Contact Us
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
Kids 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
Help build the largest human-edited directory of the web

This example uses the Microsoft Access Driver and a physical path.

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=E:\www\dtruman\nuts4asp.com\dat\nuts.mdb;"
%>

This is an example of OLEDB connection using the Microsoft Jet Engine ver 4.0 and a physical path.

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\InetPub\mdb\nuts.mdb;"
%>

This example uses the Microsoft Access Driver and a virtual path. This would work if the database was in the same directory as the pages working with it.

<% 
Set Conn = Server.CreateObject("ADODB.Connection")
FilePath = Server.MapPath("myDB.mdb")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & FilePath & ";" 
%>

This is an example of OLEDB connection using the Microsoft Jet Engine ver 4.0 and a physical path.

<% 
Set Conn = Server.CreateObject("ADODB.Connection")
FilePath = Server.MapPath("myDB.mdb")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FilePath & ";" 
%>

This is a DSN-LESS connection for SQL Server. Change TheServer to the name of the server name, TheUser to your User Name, ThePassword to your password, and TheDatabase to the name of your database.

<% 
Set Conn = Server.CreateObject("ADODB.Connection")
FilePath="DRIVER={SQLServer};SERVER=TheServer;UID=TheUser;PWD=ThePassword;DATABASE=TheDatabase"
Conn.open FilePath
%>

Now that you are connected, learn to use an SQL statement to add, delete, or edit a record using either a form or a query string.

Bad or missing query parameters in request.

Copyright © 2001-2008 Nuts4Asp.com
All other names used are property or copyright of their respective owners.