Home > Microsoft .Net Development Tips > ARCHIVE: Tips & Tricks > Testing application variables
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ARCHIVE: TIPS & TRICKS

Testing application variables


Jim Lewis
08.15.2000
Rating: -3.75- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Testing Application variables

Reader, Jim Lewis of Fairfield, California, USA, submitted this week's tip. Jim uses a lot of ADO connections in his Active Server Pages development to make things more user friendly, and of course to create dynamic data pages.

Unfortunately, Jim finds that NT web-hosting servers aren't always as reliable as he would like them to be, and the Application connection variables in his global.asa file sometimes "evaporate". Since he can't check every site every day, he's found it useful to include a short test to see if the Application variables are valid, and reset them if not.

At the top of his index.asp page, Jim uses an include file "conn_test.inc" which looks something like this:

<% language="vbscript" RUNAT=SERVER %>
<%
If Application("myConn_ConnectionString") = "" Then 'run if
ConnectionString has been lost
Application.Lock 'Lock App while we reset
Application("myConn_ConnectionString") = "DBQ={appropriate
connection string}
Application("myConn_ConnectionTimeout") = 15
Applic

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
ARCHIVE: Tips & Tricks
SearchVB wants your tips
Find out what VS.NET modules are installed
Retrieving icons from an EXE-file
Toggling Boolean values
VS.NET multiple tabbed windows
Set the value of a DataField in code behind
Easy grid design
Open using last Visual Studio.NET layout
Save development time by using inherited forms
Reusing code in VS.NET

.NET Framework security best practices
New features in Windows 7 bring new UI considerations for developers
Podcast: Windows CardSpace authors speak
Book excerpt: Java EE and .NET security interoperability
Book excerpt: Advanced Windows Debugging
Book excerpt: Pragmatic unit testing in C# with NUnit
Security interoperability with .NET/WSE and WebLogic Workshop 8.1
Windows Developments: Product news, December 2007
How to avoid regression bugs while adding new features
VB code: New additions, November 2007
VB code: Application security downloads

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
common test platform  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ation("myConn_CommandTimeout") = 30
Application("myConn_CursorLocation") = 3 'use client side cursor
Application("myConn_RuntimeUserName") = "admin" 'true for most MS
Access databases
Application.Unlock
End If
%>

This assures Jim that when a visitor accesses the site, it will work like it should. Not to mention, Jim also avoids embarrassing emails telling him his client's site is "broken".

Jim, that's a useful tip for our readers, and to show our appreciation, we're sending you a free searchVB.com denim shirt. Wear it in good health!

-----------------------------
Jim Lewis
jlewis@jimbabwe.com

Jim is the owner of "Jimbabwe" (http://jimbabwe.com), a company that focuses on database consulting, software development using Internet technology, and web application development. In addition, Jim is a Workflow System Engineer at NorthBay Healthcare System, where he implemented and maintains a corporate Intranet, is webmaster of the corporate Internet site, and develops collaborative online applications using MS Outlook and Exchange. In both jobs, Jim uses Visual Basic and VBScript extensively.

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts