November 17, 2001

Make Sure Your Application Doesn’t Use Proprietary SQL Extensions

If you want to try to keep your application standards compliant try this application: Mimer ValidatorIt lets you test any SQL query for SQL-92 and SQL-99 compliance. If you do this consistently, you won’t make your application dependent on a certain database.The guy that wrote this application is on the

Use ASP Include Files for Database Connectivity

To avoid repeating the following lines of code in every ASP page that needs a database connection: {Dim connObjSet connObj = Server.CreateObject(“ADODB.Connection”)connObj.ConnectionString = Session(“ConnectionString”)connObj.Open} You can use an include file, which contains the above lines (and the connection string). Say you do this in a file named databaseConn.asp, and put

How to Void a Cookie and Delete it from the Browser

You can specify an expiration date, using the setMaxTime(int) method of javax.servlet.http.Cookie. Specifying an expiration time of zero will void the cookie, and delete it from the browser. // Expire the cookie immediatelycookie.setMaxTime( 0 );// Send cookie back to the browser to void itresponse.addCookie(cookie);

Getting Information from MSAccess and SQLServer with One Single QUERY(T-SQL)

The ProductMaster Table is in MSAccess and the productdescription Table is in SQLServer. Create the Example.mdb in C drive and Create the Below table in MDB(MSAccess). ProductMaster(MSAccess)———————–pid ProductName1 maruthi2 MercedesBenz3 HondaCity4 OpelAstraproductdescription(SQLServer)pid Prize———– ———–1 160000$2 200000$3 300000$ To get the pid,prodcutname,prize from these two tables, execute this SQL(t-sql): select b.pid,b.ProductName,a.prize

Cookies Stored by Servlets Can Be Accessible to CGI scripts or ASP Pages

By default, cookies are accessible to every HTTP request for the current directory, and any subdirectories. On most Web servers and servlet engines, servlets are located in a special directory. For example, when using a servlet runner (which ships with the Java Servlet Development Kit), servlets must be invoked under

IIF Command in SQL Server

There is no “IIF” function in SQLSERVER as of VB and Access.For example, say you had a table like this: StudID Subject Marks—— —— ——1 Maths 801 Physics 751 Chemistry 601 English 45 Use the “Case” Command in SQLServer: –//////////////////////////////SELECT StudID,Subject,Marks,Status = CASE WHEN Marks > 50 THEN “Passed” ELSE

Use ASP in your .js, .vb, and .css Files

Open Internet Services Manager from the Administrative Tools group.Right-click on your server and select properties. From Master Properties choose WWW Services and click the “Edit…” button. Select the HomeDirectory, and under Application Settings click the “Configuration…” button.In the list, you should see an item for ASP that looks like this:

String Comparing

Suppose that you have the following code: String strObj; if(strObj != null) if(strObj.equals(“something”)){ // } You can use instead “something”.equals(strObj), so you don’t have to test if strObj is null.