|
Asp/VB Script Source Codes
DSN-less Applications
No need to set up a DSN on the Web server. This tutorial will show you
how. It even includes a Javascript app that will take your input and create the
DSN setup for inserting into your ASP script.
So you don't want to create a
DSN on the machine that your web app is installed. What benefits can you get
from this? Say you have a website on a Virtual Provider and you just created
that new database app and you want to test. Well you have to email your VP's
support to create the DSN and make sure you spell everything correctly so they
don't create something that you don't want. Another example is connecting to a
database dynamically and opening it in your code (I'll be going over this in a
future function in detail).
First the absolute minimum is
to tell ADO where your database is located and
what driver to use. Being that the database is located on the machine we're
talking
a file based database, hence we'll use Access.
In your Global.asa or any file for that matter, just build the following string
and assign it to a variable.
DBConnConnectionString = "DBQ=c:\MyDB.mdb;Driver={Microsoft Access Driver(*.mdb)};"
'once your string is built then use it to connect and open the database.
Set DBConn =
Server.CreateObject("ADODB.Connection")DBConn.Open DBConnConnectionString
You can pass all the parameters you specify in ODBC manager.
DefaultDir=c:\;DriverId=25;FIL=MSAccess;ImplicitCommitSync=
Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;
SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
Use this utility to generate
a DSN for your ASP script just enter the path to
your Access database located on your web server and then click on the Generate
button
to create your DSN.
<<<----- Return to
Asp/VB Script Source
Code Questions Page.
Have a Question ?
post your questions here. It
will be answered as soon as possible.
Check
Microsoft .Net Interview Questions
for more Microsoft
.Net Interview Questions with Answers.
Check
.Net Database Interview
Questions for more .Net Database Interview Questions with answers
Check
Job Interview Questions
for more Interview Questions with Answers
|