F
Faysal Aberkane
Dim db As New ADODB.Connection
Dim resultsRS As New ADODB.Recordset
'open your database connection first
Function getPrimaryKeyName$(tableName$)
Set resultsRS = db.OpenSchema(adSchemaPrimaryKeys, Array(Empty,
Empty, tableName))
getPrimaryKeyName = resultsRS !COLUMN_NAME
End Function
I know that people often want to know how to do that (because I did)
Dim resultsRS As New ADODB.Recordset
'open your database connection first
Function getPrimaryKeyName$(tableName$)
Set resultsRS = db.OpenSchema(adSchemaPrimaryKeys, Array(Empty,
Empty, tableName))
getPrimaryKeyName = resultsRS !COLUMN_NAME
End Function
I know that people often want to know how to do that (because I did)