>>>>>
>>>>>If you're using SQL Server, this information is already available to use in various meta-tables (views)
>>>>>
>>>>>Say, you can check Information_Schema.Columns to get information about columns and you can look into extended properties to get descriptions of the fields (if you need to get this information too).
>>>>
>>>>I will look into this approach. Thank you.
>>>
>>>Yes, it sounds like it will work nicely. You get the schema for particular table using
>>>
>>>select * from Information_Schema.Columns where Table_Name = 'MyTable' and schema_name = 'dbo'
>>>and then you construct your SelectCMD and other commands using that info.
>>>
>>
>>It is strange that when I execute the above command (changing schema_name to table_schema) in SQL Server SMMS, I get a nice table where each row is information on a column in a table. When I execute this command from VFP, I get a table with no records where each column name is the name of the column in the table. Do you know why it is so?
>
>What do you mean by when you execute it from VFP? Try also only to get Column_Name and type for now.
Let me explain. I have a routine that using CA object - WITHOUT CursorSchema - that can be used to SQL Select from any table. So I jused the above SQL Select expression (e.g. select * from information_schema.....) but it returned not a table of of rows where each row is a column name but instead a table of no rows with column names as column names in the MyTable. I thought that the SQL Select from VFP should also return a table of similar structure and number of rows as I get in SQL Server SMMS.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham