Автор Тема: MS Access и VB  (Прочитано 2100 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн alex007

  • Фанат форума
  • Ветеран
  • *****
  • Сообщений: 835
  • +0/-0
  • 0
    • Просмотр профиля
    • http://www.russians-in-london.co.uk/
MS Access и VB
« : 15 Октября 2002, 22:28:10 »
Есть скрипт

Declare variables
Dim dbs As database, tbl As TableDef, idx As Index
Dim fldIndex as Field, fld As Fields, fld2 As Field
Dim fld3 As Field

Assign the current database to the database variable.
Set dbs=CurrentDb

Create a new table and field, and assign them
to the table and field variables.
Set tbl=dbs.TableDefs("Cust")
Set fld=tbl.CreateField("Customer",dbBoolean)
Set fld2=tbl.CreateField("TAG",dbText, 25)

Set fld3=tbl.CreateField("ZONE",dbText, 50)[\\B] - как поменять только тип поля, а у меня здесь создает, а не меняет тип поля, хотя оно у меня уже есть в таблице???

Add the field to the table, then add the table to the database.
tbl.Fields.Append fld
tbl.Fields.Append fld2
tbl.Fields.Append fld3

With tbl
Create and append a new Index object to the Indexes collection of the new TableDef object.
Set idx=.CreateIndex("TAGIndex")
idx.Fields.Append idx.CreateField("TAG")
idx.Primary=True
.Indexes.Append idx

Жду ваших ответов.
С уважением
Алекс
Русские-в-Лондоне. Как они там? Интересно. Инфо (FAQ), Форум и Магазин

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28