LoudASP Knowledge Base - ASP and Database
Active Server Page knowledge dealing with databases
How to Connect to a Database (DSNLESS)
There are a couple things that you need to remember before you try to
connect to a database. Make sure that database has read/write permissions and
that you point the physical database path in the code. The code below is how to
connect to an Access Database. This code should work for both Access 97 and Access 2000.
DataConn = "c:databaseYourDatabase.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
ConStr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & DataConn & ";"
Conn.open(ConStr)
You will need change DataConn with the physical path to your database. Make sure that you
include the database filename in it also.
This FAQ has been read 14701 times.
How to Connect to a Database (DSNLESS)
Easy SQL How To (Insert)
Easy SQL Help (Update)
Easy SQL Help (Delete)
Easy SQL Apostrophes Bug Fix
Easy How To SQL (Select)
Database test for no records
|