October 6, 2000

Multiple Line Headers on Grids

Question: Can I have multiple line headers on grids? Answer: No, you cannot have multiple line headers on grids in VFP, but you can simulate them by overlapping a shape object over the top of the column and drop a label on that shape for the extra text to display.

Creating a New ID

Question: I am new to VFP. I want to create a unique number for a customer ID field in a table. The VFP sample program “tastrade” simply uses NEWID() as the default value for the given field. When I try the same in a new database I get the error

Getting the Next Set of Results

Question: I’m getting the first “page” of data from a table and I’m wondering about getting the next page… I’m using the query: SELECT TOP 50 ID, Name, Address, Phone, RankFROM Person, FileWHERE Person.RankID = File.RankID AND Name LIKE ‘R%’ORDER BY Name ASC I would like to then be able

xp_cmdshell and Windows Apps

Question: Why can’t I run an application like ws-ftp from SQL with xp_xmdshell? ws-ftp will start, but it’s not visible on the screen. Answer: xp_cmdshell runs in the space of SQL Server; it doesn’t open a window on the command prompt. I would be very careful as to what I

Convert Text to Proper Case

Question: I am using SQL Server 7 and would like to convert an uppercase string to proper case. Is there an easy way to do it? Answer: SQL Server has several functions to allow you to manipulate the case of text characters. UPPER and LOWER convert text to their respective

Rebuild Large Table with New Extents

Question: What is the best way to backup and/or unload a table and restore/reload to a new dbtable with new extents? Answer: If you have enough drive space, do an UNLOAD to TABLENAME.UNL select * from tablename. If you can, turn logging off during this operation. Then reload with load

API Registry Calls

Question: I have code in Visual Basic that allows a user to search the Registry and return a value from the passed key and path. Can you show me a simple way of implementing this in Visual FoxPro? Answer: There is a class included in the VFP Foundation Classes called

Disabling Items in a Listbox

Question: I have a listbox with two properties called DisabledItemBackcolor and Forecolor. How can I disable single items in the listbox? List.Enabled(ItemID)=.F. disables all items (like the Enabled-Property itself). You can see the DisabledItem-Colors in effect if you set RowSourceType to 7 (Files). Then the second item shows the actual

Using ORDER BY Based on a Parameter

Question: I want to construct an SQL query or stored procedure that will order its result set based on a query parameter. Something like: SELECT *FROM customersORDER BY ? Unfortunately, that is not valid SQL. Is there a way to achieve this within SQL without having to resort to building

No more posts to show