Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Index (Alter Table)

Status
Not open for further replies.

mans

Programmer
Joined
Mar 18, 2000
Messages
136
Location
AU
Hello,

From within VB6 and using Access2000, I am attempting to change a field called field1 so it is indexed, the table name is Table1. I have used the following statement (and some variations) without luck. It says there is an error with the statement and higlights INDEX below.

Alter table table1 ADD INDEX field1

I would greatly appreciate any help.

Thank You
 
Try this. Indexname must be a unique name in Table1
Code:
CREATE INDEX indexname ON table1(field1)
This runs as a straightforward SQL statement
Let me know if this helps
 
Tahnk you very much, it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top