CreateField - method of the PmaDatabase object
Description:
Creates the column in the table structure.
Syntax:
Boolean CreateField(String sName, Long nType, Long nSize)
Parameters:
sName | (String) Column name |
nType | (Long) Data type of the column
1 - Boolean
2 - Byte
3 - Integer
4 - Long
6 - Single (4-byte real number)
7 - Double (8-byte real number)
8 - Date (Date and time)
11 - LongBinary
12 - Memo |
nSize | (Long) The size of the column. It is entered only if the parameter nType=10. Otherwise has no meaning. |
---|
Return value:
true - If the column of the database table was successfully created
false - Otherwise
Note:
By repeating the method the desired structure of the database table can be created.
This method
is not functional if the "
Technology" configurator is set to
Access through ODBC. In this case to create the table it is necessary to use the
MS SQL language and call the
Execute method for the command execution.
Example1:
JavaScriptVBScriptSelect and copy to clipboard
var bCreateField = oDb.CreateField("note", 10, 50);
Dim bCreateField
bCreateField = oDb.CreateField("note", 10, 50)
Example2:
See the example in the description of the
Create method