Alias name for table?

D

Don Wiss

I have parameter databases that my Excel programs call using sql strings.
I'd like to expand one of my tables. Its current name is not reflective of
the various fields it would have after the expansion. But existing
spreadsheets call it by its table name. Can I set up an alias in the Access
database so I can rename the table and the existing sql calls will still
work?

Then likewise, could I rename a field in this table and have an alias for
the old field name?

Don <www.donwiss.com> (e-mail link at home page bottom).
 
S

strive4peace

Hi Don,

Because tables and queries are treated the same for getting data, you
could rename your table -- just make sure you create a query named with
the old table name containing the columns for the spreadsheets to use...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
D

Don Wiss

Because tables and queries are treated the same for getting data, you
could rename your table -- just make sure you create a query named with
the old table name containing the columns for the spreadsheets to use...

And how would I do that? All I know how to do is to import worksheets (or
text files) into tables and then use sql to pull out the data. So I can do
select and delete queries only.

In this example the calls in the existing spreadsheets are:
Select Date,Index from UnlSevTrIndexes where State ='CW';

I'd rename the table to SevTrendIndexes and rename the Index field to
CombUnl.

Don <www.donwiss.com> (e-mail link at home page bottom).
 
S

strive4peace

Hi Don,

perhaps I am not understanding correctly...

try this:

rename your table to SevTrendIndexes and the rename the Index field to
CombUnl

make a query called UnlSevTrIndexes, based on SevTrendIndexes, with all
the fields. Use an alias for Index since you want to change the
fieldname.

on the grid for Index, use this:

field --> Index: CombUnl

or, in SQL , CombUnl AS [Index]

then, you can see if your Excel stuff still works ok accessing a query
instead of a table...

as you probably know, Index is a bad choice for a fieldname... it might
be best to just change the Excel links...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
D

Don Wiss

try this:

rename your table to SevTrendIndexes and the rename the Index field to
CombUnl

make a query called UnlSevTrIndexes, based on SevTrendIndexes, with all
the fields. Use an alias for Index since you want to change the
fieldname.

on the grid for Index, use this:

field --> Index: CombUnl

or, in SQL , CombUnl AS [Index]

Okay. I will try this at work on Monday. I've never used the grid. If I do
a query in Access I go to SQL view and write a line of sql code.
as you probably know, Index is a bad choice for a fieldname... it might
be best to just change the Excel links...

Changing the existing spreadsheets is not possible. There are thousands of
them. Though few are likely to call the new database. When a deal pricing
spreadsheet is first opened, it finds the newest database and locks into
it. Only if the user, seeing a message saying a newer database is
available, and presses a button to use it, will this alias query be called.
Generally they don't do this, as generally using a new parameter database
means a higher price, and they don't want that. And most are finished
deals, either done or not done.

Don <www.donwiss.com> (e-mail link at home page bottom).
 
S

strive4peace

Hi Don,

if you want to write SQL, you can do this:

SELECT *, CombUnl AS [Index] FROM SevTrendIndexes;

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Don said:
try this:

rename your table to SevTrendIndexes and the rename the Index field to
CombUnl

make a query called UnlSevTrIndexes, based on SevTrendIndexes, with all
the fields. Use an alias for Index since you want to change the
fieldname.

on the grid for Index, use this:

field --> Index: CombUnl

or, in SQL , CombUnl AS [Index]

Okay. I will try this at work on Monday. I've never used the grid. If I do
a query in Access I go to SQL view and write a line of sql code.
as you probably know, Index is a bad choice for a fieldname... it might
be best to just change the Excel links...

Changing the existing spreadsheets is not possible. There are thousands of
them. Though few are likely to call the new database. When a deal pricing
spreadsheet is first opened, it finds the newest database and locks into
it. Only if the user, seeing a message saying a newer database is
available, and presses a button to use it, will this alias query be called.
Generally they don't do this, as generally using a new parameter database
means a higher price, and they don't want that. And most are finished
deals, either done or not done.

Don <www.donwiss.com> (e-mail link at home page bottom).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top