I am adding and updating to a Dbase IV database within an ASP.Net program. After adding or updating I need to programatically reindex the database. I am using to session variables to decide what database to use and what field to update to or add. Before Indexing I need to check to see if the index is already there and ifso I need to delete it. Below is the code I have come up with but I am unsure of how to check to see if the index is there. Can anyone help?
Dim strlabcode = Session("strlabcode")
If Session("Database") = "S1ED" Then
strSql = "CREATE INDEX labNdx ON S1ED'" & strlabcode & "'"
ElseIf Session("Database") = "N1WSKED" Then
strSql = "CREATE INDEX labNdx ON N1WSKED'" & strlabcode & "'"
ElseIf Session("Database") = "N1TESKE" Then
strSql = "CREATE INDEX labNdx ON N1TESKE'" & strlabcode & "'"
ElseIf Session("Database") = "N1ITESKE" Then
strSql = "CREATE INDEX labNdx ON N1ITESKE'" & strlabcode & "'"
ElseIf Session("Database") = "S1MSKE" Then
strSql = "CREATE INDEX labNdx ON S1MSKE'" & strlabcode & "'"
Else
lblmessage.Text = "There was a problem connecting with the database please contact System Programmer at 7020"
lblmessage.Visible = True
End If
Dim conData As New OdbcConnection("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=" & strDataLocation & ";")
cmdData = New OdbcCommand(strSql, conData)