Re: Clustered index=PK not returned by OpenSchema
From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 03/26/04
- Next message: Daniel: "Two Tables and one Form - Newbie Question"
- Previous message: Douglas J. Steele: "Re: Any Downloadable Trials"
- In reply to: onedaywhen: "Re: Clustered index=PK not returned by OpenSchema"
- Next in thread: onedaywhen: "Re: Clustered index=PK not returned by OpenSchema"
- Reply: onedaywhen: "Re: Clustered index=PK not returned by OpenSchema"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Mar 2004 07:37:37 -0500
I don't believe Jet uses Clustered Indexes, so it doesn't surprise me that
you're always seeing the property as being False.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) "onedaywhen" <onedaywhen@fmail.co.uk> wrote in message news:b8c9d0b7.0403250900.416ef4be@posting.google.com... > No takers? Let me try again. > > Consider this code, executed from a MS Access module within a new > blank database (questions follow): > > '<Code>-------- > Option Explicit > > Sub Test() > Dim Con As ADODB.Connection > Dim rs As ADODB.Recordset > Set Con = CurrentProject.Connection > With Con > On Error Resume Next > .Execute "DROP TABLE Table1" > On Error GoTo 0 > .Execute "CREATE TABLE Table1" & _ > " (Col1 INTEGER PRIMARY KEY)" > Set rs = .OpenSchema(adSchemaIndexes) > If Not rs.EOF Then > MsgBox rs!INDEX_NAME & _ > ": PK=" & CStr(rs!PRIMARY_KEY) & _ > ", Clustered=" & CStr(rs!Clustered) > End If > End With > End Sub > '</Code>------- > > 1. Am I correct in assuming the primary key will be the clustered > index for the table? > 2. If so, does anyone know why the OpenSchema shows PK=True and > Clustered=False? > > Many thanks. > > -- > > onedaywhen@fmail.co.uk (onedaywhen) wrote in message news:<b8c9d0b7.0403240654.476a8346@posting.google.com>... > > I'm using ADO's OpenSchema method with adSchemaIndexes on a Jet 4.0 > > .mdb database. For each index found, in the resulting recordset the > > CLUSTERED field is 'false' even when the PRIMARY_KEY field is 'true'. > > It is my understanding that for Jet a table's primary key is always > > the clustered index (I wish I was wrong on this one). Can anyone shed > > any light on this discrepancy e.g. is this known behavor of the OLE DB > > provider for Jet? > > > > Many thanks. > > > > --
- Next message: Daniel: "Two Tables and one Form - Newbie Question"
- Previous message: Douglas J. Steele: "Re: Any Downloadable Trials"
- In reply to: onedaywhen: "Re: Clustered index=PK not returned by OpenSchema"
- Next in thread: onedaywhen: "Re: Clustered index=PK not returned by OpenSchema"
- Reply: onedaywhen: "Re: Clustered index=PK not returned by OpenSchema"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|