Eliminate All Database Connection Logic from ASP

Eliminate All Database Connection Logic from ASP

Eliminate any database connection logic from your ASP pages by implementing a simple VB component that wraps up the most common ADO functionalities and in conjunction with a UDL.

  1. 1. Create a wrapper ADO component using VB.
  2. Expose the all the typical methods you use such as GetRecordSet (for reads) and Execute (for Insert/Update/Delete). Add a string parameter to all of your ADO wrapper methods. This will hold the name of a UDL.
  3. The ADO wrapper component performs the task of loading the DB connection logic from the UDL–you just need to specify a standard location to store all the UDLs for your site. (i.e. C:UDL or D:UDL –only the ADO wrapper component needs to know about this physical file location).
  4. Put your wrapper ADO component in an MTS/COM+ Package.
  5. Your ASP files then need to instantiate the wrapper ADO component and pass the UDL name as another parameter. They don’t need to know anything about the database –just pass the UDL name.
  6.  Dim oADO 'holds custom ADO component wrapperDim rs   'my recordsetDim sSQL 'can contain SP with parameters or raw SQL - advancedfunctionality includes using Input Parameters and passing them in an arraysSQL = "SELECT * FROM AUTHORS"Set oADO = CreateObject("MY_ADO.Data_Services")Set rs = oADO.GetRecordSet(sSql,"PUBS") 'the wrapper ADO component willread all DB connection info from D:UDLPUBS.UDLDo While Not rs.EOF	...	'do something	...	rs.MoveNextLoop
  7. You can completely eliminate ADO and Recordsets from ASP using ADO 2.6 (or higher), MS SQL Server 2000 (or higher), and XML 3.0 (or higher). Wrap up the ADODB.Stream method, pass XML back directly from SQL Server to the component, then pass it on to the calling method, or ASP, from the wrapper ADO component. All your ASP does is work with XML.

Other advanced techniques include referencing only the wrapper ADO component from other VB component methods, and having those methods return XML to the browser, thus eliminating ALL knowledge of the source of the data from ASP.

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as