June 22, 2000

Populate a Flexgrid With Desired Columns and Filtered Rows

Populate a flexgrid control with specified columns and filtered rows by drawing the control and calling this routine: Dim strWhere As StringstrWhere = ” WHERE PeopleAddressesID=4502″Call PopulateFlexGrid(Me.MSFGrid, “tblPeopleAddresses”, strWhere,”PeopleAddressesID”, “BuildingName”, “City”, “State”)——————————————————————————————————————————————————-Public Sub PopulateFlexGrid(FlexGridControl As MSFlexGrid, strTableName AsString, strWHERECriteria As String, ParamArrayColNames()) Dim adoRst As ADODB.Recordset Dim intI As Integer

Quickly Comment and Uncomment Blocks of Code in SQL

During development, it is often necessary to have blocks of code for debugpurposes. If the debug code is lengthy, commenting anduncommenting it can be tedious. But if you put either a ‘–‘ in front of each lineor a ‘/*’ at the front and a ‘*/’ at the end of each

SQL Query to Update a Column Value in All Tables

This is a very simple but time-saving and powerful tip to build a dynamicSQL query (in SQL Server 7.0) that updates a particular column value present in all tables. And it even works for INSERT. First, open SQL Server and select SQL Server Query Analyzer from the Tools menu. Type

Connecting to SQL Server 7 via MS-DOS 6.2

Question: I have some complex engine control software that has to run under MS-DOS 6.2, but it needs to transfer data to SQL Server 7. What’s the best way to connect to SQL Server from DOS? Answer: You can use OSQL or ISQL to connect to SQL Server from the

Counting Across a Row

Question: I have a table that stores test answers. It looks something like this: Student Date_taken Q1 Q2 Q3 … Q78 If each question (Q%) is true/false (ENUM(”,’T’,’F’)), how do I structure a select statement to tally the total number of “trues” for each student on a particular test? Answer:

DTS to Excel File

Question: I tried a DTS export of a table to an Excel file. The data types of all the columns in the table are varchar. When it exports to the Excel file, Excel forces every column to be text. So every value of every cell has a single quote before

Filtering a Recordset

If you have a recordset already created and want to filter it by some criteria, you can use the Filter property of the recordset to do it. Just change the recordset’s Filter property to a WHERE clause and then set the recordset object to another recordset variable, like this: Dim

Back-Referencing A Matched Element

You can use the dot operator (.) in XSL transformation stylesheets to refer to, effectively, “whatever element was just identified.” Let’s say you had this template in a stylesheet: Say you also wanted such elements to be converted to dialogTitle elements. You could do it by fleshing out your template

Stack Recordset Returns

If you’re getting a bunch of data for an ASP page, you can retrieve all the data through a single stored procedure and through a single call. Here’s what your stored procedure might look like: CREATE PROCEDURE sp_GetAllTheData AS SELECT * FROM tblStates ORDER BY StateCode SELECT * FROM tblCountries

No more posts to show