cNameNew server-side name.
AdvPL GuideDBCreate( <cName>, <aStruct>, [cDriver] )Defines a new table and its field structure.
DBCreate accepts a name, schema and optional RDD. Each field specifies name, type, length and decimals; creating does not open an alias. Driver choice affects limits and persistence, and documentation restricts creation to the server. The example prepares an uninvoked action for a new file in an existing test directory. Do not use DBCreate to modify the dictionary or replace Protheus tables. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)
DBCreate( <cName>, <aStruct>, [cDriver] )cNameNew server-side name.
aStructFields: name, type, length, decimals.
cDriverRDD; omission uses configured local driver.
Not formalized by the page; failures raise errors rather than an assumed logical return.
#Include "Protheus.ch"
User Function Ed328()
Local aFields := {{"ED_COD", "C", 10, 0}}
Local bCreate
// Test directory must exist on the server without this file.
bCreate := {|| DBCreate("ednova.dbf", aFields, "DBFCDX")}
Return NilAction prepared without file creation. ED_COD identifies the fixed teaching schema. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.