March 2, 2005

Connect to SQL Server Using ADODB Retrieving Records

This tip will show you how to connect to SQL Server using ADODB Retrieving Records using Record Set and connecting it to Crystal Reports. Follow these steps before adding the code: Click on Project?>Add References. Select Com Tab on Top. In Com, select Microsoft ActiveX Data Objects 2.7 Library. Click

Add SQL Text Fields

Text fields need special treatment in SQL. Here’s how to add two text fields: CREATE TABLE Foo (a int, b text)–Table Foo has b as text data type.INSERT INTO Foo VALUES (1,’qwe’)INSERT INTO Foo VALUES (1,’zxc’)INSERT INTO Foo VALUES (2,’123′)INSERT INTO Foo VALUES (2,’abc’)select coalesce(convert(varchar(8000),t1.b), ”)+ coalesce(convert(varchar(8000),t2.b), ”)from foo t1

Use Cookieless Sessions with Care

When a user visits a Web site for the first time, the site creates a unique ID, known as a Session ID. The Session ID is unique for that current Session, making it possible for the server to keep track of the user’s current Session information. The Session ID is

Share Information with Other Web Resources Using ServletContext

The Servlet API provides the class javax.servlet.ServletContext, which has methods that work with data stored in context. Any servlet can store Java objects in that context and other servlets can use them. The objects are stored with a String key for uniqueness. Here’s how it works: Use setAttribute(String key, Object

Achieve Seamless Connectivity with Virtual Directories

he concept of time travel has been a staple of science fiction since the entertainment genre was invented. Whether it’s H.G. Wells’ “The Time Machine,” Doc Brown’s DeLorean in “Back to the Future,” or any one of several Star Trek episodes and movies over the years, the thought of being

Be Careful Using std::cin.getline() and std::cin >> var Together

If you provide std::cin.getline() with a third argument?a “stop” character, it ends its input by eating the character and terminating the string. For example: std::cin.getline(str, 100, ‘|’) Without this this argument, std::cin.getline() stops when it reaches a new line. For example: float fl;std::cin >> fl;char str[101]std::cin.getline(str, 101);cin.ignore(); And you type: