Indexing a Table

From: Apple (Apple_at_discussions.microsoft.com)
Date: 10/26/04


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



Relevant Pages

  • Re: Is This Possible ... ? Yes - Upload images to an Access database
    ... It looks like your databases folder is outside the root of your web ... I created a database exactly as you said, the only change I made was to ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is This Possible ... ? Yes - Upload images to an Access database
    ... It looks like your databases folder is outside the root of your web ... I created a database exactly as you said, the only change I made was to ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is This Possible ... ? Yes - Upload images to an Access database
    ... I created a database exactly as you said, the only change I made was to ... upload it into the 'databases' folder, and not a folder called 'App_Data', ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: mailmerge and sql
    ... that is essentially a database application with a document ... the recordset to the Word Template and use it as if I got ... >> using an ADO recordset as a datasource (if it could be ... >Dim oCatalog As ADOX.Catalog ...
    (microsoft.public.word.mailmerge.fields)
  • Requery of Listbox does not display new data
    ... add a record to the database. ... Then the Lisbox control's requery method is ... The ADO command is run using a connection string to the mdb containing the ... Dim cmd As ADODB.Command ...
    (microsoft.public.access.formscoding)