Automatically create index

  • Thread starter Thread starter John
  • Start date Start date
J

John

I am trying to create a macro which will automatically
create an index based upon a field I choose. How do I go
about this or is it even possible without resorting to VB
which is beyond my understanding at this point.

Here is the process that is currently going on . . .

My macro deletes four old tables then imports, via an
ODBC link, then new tables. Each of these tables has a
field called "client_id" that I need to have an index
created for (with duplicates ok). I then need to have
the macro save this databased in Access 97 format (is
that possible either?)

TIA!
 
It is unlikely you will be able to do this without VBA because you will
probably have to either generate the index through the object model, or what
might be easier would be to generate the Transaction SQL (or DDL, Data
Definition Language) to create the index and run that query through VBA.
Now, it may be possible for you, if the tables are the same names all the
time and have the same fields all the time, to create a query that is the
TransactionSQL for adding the index and simply run that query through the
macro each time you need to. You should be able to read up online about
transaction SQL syntax for adding an index to an Access database.
Here's a place to start:

http://support.microsoft.com/defaul...port/kb/articles/q180/8/41.asp&NoWebContent=1

and another

http://www.devguru.com/Technologies/jetsql/quickref/create_index.html
 
Back
Top