I need to check if an index exists on the version of the .mdb i am accessing. If it does not exist then i need to create it permanently in the .mdb .
This is how i am opening the .mdb
cnn.Provider = "Microsoft.Jet.OLEDB.4.0;"
cnn.Open Trim(App.Path) & "\Awol.MDB"
Set rs = New ADODB.Recordset
rs.Open "wol", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
thsi is the current bit of code where i need to create the index.
I have used on error to find if the index exists. (is there a better way?)
rs.Index = ("TITLE")
If Check3 = 1 Then
On Error GoTo nocomposer
rs.Index = ("COMPOSER")
On Error GoTo 0
MsgBox ("No Composer Index , This is an OLD Database, hit enter to continue")
Text1 = ""
' Create the NewIndex
**************i need the code to create an index
Index name composer
I need the index to be permanent
Would not mind to know how to create index with multiple fields say field names = comp and title
Appreiate any help