Xbasic
SQL::SchemaAddTable Method
Syntax
L AddTable(Table as SQL::TableInfo)
Arguments
- SQL::Schema
A SQL::Schema created with a DIM statement.
- Table
A SQL::TableInfo object that defines the new table to create.
Description
Add a Table.
Discussion
The AddTable() method adds a table to a database.
Example
This example shows how to copy a table.
dim conn as SQL::Connection
dim ti as SQL::TableInfo
dim sch as SQL::Schema
connString = "{A5API='Access', FileName='c:\program files\a5v8\mdbfiles\alphasports.mdb'}"
if .not. conn.open(connString)
ui_msg_box("Error", conn.CallResult.text)
end
end if
if .not. conn.GetTableInfo(ti, "customer")
ui_msg_box("Error", conn.CallResult.text)
conn.close()
end
end if
ti.name = "CustomerCopy"
sch.AddTable(ti)
ui_msg_box("Tables", conn.ListTables())
conn.close()See Also