July 16, 1999

Load a Grid from a SQL Statement

Use this code for a generic routine to load a grid from a SQL statement. The example is for Remote Data Objects (RDO) and Sheridan Software Systems’ grid, but it works with minor modification for any grid and resultset type. Also, you can load combo boxes in a similar fashion:

Invisible Control Placement on MDIForm Client Area

With VB4 or higher, you can place invisible controls-such as the standard Timer and CommonDialog or UserControls built with VB5 that have their InvisibleAtRuntime property set-directly on an MDIForm. In previous versions of VB, you could only put controls with an Align property on an MDIForm. Because CommonDialog and Timer

A Better Use for StrConv

When using proper names, you sometimes need to capitalize the first letter of each word. For example, you need to convert “john smith” into “John Smith.” With VB3, you had to write a custom function to do the job; VB4’s versatile StrConv routine, on the other hand, lets you do

Use the Object Library Name When Dimming Object Variables

I always put the word DAO in front of all references to DAO objects. Here are some examples: Dim Db As DAO.DataBaseDim rs As DAO.Recordset This way, VBA knows what library to look in for the definition of DBEngine (the top object). If you don’t do this, VBA surfs the

Max users

Question: I have 20 user licenses. During some activities, users are being logged in two or three times. Thus I can hit a max user limit with only 9 actual users. Any suggestions on what to look for to minimize this? We are runningSQL Server 6.5 and 7.0 as “back-end”

SQL Tutorials

Question: I am interested in learning SQL on my own and need to know if there are any tutorials or disks that I can obtain so that I can practice on my home computer. I need to know how I can practice writing code at home. Answer: You need to

SQL: querying records based on ORDER BY

Question: Can you make a query that returns records based on ORDER BY something? There may be mutiple instances, but I only want the one that is the very first based on what you ordered by. Answer: Well, this seems to ask for a MAX or a MIN of something,

Establish Referential Integrity

Question: How do you Establish Referential Integrity between 2 tables so that when a ticket is deleted from the TICKETS table all associated information in the customer5 table will be deleted? Answer: Forgive me if I missed the boat, but it seems that you want to delete the parent records

How to find the top percentage of users

Question: I want to find out the top 5%, 10%, and 30% customers based on their purchases. For example, my table looks like:CustomerID Purchase(in $)1 1002 500Up to 100 customers. I am getting the top 5% through:select top 5 percent Purchase,CustomerIDfrom Customerorder by CustomerID desc The same is true for

No more posts to show