Indexing a Table
From: Apple (Apple_at_discussions.microsoft.com)
Date: 10/26/04
- Next message: Brandon Campbell: "Bulk Insert"
- Previous message: Andy DF: "Protect an Access DB"
- Next in thread: Apple: "Re: Indexing a Table"
- Maybe reply: Apple: "Re: Indexing a Table"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 26 Oct 2004 08:57:02 -0700
I need help on Access 2002!!!!!
I have a simple code to adds index to a table if the index is not set. It
works ok when I run it from my pc( database on my c drive), but when I try to
run it from a network drive I'm getting the error below:
Runtime error -214721785(80040e40):
The database engine could not lock table 'Combined Table' because it is
already in use by another person or process.
There's no other person using the database.. so, I'm the only one using it
when I received the error msg. See the code at the end..
Please help!!
Thanks
Private Sub SetIndex()
Dim Cat As ADOX.Catalog
Dim Tabl As ADOX.Table
Dim Indx As ADOX.Index
Set Cat = New ADOX.Catalog
Set Tabl = New ADOX.Table
Set Indx = New ADOX.Index
Cat.ActiveConnection = CurrentProject.Connection
Set Tabl = Cat.Tables("Combined Table")
If Tabl.Indexes.Count > 0 Then
Exit Sub
End If
DoCmd.Hourglass True
Indx.Name = "Myf"
Indx.Columns.Append ("Social_Security_Number")
Tabl.Indexes.Append Indx
DoCmd.Hourglass False
End Sub
- Next message: Brandon Campbell: "Bulk Insert"
- Previous message: Andy DF: "Protect an Access DB"
- Next in thread: Apple: "Re: Indexing a Table"
- Maybe reply: Apple: "Re: Indexing a Table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|