Creating an Index

aziz rasul

Active member
Local time
Today, 10:32
Joined
Jun 26, 2000
Messages
1,935
I have a table that has no index set. However I want to programmatically create an index for the table i.e. tbltablename!fieldname3. How do I do this?

Note that the reason why an index is not created manually is because it can be easily deleted and no security can be imposed. Hence if this happens, the code would automatically re-instate the index.
 
You might try looking up CREATE INDEX in help.
 
I have tried the example given to suit my needs using CREATE INDEX, but I can't get it to work. Here is what I have tried:-

MyDB.Execute "CREATE INDEX NewIndex ON tblResAdvOrders " & "(DAT Filename);"

it comes back with a syntax error statement?

Any Ideas?
 
What is (DAT Filename)? If you build a string first, you'll see the syntax error if you put a breakpoint on the execute statement.

Dim mySQL as String
mySQL = "CREATE INDEX NewIndex ON tblResAdvOrders " & "(DAT Filename);"
MyDB.Execute mySQL
 

Users who are viewing this thread

Back
Top Bottom