tdf.Indexes.Append idx
'=== Create primary key for table Podchivka ======
Set tdf = dbs.TableDefs( "Podchivka" )
Set idx = tdf.CreateIndex( "pk_Podchivka" )
idx.Primary = True
idx.Unique = True
idx.IgnoreNulls = False
Call AddFieldToIndex( "n_podchivki", False )
tdf.Indexes.Append idx
'=== Create primary key for table Polka ======
Set tdf = dbs.TableDefs( "Polka" )
Set idx = tdf.CreateIndex( "pk_Polka" )
idx.Primary = True
idx.Unique = True
idx.IgnoreNulls = False
Call AddFieldToIndex( "n_polki", False )
tdf.Indexes.Append idx
End Sub
' Create indexes
================
Sub CreateIndexes()
End Sub
Create alter keys (unique indexes in MS ACCESS)
'================================================
Sub CreateAlterKeys()
'=== Create alter keys (unique) for table Formyl_r ======
Set tdf = dbs.TableDefs( "Formyl_r" )
Set idx = tdf.CreateIndex( "Chet_k" )
idx.Unique = True
Call AddFieldToIndex( "Chet_k", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Sotrydniki ======
Set tdf = dbs.TableDefs( "Sotrydniki" )
Set idx = tdf.CreateIndex( "ID_sotrydnika" )
idx.Unique = True
Call AddFieldToIndex( "ID_sotrydnika", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Chitayel_ ======
Set tdf = dbs.TableDefs( "Chitayel_" )
Set idx = tdf.CreateIndex( "n_chit_bileta" )
idx.Unique = True
Call AddFieldToIndex( "n_chit_bileta", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Chitateli ======
Set tdf = dbs.TableDefs( "Chitateli" )
Set idx = tdf.CreateIndex( "ID_kategorii" )
idx.Unique = True
Call AddFieldToIndex( "ID_kategorii", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Chitat_zal ======
Set tdf = dbs.TableDefs( "Chitat_zal" )
Set idx = tdf.CreateIndex( "ID_zala" )
idx.Unique = True
Call AddFieldToIndex( "ID_zala", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table chitatel_v_zale ======
Set tdf = dbs.TableDefs( "chitatel_v_zale" )
Set idx = tdf.CreateIndex( "Chet_k" )
idx.Unique = True
Call AddFieldToIndex( "Chet_k", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Znania ======
Set tdf = dbs.TableDefs( "Znania" )
Set idx = tdf.CreateIndex( "kod_oblasti_znania" )
idx.Unique = True
Call AddFieldToIndex( "kod_oblasti_znania", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Ekzempl_knigi ======
Set tdf = dbs.TableDefs( "Ekzempl_knigi" )
Set idx = tdf.CreateIndex( "Invent_n" )
idx.Unique = True
Call AddFieldToIndex( "Invent_n", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Kniga_jyrnal_ ======
Set tdf = dbs.TableDefs( "Kniga_jyrnal_" )
Set idx = tdf.CreateIndex( "ID_knigi" )
idx.Unique = True
Call AddFieldToIndex( "ID_knigi", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Gazeta ======
Set tdf = dbs.TableDefs( "Gazeta" )
Set idx = tdf.CreateIndex( "ID_gazeta" )
idx.Unique = True
Call AddFieldToIndex( "ID_gazeta", False )
tdf.Indexes.Append idx
'=== Create alter keys (unique) for table Polka ======
Set tdf = dbs.TableDefs( "Polka" )
Set idx = tdf.CreateIndex( "n_polki" )
idx.Unique = True
Call AddFieldToIndex( "n_polki", False )
tdf.Indexes.Append idx
End Sub
' Create relations
'==================
Sub CreateRelations()
'=== Create relations between parent table Sotrydniki and child table Formyl_r ======
Set rel = dbs.CreateRelation("8")
rel.Table = "Sotrydniki"
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.