📄 creatingtables.htm
字号:
<html>
<head>
<title>Creating and Deleting Tables</title>
</head>
<!--#include virtual="/inc/header.php"-->
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#FFFFFF">
<tr>
<td align="left">
<span style="font-family:Helvetica,Arial; font-size:12pt; color:#000000"><b>Creating and Deleting Tables
<br>
</b><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><a href=createtableexample.htm>Example</a></span><span style="font-family:Helvetica,Arial; font-size:12pt; color:#000000"><b>
<br>
</b></span></span>
</td>
<td align="right">
<font face="Arial" size="2">
<a href="creatingdatabases.htm">Previous</a>
<a href="overview.htm">Top</a>
<a href="openingdatabases.htm">Next</a>
</font>
</td>
</tr>
</table>
<br><br>
<span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
<b>Creating tables
<br>
</b>
<br>
Use Absolute Database DBManager utility (...\AbsoluteDatabase\Ultils\Bin\DBManager.exe), if you would like to create table manually.
<br>
<br>
To create table from your application, you could perform the following steps:
<br>
<span style="font-family:Helvetica,Arial; font-size:4pt; color:#000000">
<br>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:4pt; color:#000000"></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">1.</span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>Place </b><b><a href=tabsdatabase.htm>TABSDatabase</a></b><b> and </b><b><a href=tabstable.htm>TABSTable</a></b><b> components</b> <span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">from the "Absolute DB" page of the Component palette to a data module or on a form.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">2.</span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>Set up TABSDatabase component</b>. <span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">Set the </span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">TABSDatabase.<span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=tabsdatabase_databasename.htm>DatabaseName</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"> of the component to a unique value that will be used later to identify the database. Set the </span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">TABSDatabase.<span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=tabsdatabase_databasefilename.htm>DatabaseFileName</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"> property to the name of the existing or new database file.
<br>
</span></span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">3.</span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>Set up TABSTable component. </b>Set the <span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">TABSTable.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=tabsdataset_databasename.htm>DatabaseName</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"> property from the drop-down list of available TABSDatabase components. Set the TABSTable.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=tabstable_tablename.htm>TableName</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"> property to the name of the table to create.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">4.</span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><b>Specify the Fields to Create. </b></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">Set the TABSTable.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=tdataset_fielddefs.htm>FieldDefs</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"> property with the design-time editor or from the application code. </span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=specifyingthefieldstocreat.htm>More details...</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">
<br>
</span></span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">5.</span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><b>Specify the Indexes to Create (optional). </b></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">Set the TABSTable.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=tabstable_indexdefs.htm>IndexDefs</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"> property with the design-time editor or from the application code. </span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><a href=specifyingtheindexestocrea.htm>More details...</a></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">6.</span></span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100"><b>Make sure that database file is created. </b></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#010100">Check TABSDatabase.Exists property and call to the TABSDatabase.CreateDatabase if the database file doesn't exist.</span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">7.</span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>Call TABSTable.CreateTable</b> method.
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">See also the <a href=createtableexample.htm>Create Table Example</a> and <a href=createtablestatement.htm>CREATE TABLE</a> SQL command.
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">If you want to create more than one table, don't forget to call TABSTable.AdvFieldDefs.Clear and TABSTable.AdvFieldDefs.Clear before creating the new table to avoid creation of table with the old structure.
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>
<br>
</b></span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b></b></span></td><td></td></tr></table><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>Deleting tables
<br>
<br>
</b>To delete table from the application code, use TABSTable.<a href=tabstable_deletetable.htm>DeleteTable</a> method.</span><span style="font-family:Courier New; font-size:8pt; color:#000000">
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><b>
<br>
</b>
<br>
</span></span>
<!--#include virtual="/inc/footer.php"-->
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -