February 4, 2000

Using Numbers in SQL Text

Question: Here is the code I am using to do a query from an Access 97 database: Query = “SELECT * FROM DiamondList WHERE (ProductNumber = ‘” & tempProduct & “‘)” ProductNumber is the name of an Access 97 database field with the data type set to number. When I

Display Currency Information Correctly

Question: I am writing an online order form in ASP. How can I restrict the value of vartax to a two decimal digit (round up to two decimal points)? Most of the time vartax displays more than a 10 decimal digit. Here is a portion of my ASP code: ‘—–

XML in ASP vs a Java Servlet

Question: I am building a Web application using ASP and XML. My database calls are directed to a server with a Java servlet over HTTP. It works fine except when I turn off the servlet and do a send on the XMLHTTP object?then the ASP breaks. How can I catch

Direct Response to Another Frame on a Page

Question: I have a page broken into two frames. Frame A has a form. I would like the response from the form directed to Frame B. Right now, my response from A’s action is being written into A. Answer: Simply code your tag with a TARGET attribute: And you are

Sending Plain Text Via ASP

Question: I wrote simple ASP code that reads a TXT file and sends it to the browser. I change the Response.Header to plain/text. Internet Explorer 4 displays the text file fine but IE 5 does not like it and prompts me to download the ASP file. Why does it do

Use Overloaded Methods To Simulated Optional Parameters

Some languages, like C++, let us declare optional parameters. For example, the following is a valid method signature in C++: public aMethod(int x, int y=0, int z=0); where parameters y and z are optional in the sense that if we call the method “aMethod” as in: aMethod(1,2,3); x is set

Let Your Text Throw A Shadow

It is very easy to add a shadowy effect to drawn text in Java. All we have to do is to pick a darker color for the shadow and draw it near the center of the original text that we want to shadow. The code snippet below does just that

Generate a Relative Path

Sometimes in an application you will have a “home” directory associated with the application, and then some files associated with that home directory. To have the files in an independent position relative to the root of the file system, you may want to use relative paths to the files rather

Linking to a JNI Function Compiled with Visual Studio 6.0

Suppose you are writing a Java application on the windows platform and want to make a JNI call to a C function written with Microsoft Visual Studio 6.0. Well, here’s what you would do: The ‘native’ method declaration in Java : public class x { public native void nativeC(); …}

No more posts to show