Home  Fees/Services  Access Examples  Programming Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

Website to Database Connection Strings

File DSN Connection String Example Database Connection Methods

 Microsoft Access Tutorials>Connection Strings>ADO File-DSN Connection



Connect String to Access DSN

Connect String to OLEDB Provider for Jet

Connect String to Remote Database

ADO File-DSN Database Connection String

DSN-Less Connection String

SQL/Server ODBC Database Connection Method Example

OLE DB UDL Database Connection String Example

Connection Open Method String Example


Website to Database Connectivity Tools File DSN Connection

File Data Source Name String Method

File DSN string code is show below.  These connections can be used for Microsoft Access databases and many others.

Dim conn as DB.Connection

Dim rst as DB.Recordset
Dim sql as string
'---------------
Conn.Open "FileDSN=your_file_DSN;" & _
                   "UID=username;" & _
                   "PWD=password;"

Where:
your_file_DSN = The File DSN you have setup using ODBC connection in your control panel, or a DSN setup by the remote hosting company who hosts your website, or your in house network support group.

username = the username you have identified in the database, or the default 'Admin' username.

password = the password you have setup in the database or nothing  "Pwd=;" for no password.

'--------------  here we use the connection

sql = "select sales_rep, dollars from sales_by_rep_chart"

Set rst = Server.CreateObject(" DB.Recordset")
rst.Open sql, conn, 3, 3
Set Session("mysession") = rst
rst.movefirst
response.write rst!sales_rep

'--------------

Where mysession is any name for the session.

When done with the recordset don't forget to close it:

Conn.close
set conn=nothing
 



Contact Information

Database Connection String Methods
Microsoft Access 2003 2000 2002(XP) 97 All Windows Versions