Sub CreateTableX1()
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase(".mdb")
' Create a table with two text fields.
dbs.Execute "CREATE TABLE ThisTable " _
& "(FirstName CHAR, LastName CHAR, " _
dbs.Close
End Sub
Sub CreateTableX2()
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase(".mdb")
' Create a table with three fields and a unique
' index made up of all three fields.
dbs.Execute "CREATE TABLE MyTable " _
& "(FirstName CHAR, LastName CHAR, " _
& "[DateOfBirth] DATETIME, " _
& "CONSTRAINT MyTableConstraint UNIQUE " _
& "(FirstName, LastName, [DateOfBirth]));"
dbs.Close
End Sub
Sub CreateTableX3()
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase(".mdb")
' Create a table with three fields and a ^primary
' key.
dbs.Execute "CREATE TABLE NewTable " _
& "(FirstName CHAR, LastName CHAR, " _
& "SSN INTEGER CONSTRAINT MyFieldConstraint " _
& "PRIMARY KEY);"
dbs.Close
End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question"CREATE TABLE NewTable " _
& "(FirstName CHAR, LastName CHAR, " _
& "SSN INTEGER CONSTRAINT MyFieldConstraint " _
& "PRIMARY KEY);"