field / column alias versus field captions

highandwild

Registered User.
Local time
Today, 11:08
Joined
Oct 30, 2009
Messages
435
Hi All

I want to use a field / column alias in a query, as this is what an exported .cvs file needs, but the field caption, as set up in the table properties, is being used instead of the field / column alias I specify in the query.

Does anybody know of any way around this?

I can append the data to a temporary table with the right field / column names if there is no solution.

I don't usually have to contend with field captions as I don't use them in my databases.

Thanks
 
I would use Alias names for each column I wanted to rename.
 
I do use that method but where one is using a set of tables where the developer has used Field Captions for many of the fields then it is not possible to do that.

It still appears that the Field Caption takes precedence over the Field Alias.
 
That is why I never use Captions. Although, in A2010, many of the problems that resulted from using Captions have been fixed. Your title confused me which is why I answered the way I did. I thought you were asking which was better. Now I understand that you are trying to recover from the results of someone elses mistake. The no-code solution is to append the data to a table that has the desired column names and export the table. Using temp tables like this causes bloat and means you will need to compact the FE to get rid of it. When I need to make temp tables, I usually make them in a temp database that is created anew each time I make a temp table. That way I don't need to worry about bloat.

If you're OK with code, you can create the .csv file the old fashioned way by using the Open, and Write statements. Write the headers you want as the first row and then write the records.
 
Thanks for your response Pat.

I am quite able to do any coding necessary so will create a temporary database and table and then link to it.

It does seem that the people that developed Access made some weird decisions.

BTW - I have a Backend Database and Frontend Database and link to the table in the BE in a setup routine run at startup. I unlink the tables when the system is closed. Does this linking and unlinking add bloat to the FE.

Thanks
 

Users who are viewing this thread

Back
Top Bottom