(814)806-1269  |   REQUEST A QUOTE     Register   Login   
Tuesday, September 07, 2010  
..:: Blog ::..
Request A Quote


  
Popular Entries
  
Categories
  
Santry Enterprises Weblog
27

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=MS Access;
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.


Enter full path and name of Access database:

     


Cut & Paste into your ASP code:

       


 

               





[Read the rest of this article...]

Posted in: Development
27
This tutorial will show you how to insert data from an html form and then conduct a search based on criteria filled in by aan html form. Good primer for learning database connections and ASP.

[Read the rest of this article...]

Posted in: Development
Page 7 of 7First   Previous   2  3  4  5  6  [7]  Next   Last   
  
  Privacy Statement | Terms Of Use
Copyright 2010 by Santry Enterprises
Home  |  About  |  Portfolio  |  Blog  |  Contact