[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Multi -Column Primary Key

As we know, the statement "Set rsPrimaryKeys = cn.OpenSchema(adSchemaPrimaryKeys)" retrives primary key columns defined in the catalog.

Here is my question:

For each of these tables, the primary key maybe consists of more than one column. How to tell the primary key is consist of a single column or multi-column?
0
leeann
Asked:
leeann
1 Solution
 
mangeshlCommented:
To check whether the primary key consists of one or more column try the following code:

Set rs = cnn.OpenSchema(adSchemaPrimaryKeys)
Do Until rs.EOF
    If rs!TABLE_NAME = "Table_name" Then
      MsgBox rs.Fields("Column_Name") & "   " & rs.Fields("PK_Name")
    End If
  rs.MoveNext
Loop
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now