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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Corrupted database, says Operation Invalid with current index

Status
Not open for further replies.

novamagic

Programmer
Jan 11, 2001
1
0
0
TR
I have an access database then when I try to open it from access says Operation "Invalid with current index", I really need this data and don't know how to repair it !
I also try to use MsAccess repair database option but this time program says me "This database is opened by another user".
 
Have you tried holding the shift key down when selecting the database from the list of files to open?

Scott.
 
Try deleteing the locking file for this database it would have the same name and the (ldb) extension.
 
It sounds like you use a splash form to automatically display when you open the database. If that is the case I've had some experience with that. Our splash screen itself was getting corrupted and since we had the BypassKey property set to false we were unable to even hold down the shift key to bypass the startup screen. My solution was to write a little code to remotely reset the startup properties. We could then bypass startup and repair the corrupted form.

Dim mWsp As Workspace

Public Function ResetStartup(DbName As String, strStartup As String) As Boolean

Dim mDb As Database
Set mDb = mWsp.OpenDatabase(DbName)

End Function

Function ChangeProperty(strDbName As String, strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer


' Sample of debug to change all startup properties

'ChangeProperty "StartupForm", dbText, "Customers"
'ChangeProperty "StartupShowDBWindow", dbBoolean, False
'ChangeProperty "StartupShowStatusBar", dbBoolean, False
'ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
'ChangeProperty "AllowFullMenus", dbBoolean, True
'ChangeProperty "AllowBreakIntoCode", dbBoolean, False
'ChangeProperty "AllowSpecialKeys", dbBoolean, True
'ChangeProperty "AllowBypassKey", dbBoolean, True

Dim mWsp As Workspace, dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set mWsp = DBEngine.Workspaces(0)
Set dbs = mWsp.OpenDatabase(strDbName)
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top