August 15, 2000

Vectors Containing Arrays

Question: I’ve got a struct which is declared as having two fields: int position;char tile-id[6]; When I use this in a vector, I can use the [] notation to initialise the position int OK and can then check this with a cout command, but when I do the same with

ListViewAdjustColumnWidth – Resize ListView’s columns to account for their contents

Private Declare Function SendMessageLong Lib “user32” Alias “SendMessageA”(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParamAs Long) As LongConst LVM_SETCOLUMNWIDTH = &H1000 + 30Const LVSCW_AUTOSIZE = -1Const LVSCW_AUTOSIZE_USEHEADER = -2′ Adjust the width of a ListView control so that each item is fully visibleif second’

Informix Configuration on NT

Question: How do I program Informix to insert newline characters into CHAR(500) fields? Answer: A char field is defined as ending with a newline, so I don’t think you can make it work with a char field. If you really need this, you may need to go to a blob

Hyphen Or No Hyphen When Accessing DBACCESS

Question: When accessing DBACCESS from a script, what are the consequences of leaving out the hyphen? What should we adopt as a standard, hyphen or no hyphen? Example: dbaccess mystores –

Exchange and .PST Files

Question: How do I import my user’s .PST files directly into Exchange without having to log in as the user and import the files via Outlook? Answer: You might be able to use ExMerge in two-step mode to do this. I haven’t tried it, but it could work: You’ll need

Build an XML Document for a Recordset on the Fly

(Note: This tip assumes that you have an ActiveConnectionsetup to your DSN.) This function creates an XML document from an ADO Recordset, programmatically. Public Function CreateXML(strRoot As String,strSQLStatement As String, OptionalstrConnectionString As String) As String Dim rstADO As ADOR.Recordset Dim fld As ADOR.Field Dim strXML As String If IsMissing(strConnectionString) Then

Default Script Error Handling on Your Web Pages

The unhandled or unexpected script error is a real issue these days. Script errors can be seen even on many of the professionally designed Web sites and Web-based customer applications. Sometimes the errors are shown only on specific browser versions; sometimes date/time-related issues cause them, while in some other cases

How to Convert ADO RecordSet into the HTML Table

The following code converts an ADO recordset into an HTML table by using the GetString function of the recordset. This method does not involve the looping or MoveNext method; it directly converts the recordset into the HTML table. This code also demonstrates how we can create an HTML table column

Export HTML Table to Excel

Here is a simple way to export an HTML table to Excel with a single line of code. For the technique to work, you must have Excel installed on the your machine. Copy the following code and paste it in notepad. Save it as an ASP page, and then open

No more posts to show