In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Create Physical DBF files

Xailer professional forum in English
Responder
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

I tried to create a physical DBF file with the following but failed !
Any comment ?
METHOD Button1Click( oSender ) CLASS Tform1
Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
{"KEYFLD2", "D", 8, 0}, ;
{"FLD3", "C", 20, 0} }
Local cFile := "MyClient.DBF", lDbf
WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
:afields := afieldlist
END WITH
RETURN Nil
Thanks.
David
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
TDbfDataSet():Create() is a constructor of the DataSet object not the creator
of the dbf-file.
Use
DBCREATE(cFile,aFieldList)
to build a new database.
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>I tried to create a physical DBF file with the following but failed !
>Any comment ?
>
>METHOD Button1Click( oSender ) CLASS Tform1
> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
> {"KEYFLD2", "D", 8, 0}, ;
> {"FLD3", "C", 20, 0} }
> Local cFile := "MyClient.DBF", lDbf
>
> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
> :afields := afieldlist
> END WITH
>
>RETURN Nil
>
>
>Thanks.
>David
>
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
TDbfDataSet():Create() is a constructor of the DataSet object not the creator
of the dbf-file.
Use
DBCREATE(cFile,aFieldList)
to build a new database.
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>I tried to create a physical DBF file with the following but failed !
>Any comment ?
>
>METHOD Button1Click( oSender ) CLASS Tform1
> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
> {"KEYFLD2", "D", 8, 0}, ;
> {"FLD3", "C", 20, 0} }
> Local cFile := "MyClient.DBF", lDbf
>
> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
> :afields := afieldlist
> END WITH
>
>RETURN Nil
>
>
>Thanks.
>David
>
>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

Dear Ingo,
Will this code work when I use different RDD ? such as CDX & ADS ?
David
Ingo Junge-Herrmann wrote:
> David,
>
> TDbfDataSet():Create() is a constructor of the DataSet object not the creator
> of the dbf-file.
> Use
>
> DBCREATE(cFile,aFieldList)
>
> to build a new database.
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>> I tried to create a physical DBF file with the following but failed !
>> Any comment ?
>>
>> METHOD Button1Click( oSender ) CLASS Tform1
>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>> {"KEYFLD2", "D", 8, 0}, ;
>> {"FLD3", "C", 20, 0} }
>> Local cFile := "MyClient.DBF", lDbf
>>
>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>> :afields := afieldlist
>> END WITH
>>
>> RETURN Nil
>>
>>
>> Thanks.
>> David
>>
>>
>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

Dear Ingo,
Will this code work when I use different RDD ? such as CDX & ADS ?
David
Ingo Junge-Herrmann wrote:
> David,
>
> TDbfDataSet():Create() is a constructor of the DataSet object not the creator
> of the dbf-file.
> Use
>
> DBCREATE(cFile,aFieldList)
>
> to build a new database.
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>> I tried to create a physical DBF file with the following but failed !
>> Any comment ?
>>
>> METHOD Button1Click( oSender ) CLASS Tform1
>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>> {"KEYFLD2", "D", 8, 0}, ;
>> {"FLD3", "C", 20, 0} }
>> Local cFile := "MyClient.DBF", lDbf
>>
>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>> :afields := afieldlist
>> END WITH
>>
>> RETURN Nil
>>
>>
>> Thanks.
>> David
>>
>>
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
here is the documentation of DBCREATE()
DBCREATE()
Creates an empty database from a array.
Syntax
DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
[<cAlias>]) --> NIL
Arguments
<cDatabase> Name of database to be create
<aStruct> Name of a multidimensional array that contains the a database structure
<cDriver> Name of the RDD
<lOpenNew> 3-way toggle to Open the file in New or Current workarea:
NIL The file is not opened.
True It is opened in a New area.
False It is opened in the current area.
<cAlias> Name of database Alias
Returns
DBCREATE() always returns NIL.
Description
This function creates the database file specified as <cDatabase> from the
multidimensional array <aStruct>.If no file extension is use with <cDatabase>
the .DBF extension is assumed. The array specified in <aStruct> must follow
a few guidelines when being built prior to a call to DBCREATE():
- All subscripts values in the second dimension must be set to proper values
- The fourth subscript value in the second dimension - which contains the
decimal value-must he specified. even 1kw nonnumeric fields.
- The second subscript value in the second dimension-which contains the field
data type-must contain a proper value: C, D, L, M or N It is possible to
use additional letters (or clarity (e.g., 'Numeric' for 'N'): however, the
first letter of this array element must be a proper value.
The DBCREATE( ) function does not use the decimal field to calculate the
length of a character held longer than 256. Values up to the maximum length
of a character field (which is 65,519 bytes) are stored directly in the database
in the length attribute if that database was created via this function. However,
a file containing fields longer than 256 bytes is not compatible with any
interpreter.
The <cDriver> parameter specifies the name of the Replaceable Da- tabase
Driver to use to create the database. If it is not specified, then the Replaceable
Database Driver in the current work area is tised. The <lOpenNew> parameter
specifies if the already created database is to be opened, and where. If
NIL, the file is not opened. If True, it is opened in a New area, and if
False it is opened in the current area (closing any file already occupying
that area). The <cAlias> parameter specifies the alias name for the new opened
database
Examples
function main()
local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
{ "NUMERIC", "N", 8, 0 }, ;
{ "DOUBLE", "N", 8, 2 }, ;
{ "DATE", "D", 8, 0 }, ;
{ "LOGICAL", "L", 1, 0 }, ;
{ "MEMO1", "M", 10, 0 }, ;
{ "MEMO2", "M", 10, 0 } }
REQUEST DBFCDX
dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
RETURN NIL
Files
Library is rdd Header is Dbstruct.ch
Look at XailerxHarbourdocchmxHarbour.chm
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>Dear Ingo,
>
>Will this code work when I use different RDD ? such as CDX & ADS ?
>
>David
>
>
>Ingo Junge-Herrmann wrote:
>> David,
>>
>> TDbfDataSet():Create() is a constructor of the DataSet object not the
creator
>> of the dbf-file.
>> Use
>>
>> DBCREATE(cFile,aFieldList)
>>
>> to build a new database.
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>> I tried to create a physical DBF file with the following but failed !
>>> Any comment ?
>>>
>>> METHOD Button1Click( oSender ) CLASS Tform1
>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>> {"KEYFLD2", "D", 8, 0}, ;
>>> {"FLD3", "C", 20, 0} }
>>> Local cFile := "MyClient.DBF", lDbf
>>>
>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>> :afields := afieldlist
>>> END WITH
>>>
>>> RETURN Nil
>>>
>>>
>>> Thanks.
>>> David
>>>
>>>
>>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
here is the documentation of DBCREATE()
DBCREATE()
Creates an empty database from a array.
Syntax
DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
[<cAlias>]) --> NIL
Arguments
<cDatabase> Name of database to be create
<aStruct> Name of a multidimensional array that contains the a database structure
<cDriver> Name of the RDD
<lOpenNew> 3-way toggle to Open the file in New or Current workarea:
NIL The file is not opened.
True It is opened in a New area.
False It is opened in the current area.
<cAlias> Name of database Alias
Returns
DBCREATE() always returns NIL.
Description
This function creates the database file specified as <cDatabase> from the
multidimensional array <aStruct>.If no file extension is use with <cDatabase>
the .DBF extension is assumed. The array specified in <aStruct> must follow
a few guidelines when being built prior to a call to DBCREATE():
- All subscripts values in the second dimension must be set to proper values
- The fourth subscript value in the second dimension - which contains the
decimal value-must he specified. even 1kw nonnumeric fields.
- The second subscript value in the second dimension-which contains the field
data type-must contain a proper value: C, D, L, M or N It is possible to
use additional letters (or clarity (e.g., 'Numeric' for 'N'): however, the
first letter of this array element must be a proper value.
The DBCREATE( ) function does not use the decimal field to calculate the
length of a character held longer than 256. Values up to the maximum length
of a character field (which is 65,519 bytes) are stored directly in the database
in the length attribute if that database was created via this function. However,
a file containing fields longer than 256 bytes is not compatible with any
interpreter.
The <cDriver> parameter specifies the name of the Replaceable Da- tabase
Driver to use to create the database. If it is not specified, then the Replaceable
Database Driver in the current work area is tised. The <lOpenNew> parameter
specifies if the already created database is to be opened, and where. If
NIL, the file is not opened. If True, it is opened in a New area, and if
False it is opened in the current area (closing any file already occupying
that area). The <cAlias> parameter specifies the alias name for the new opened
database
Examples
function main()
local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
{ "NUMERIC", "N", 8, 0 }, ;
{ "DOUBLE", "N", 8, 2 }, ;
{ "DATE", "D", 8, 0 }, ;
{ "LOGICAL", "L", 1, 0 }, ;
{ "MEMO1", "M", 10, 0 }, ;
{ "MEMO2", "M", 10, 0 } }
REQUEST DBFCDX
dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
RETURN NIL
Files
Library is rdd Header is Dbstruct.ch
Look at XailerxHarbourdocchmxHarbour.chm
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>Dear Ingo,
>
>Will this code work when I use different RDD ? such as CDX & ADS ?
>
>David
>
>
>Ingo Junge-Herrmann wrote:
>> David,
>>
>> TDbfDataSet():Create() is a constructor of the DataSet object not the
creator
>> of the dbf-file.
>> Use
>>
>> DBCREATE(cFile,aFieldList)
>>
>> to build a new database.
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>> I tried to create a physical DBF file with the following but failed !
>>> Any comment ?
>>>
>>> METHOD Button1Click( oSender ) CLASS Tform1
>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>> {"KEYFLD2", "D", 8, 0}, ;
>>> {"FLD3", "C", 20, 0} }
>>> Local cFile := "MyClient.DBF", lDbf
>>>
>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>> :afields := afieldlist
>>> END WITH
>>>
>>> RETURN Nil
>>>
>>>
>>> Thanks.
>>> David
>>>
>>>
>>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

Thank you Ingo.
BTW, I don't seems to have the xHarbout.chm mentioned in
XailerxHarbourdocchmxHarbour.chm
Any idea where I could get it ? I don't even have the doc folder.
Thanks.
David
Ingo Junge-Herrmann wrote:
> David,
>
> here is the documentation of DBCREATE()
>
> DBCREATE()
> Creates an empty database from a array.
>
> Syntax
>
>
> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
> [<cAlias>]) --> NIL
>
> Arguments
>
>
> <cDatabase> Name of database to be create
>
>
> <aStruct> Name of a multidimensional array that contains the a database structure
>
>
>
> <cDriver> Name of the RDD
>
>
> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>
> NIL The file is not opened.
> True It is opened in a New area.
> False It is opened in the current area.
>
> <cAlias> Name of database Alias
>
> Returns
>
>
> DBCREATE() always returns NIL.
>
>
> Description
>
>
> This function creates the database file specified as <cDatabase> from the
> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
> the .DBF extension is assumed. The array specified in <aStruct> must follow
> a few guidelines when being built prior to a call to DBCREATE():
>
>
> - All subscripts values in the second dimension must be set to proper values
>
>
>
> - The fourth subscript value in the second dimension - which contains the
> decimal value-must he specified. even 1kw nonnumeric fields.
>
>
> - The second subscript value in the second dimension-which contains the field
> data type-must contain a proper value: C, D, L, M or N It is possible to
> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however, the
> first letter of this array element must be a proper value.
>
>
> The DBCREATE( ) function does not use the decimal field to calculate the
> length of a character held longer than 256. Values up to the maximum length
> of a character field (which is 65,519 bytes) are stored directly in the database
> in the length attribute if that database was created via this function. However,
> a file containing fields longer than 256 bytes is not compatible with any
> interpreter.
>
>
> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
> Driver to use to create the database. If it is not specified, then the Replaceable
> Database Driver in the current work area is tised. The <lOpenNew> parameter
> specifies if the already created database is to be opened, and where. If
> NIL, the file is not opened. If True, it is opened in a New area, and if
> False it is opened in the current area (closing any file already occupying
> that area). The <cAlias> parameter specifies the alias name for the new opened
> database
> Examples
> function main()
>
> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
> { "NUMERIC", "N", 8, 0 }, ;
> { "DOUBLE", "N", 8, 2 }, ;
> { "DATE", "D", 8, 0 }, ;
> { "LOGICAL", "L", 1, 0 }, ;
> { "MEMO1", "M", 10, 0 }, ;
> { "MEMO2", "M", 10, 0 } }
>
> REQUEST DBFCDX
>
> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>
> RETURN NIL
>
> Files
>
>
> Library is rdd Header is Dbstruct.ch
>
>
> Look at XailerxHarbourdocchmxHarbour.chm
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>> Dear Ingo,
>>
>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>
>> David
>>
>>
>> Ingo Junge-Herrmann wrote:
>>> David,
>>>
>>> TDbfDataSet():Create() is a constructor of the DataSet object not the
> creator
>>> of the dbf-file.
>>> Use
>>>
>>> DBCREATE(cFile,aFieldList)
>>>
>>> to build a new database.
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> david fung <davfung@yahoo.com> wrote:
>>>> I tried to create a physical DBF file with the following but failed !
>>>> Any comment ?
>>>>
>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>> {"FLD3", "C", 20, 0} }
>>>> Local cFile := "MyClient.DBF", lDbf
>>>>
>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>>> :afields := afieldlist
>>>> END WITH
>>>>
>>>> RETURN Nil
>>>>
>>>>
>>>> Thanks.
>>>> David
>>>>
>>>>
>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

Thank you Ingo.
BTW, I don't seems to have the xHarbout.chm mentioned in
XailerxHarbourdocchmxHarbour.chm
Any idea where I could get it ? I don't even have the doc folder.
Thanks.
David
Ingo Junge-Herrmann wrote:
> David,
>
> here is the documentation of DBCREATE()
>
> DBCREATE()
> Creates an empty database from a array.
>
> Syntax
>
>
> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
> [<cAlias>]) --> NIL
>
> Arguments
>
>
> <cDatabase> Name of database to be create
>
>
> <aStruct> Name of a multidimensional array that contains the a database structure
>
>
>
> <cDriver> Name of the RDD
>
>
> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>
> NIL The file is not opened.
> True It is opened in a New area.
> False It is opened in the current area.
>
> <cAlias> Name of database Alias
>
> Returns
>
>
> DBCREATE() always returns NIL.
>
>
> Description
>
>
> This function creates the database file specified as <cDatabase> from the
> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
> the .DBF extension is assumed. The array specified in <aStruct> must follow
> a few guidelines when being built prior to a call to DBCREATE():
>
>
> - All subscripts values in the second dimension must be set to proper values
>
>
>
> - The fourth subscript value in the second dimension - which contains the
> decimal value-must he specified. even 1kw nonnumeric fields.
>
>
> - The second subscript value in the second dimension-which contains the field
> data type-must contain a proper value: C, D, L, M or N It is possible to
> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however, the
> first letter of this array element must be a proper value.
>
>
> The DBCREATE( ) function does not use the decimal field to calculate the
> length of a character held longer than 256. Values up to the maximum length
> of a character field (which is 65,519 bytes) are stored directly in the database
> in the length attribute if that database was created via this function. However,
> a file containing fields longer than 256 bytes is not compatible with any
> interpreter.
>
>
> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
> Driver to use to create the database. If it is not specified, then the Replaceable
> Database Driver in the current work area is tised. The <lOpenNew> parameter
> specifies if the already created database is to be opened, and where. If
> NIL, the file is not opened. If True, it is opened in a New area, and if
> False it is opened in the current area (closing any file already occupying
> that area). The <cAlias> parameter specifies the alias name for the new opened
> database
> Examples
> function main()
>
> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
> { "NUMERIC", "N", 8, 0 }, ;
> { "DOUBLE", "N", 8, 2 }, ;
> { "DATE", "D", 8, 0 }, ;
> { "LOGICAL", "L", 1, 0 }, ;
> { "MEMO1", "M", 10, 0 }, ;
> { "MEMO2", "M", 10, 0 } }
>
> REQUEST DBFCDX
>
> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>
> RETURN NIL
>
> Files
>
>
> Library is rdd Header is Dbstruct.ch
>
>
> Look at XailerxHarbourdocchmxHarbour.chm
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>> Dear Ingo,
>>
>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>
>> David
>>
>>
>> Ingo Junge-Herrmann wrote:
>>> David,
>>>
>>> TDbfDataSet():Create() is a constructor of the DataSet object not the
> creator
>>> of the dbf-file.
>>> Use
>>>
>>> DBCREATE(cFile,aFieldList)
>>>
>>> to build a new database.
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> david fung <davfung@yahoo.com> wrote:
>>>> I tried to create a physical DBF file with the following but failed !
>>>> Any comment ?
>>>>
>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>> {"FLD3", "C", 20, 0} }
>>>> Local cFile := "MyClient.DBF", lDbf
>>>>
>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>>> :afields := afieldlist
>>>> END WITH
>>>>
>>>> RETURN Nil
>>>>
>>>>
>>>> Thanks.
>>>> David
>>>>
>>>>
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
I have downloaded and installed xHarbour last year from the Xailer's site:
http://www.xailer.com/files/xharbour.exe
I don't know if xHarbour.chm is nincluded yet.
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>Thank you Ingo.
>
>BTW, I don't seems to have the xHarbout.chm mentioned in
>
>XailerxHarbourdocchmxHarbour.chm
>
>Any idea where I could get it ? I don't even have the doc folder.
>
>Thanks.
>David
>
>
>
>
>Ingo Junge-Herrmann wrote:
>> David,
>>
>> here is the documentation of DBCREATE()
>>
>> DBCREATE()
>> Creates an empty database from a array.
>>
>> Syntax
>>
>>
>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>> [<cAlias>]) --> NIL
>>
>> Arguments
>>
>>
>> <cDatabase> Name of database to be create
>>
>>
>> <aStruct> Name of a multidimensional array that contains the a database
structure
>>
>>
>>
>> <cDriver> Name of the RDD
>>
>>
>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>
>> NIL The file is not opened.
>> True It is opened in a New area.
>> False It is opened in the current area.
>>
>> <cAlias> Name of database Alias
>>
>> Returns
>>
>>
>> DBCREATE() always returns NIL.
>>
>>
>> Description
>>
>>
>> This function creates the database file specified as <cDatabase> from
the
>> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
>> the .DBF extension is assumed. The array specified in <aStruct> must follow
>> a few guidelines when being built prior to a call to DBCREATE():
>>
>>
>> - All subscripts values in the second dimension must be set to proper
values
>>
>>
>>
>> - The fourth subscript value in the second dimension - which contains
the
>> decimal value-must he specified. even 1kw nonnumeric fields.
>>
>>
>> - The second subscript value in the second dimension-which contains the
field
>> data type-must contain a proper value: C, D, L, M or N It is possible
to
>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
the
>> first letter of this array element must be a proper value.
>>
>>
>> The DBCREATE( ) function does not use the decimal field to calculate the
>> length of a character held longer than 256. Values up to the maximum length
>> of a character field (which is 65,519 bytes) are stored directly in the
database
>> in the length attribute if that database was created via this function.
However,
>> a file containing fields longer than 256 bytes is not compatible with
any
>> interpreter.
>>
>>
>> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
>> Driver to use to create the database. If it is not specified, then the
Replaceable
>> Database Driver in the current work area is tised. The <lOpenNew> parameter
>> specifies if the already created database is to be opened, and where.
If
>> NIL, the file is not opened. If True, it is opened in a New area, and
if
>> False it is opened in the current area (closing any file already occupying
>> that area). The <cAlias> parameter specifies the alias name for the new
opened
>> database
>> Examples
>> function main()
>>
>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>> { "NUMERIC", "N", 8, 0 }, ;
>> { "DOUBLE", "N", 8, 2 }, ;
>> { "DATE", "D", 8, 0 }, ;
>> { "LOGICAL", "L", 1, 0 }, ;
>> { "MEMO1", "M", 10, 0 }, ;
>> { "MEMO2", "M", 10, 0 } }
>>
>> REQUEST DBFCDX
>>
>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>
>> RETURN NIL
>>
>> Files
>>
>>
>> Library is rdd Header is Dbstruct.ch
>>
>>
>> Look at XailerxHarbourdocchmxHarbour.chm
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>> Dear Ingo,
>>>
>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>
>>> David
>>>
>>>
>>> Ingo Junge-Herrmann wrote:
>>>> David,
>>>>
>>>> TDbfDataSet():Create() is a constructor of the DataSet object not the
>> creator
>>>> of the dbf-file.
>>>> Use
>>>>
>>>> DBCREATE(cFile,aFieldList)
>>>>
>>>> to build a new database.
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> david fung <davfung@yahoo.com> wrote:
>>>>> I tried to create a physical DBF file with the following but failed
!
>>>>> Any comment ?
>>>>>
>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>> {"FLD3", "C", 20, 0} }
>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>
>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>>>> :afields := afieldlist
>>>>> END WITH
>>>>>
>>>>> RETURN Nil
>>>>>
>>>>>
>>>>> Thanks.
>>>>> David
>>>>>
>>>>>
>>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
I have downloaded and installed xHarbour last year from the Xailer's site:
http://www.xailer.com/files/xharbour.exe
I don't know if xHarbour.chm is nincluded yet.
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>Thank you Ingo.
>
>BTW, I don't seems to have the xHarbout.chm mentioned in
>
>XailerxHarbourdocchmxHarbour.chm
>
>Any idea where I could get it ? I don't even have the doc folder.
>
>Thanks.
>David
>
>
>
>
>Ingo Junge-Herrmann wrote:
>> David,
>>
>> here is the documentation of DBCREATE()
>>
>> DBCREATE()
>> Creates an empty database from a array.
>>
>> Syntax
>>
>>
>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>> [<cAlias>]) --> NIL
>>
>> Arguments
>>
>>
>> <cDatabase> Name of database to be create
>>
>>
>> <aStruct> Name of a multidimensional array that contains the a database
structure
>>
>>
>>
>> <cDriver> Name of the RDD
>>
>>
>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>
>> NIL The file is not opened.
>> True It is opened in a New area.
>> False It is opened in the current area.
>>
>> <cAlias> Name of database Alias
>>
>> Returns
>>
>>
>> DBCREATE() always returns NIL.
>>
>>
>> Description
>>
>>
>> This function creates the database file specified as <cDatabase> from
the
>> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
>> the .DBF extension is assumed. The array specified in <aStruct> must follow
>> a few guidelines when being built prior to a call to DBCREATE():
>>
>>
>> - All subscripts values in the second dimension must be set to proper
values
>>
>>
>>
>> - The fourth subscript value in the second dimension - which contains
the
>> decimal value-must he specified. even 1kw nonnumeric fields.
>>
>>
>> - The second subscript value in the second dimension-which contains the
field
>> data type-must contain a proper value: C, D, L, M or N It is possible
to
>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
the
>> first letter of this array element must be a proper value.
>>
>>
>> The DBCREATE( ) function does not use the decimal field to calculate the
>> length of a character held longer than 256. Values up to the maximum length
>> of a character field (which is 65,519 bytes) are stored directly in the
database
>> in the length attribute if that database was created via this function.
However,
>> a file containing fields longer than 256 bytes is not compatible with
any
>> interpreter.
>>
>>
>> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
>> Driver to use to create the database. If it is not specified, then the
Replaceable
>> Database Driver in the current work area is tised. The <lOpenNew> parameter
>> specifies if the already created database is to be opened, and where.
If
>> NIL, the file is not opened. If True, it is opened in a New area, and
if
>> False it is opened in the current area (closing any file already occupying
>> that area). The <cAlias> parameter specifies the alias name for the new
opened
>> database
>> Examples
>> function main()
>>
>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>> { "NUMERIC", "N", 8, 0 }, ;
>> { "DOUBLE", "N", 8, 2 }, ;
>> { "DATE", "D", 8, 0 }, ;
>> { "LOGICAL", "L", 1, 0 }, ;
>> { "MEMO1", "M", 10, 0 }, ;
>> { "MEMO2", "M", 10, 0 } }
>>
>> REQUEST DBFCDX
>>
>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>
>> RETURN NIL
>>
>> Files
>>
>>
>> Library is rdd Header is Dbstruct.ch
>>
>>
>> Look at XailerxHarbourdocchmxHarbour.chm
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>> Dear Ingo,
>>>
>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>
>>> David
>>>
>>>
>>> Ingo Junge-Herrmann wrote:
>>>> David,
>>>>
>>>> TDbfDataSet():Create() is a constructor of the DataSet object not the
>> creator
>>>> of the dbf-file.
>>>> Use
>>>>
>>>> DBCREATE(cFile,aFieldList)
>>>>
>>>> to build a new database.
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> david fung <davfung@yahoo.com> wrote:
>>>>> I tried to create a physical DBF file with the following but failed
!
>>>>> Any comment ?
>>>>>
>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>> {"FLD3", "C", 20, 0} }
>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>
>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>>>> :afields := afieldlist
>>>>> END WITH
>>>>>
>>>>> RETURN Nil
>>>>>
>>>>>
>>>>> Thanks.
>>>>> David
>>>>>
>>>>>
>>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

I am using the same file
http://www.xailer.com/files/xharbour.exe
Does not include the doc folder.
David
Ingo Junge-Herrmann wrote:
> David,
>
> I have downloaded and installed xHarbour last year from the Xailer's site:
>
> http://www.xailer.com/files/xharbour.exe
>
> I don't know if xHarbour.chm is nincluded yet.
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>> Thank you Ingo.
>>
>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>
>> XailerxHarbourdocchmxHarbour.chm
>>
>> Any idea where I could get it ? I don't even have the doc folder.
>>
>> Thanks.
>> David
>>
>>
>>
>>
>> Ingo Junge-Herrmann wrote:
>>> David,
>>>
>>> here is the documentation of DBCREATE()
>>>
>>> DBCREATE()
>>> Creates an empty database from a array.
>>>
>>> Syntax
>>>
>>>
>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>> [<cAlias>]) --> NIL
>>>
>>> Arguments
>>>
>>>
>>> <cDatabase> Name of database to be create
>>>
>>>
>>> <aStruct> Name of a multidimensional array that contains the a database
> structure
>>>
>>>
>>> <cDriver> Name of the RDD
>>>
>>>
>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>>
>>> NIL The file is not opened.
>>> True It is opened in a New area.
>>> False It is opened in the current area.
>>>
>>> <cAlias> Name of database Alias
>>>
>>> Returns
>>>
>>>
>>> DBCREATE() always returns NIL.
>>>
>>>
>>> Description
>>>
>>>
>>> This function creates the database file specified as <cDatabase> from
> the
>>> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
>>> the .DBF extension is assumed. The array specified in <aStruct> must follow
>>> a few guidelines when being built prior to a call to DBCREATE():
>>>
>>>
>>> - All subscripts values in the second dimension must be set to proper
> values
>>>
>>>
>>> - The fourth subscript value in the second dimension - which contains
> the
>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>
>>>
>>> - The second subscript value in the second dimension-which contains the
> field
>>> data type-must contain a proper value: C, D, L, M or N It is possible
> to
>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
> the
>>> first letter of this array element must be a proper value.
>>>
>>>
>>> The DBCREATE( ) function does not use the decimal field to calculate the
>>> length of a character held longer than 256. Values up to the maximum length
>>> of a character field (which is 65,519 bytes) are stored directly in the
> database
>>> in the length attribute if that database was created via this function.
> However,
>>> a file containing fields longer than 256 bytes is not compatible with
> any
>>> interpreter.
>>>
>>>
>>> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
>>> Driver to use to create the database. If it is not specified, then the
> Replaceable
>>> Database Driver in the current work area is tised. The <lOpenNew> parameter
>>> specifies if the already created database is to be opened, and where.
> If
>>> NIL, the file is not opened. If True, it is opened in a New area, and
> if
>>> False it is opened in the current area (closing any file already occupying
>>> that area). The <cAlias> parameter specifies the alias name for the new
> opened
>>> database
>>> Examples
>>> function main()
>>>
>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>> { "NUMERIC", "N", 8, 0 }, ;
>>> { "DOUBLE", "N", 8, 2 }, ;
>>> { "DATE", "D", 8, 0 }, ;
>>> { "LOGICAL", "L", 1, 0 }, ;
>>> { "MEMO1", "M", 10, 0 }, ;
>>> { "MEMO2", "M", 10, 0 } }
>>>
>>> REQUEST DBFCDX
>>>
>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>
>>> RETURN NIL
>>>
>>> Files
>>>
>>>
>>> Library is rdd Header is Dbstruct.ch
>>>
>>>
>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> david fung <davfung@yahoo.com> wrote:
>>>> Dear Ingo,
>>>>
>>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>>
>>>> David
>>>>
>>>>
>>>> Ingo Junge-Herrmann wrote:
>>>>> David,
>>>>>
>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not the
>>> creator
>>>>> of the dbf-file.
>>>>> Use
>>>>>
>>>>> DBCREATE(cFile,aFieldList)
>>>>>
>>>>> to build a new database.
>>>>>
>>>>> Regards
>>>>>
>>>>> Ingo
>>>>>
>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>> I tried to create a physical DBF file with the following but failed
> !
>>>>>> Any comment ?
>>>>>>
>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>> {"FLD3", "C", 20, 0} }
>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>
>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>>>>> :afields := afieldlist
>>>>>> END WITH
>>>>>>
>>>>>> RETURN Nil
>>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>> David
>>>>>>
>>>>>>
>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Create Physical DBF files

Mensaje por david fung »

I am using the same file
http://www.xailer.com/files/xharbour.exe
Does not include the doc folder.
David
Ingo Junge-Herrmann wrote:
> David,
>
> I have downloaded and installed xHarbour last year from the Xailer's site:
>
> http://www.xailer.com/files/xharbour.exe
>
> I don't know if xHarbour.chm is nincluded yet.
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>> Thank you Ingo.
>>
>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>
>> XailerxHarbourdocchmxHarbour.chm
>>
>> Any idea where I could get it ? I don't even have the doc folder.
>>
>> Thanks.
>> David
>>
>>
>>
>>
>> Ingo Junge-Herrmann wrote:
>>> David,
>>>
>>> here is the documentation of DBCREATE()
>>>
>>> DBCREATE()
>>> Creates an empty database from a array.
>>>
>>> Syntax
>>>
>>>
>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>> [<cAlias>]) --> NIL
>>>
>>> Arguments
>>>
>>>
>>> <cDatabase> Name of database to be create
>>>
>>>
>>> <aStruct> Name of a multidimensional array that contains the a database
> structure
>>>
>>>
>>> <cDriver> Name of the RDD
>>>
>>>
>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>>
>>> NIL The file is not opened.
>>> True It is opened in a New area.
>>> False It is opened in the current area.
>>>
>>> <cAlias> Name of database Alias
>>>
>>> Returns
>>>
>>>
>>> DBCREATE() always returns NIL.
>>>
>>>
>>> Description
>>>
>>>
>>> This function creates the database file specified as <cDatabase> from
> the
>>> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
>>> the .DBF extension is assumed. The array specified in <aStruct> must follow
>>> a few guidelines when being built prior to a call to DBCREATE():
>>>
>>>
>>> - All subscripts values in the second dimension must be set to proper
> values
>>>
>>>
>>> - The fourth subscript value in the second dimension - which contains
> the
>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>
>>>
>>> - The second subscript value in the second dimension-which contains the
> field
>>> data type-must contain a proper value: C, D, L, M or N It is possible
> to
>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
> the
>>> first letter of this array element must be a proper value.
>>>
>>>
>>> The DBCREATE( ) function does not use the decimal field to calculate the
>>> length of a character held longer than 256. Values up to the maximum length
>>> of a character field (which is 65,519 bytes) are stored directly in the
> database
>>> in the length attribute if that database was created via this function.
> However,
>>> a file containing fields longer than 256 bytes is not compatible with
> any
>>> interpreter.
>>>
>>>
>>> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
>>> Driver to use to create the database. If it is not specified, then the
> Replaceable
>>> Database Driver in the current work area is tised. The <lOpenNew> parameter
>>> specifies if the already created database is to be opened, and where.
> If
>>> NIL, the file is not opened. If True, it is opened in a New area, and
> if
>>> False it is opened in the current area (closing any file already occupying
>>> that area). The <cAlias> parameter specifies the alias name for the new
> opened
>>> database
>>> Examples
>>> function main()
>>>
>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>> { "NUMERIC", "N", 8, 0 }, ;
>>> { "DOUBLE", "N", 8, 2 }, ;
>>> { "DATE", "D", 8, 0 }, ;
>>> { "LOGICAL", "L", 1, 0 }, ;
>>> { "MEMO1", "M", 10, 0 }, ;
>>> { "MEMO2", "M", 10, 0 } }
>>>
>>> REQUEST DBFCDX
>>>
>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>
>>> RETURN NIL
>>>
>>> Files
>>>
>>>
>>> Library is rdd Header is Dbstruct.ch
>>>
>>>
>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> david fung <davfung@yahoo.com> wrote:
>>>> Dear Ingo,
>>>>
>>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>>
>>>> David
>>>>
>>>>
>>>> Ingo Junge-Herrmann wrote:
>>>>> David,
>>>>>
>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not the
>>> creator
>>>>> of the dbf-file.
>>>>> Use
>>>>>
>>>>> DBCREATE(cFile,aFieldList)
>>>>>
>>>>> to build a new database.
>>>>>
>>>>> Regards
>>>>>
>>>>> Ingo
>>>>>
>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>> I tried to create a physical DBF file with the following but failed
> !
>>>>>> Any comment ?
>>>>>>
>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>> {"FLD3", "C", 20, 0} }
>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>
>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource, cFile)
>>>>>> :afields := afieldlist
>>>>>> END WITH
>>>>>>
>>>>>> RETURN Nil
>>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>> David
>>>>>>
>>>>>>
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
maybe the Xailer's people can help you to get this documentation.
A good online documentation you can find on the xHarbour.com site:
http://www.xharbour.com/xhdn/index.asp? ... 19&show_su b=1
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>I am using the same file
>
>http://www.xailer.com/files/xharbour.exe
>
>Does not include the doc folder.
>
>David
>
>
>
>
>Ingo Junge-Herrmann wrote:
>> David,
>>
>> I have downloaded and installed xHarbour last year from the Xailer's site:
>>
>> http://www.xailer.com/files/xharbour.exe
>>
>> I don't know if xHarbour.chm is nincluded yet.
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>> Thank you Ingo.
>>>
>>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>>
>>> XailerxHarbourdocchmxHarbour.chm
>>>
>>> Any idea where I could get it ? I don't even have the doc folder.
>>>
>>> Thanks.
>>> David
>>>
>>>
>>>
>>>
>>> Ingo Junge-Herrmann wrote:
>>>> David,
>>>>
>>>> here is the documentation of DBCREATE()
>>>>
>>>> DBCREATE()
>>>> Creates an empty database from a array.
>>>>
>>>> Syntax
>>>>
>>>>
>>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>>> [<cAlias>]) --> NIL
>>>>
>>>> Arguments
>>>>
>>>>
>>>> <cDatabase> Name of database to be create
>>>>
>>>>
>>>> <aStruct> Name of a multidimensional array that contains the a database
>> structure
>>>>
>>>>
>>>> <cDriver> Name of the RDD
>>>>
>>>>
>>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>>>
>>>> NIL The file is not opened.
>>>> True It is opened in a New area.
>>>> False It is opened in the current area.
>>>>
>>>> <cAlias> Name of database Alias
>>>>
>>>> Returns
>>>>
>>>>
>>>> DBCREATE() always returns NIL.
>>>>
>>>>
>>>> Description
>>>>
>>>>
>>>> This function creates the database file specified as <cDatabase> from
>> the
>>>> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
>>>> the .DBF extension is assumed. The array specified in <aStruct> must
follow
>>>> a few guidelines when being built prior to a call to DBCREATE():
>>>>
>>>>
>>>> - All subscripts values in the second dimension must be set to proper
>> values
>>>>
>>>>
>>>> - The fourth subscript value in the second dimension - which contains
>> the
>>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>>
>>>>
>>>> - The second subscript value in the second dimension-which contains
the
>> field
>>>> data type-must contain a proper value: C, D, L, M or N It is possible
>> to
>>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
>> the
>>>> first letter of this array element must be a proper value.
>>>>
>>>>
>>>> The DBCREATE( ) function does not use the decimal field to calculate
the
>>>> length of a character held longer than 256. Values up to the maximum
length
>>>> of a character field (which is 65,519 bytes) are stored directly in
the
>> database
>>>> in the length attribute if that database was created via this function.
>> However,
>>>> a file containing fields longer than 256 bytes is not compatible with
>> any
>>>> interpreter.
>>>>
>>>>
>>>> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
>>>> Driver to use to create the database. If it is not specified, then the
>> Replaceable
>>>> Database Driver in the current work area is tised. The <lOpenNew> parameter
>>>> specifies if the already created database is to be opened, and where.
>> If
>>>> NIL, the file is not opened. If True, it is opened in a New area, and
>> if
>>>> False it is opened in the current area (closing any file already occupying
>>>> that area). The <cAlias> parameter specifies the alias name for the
new
>> opened
>>>> database
>>>> Examples
>>>> function main()
>>>>
>>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>>> { "NUMERIC", "N", 8, 0 }, ;
>>>> { "DOUBLE", "N", 8, 2 }, ;
>>>> { "DATE", "D", 8, 0 }, ;
>>>> { "LOGICAL", "L", 1, 0 }, ;
>>>> { "MEMO1", "M", 10, 0 }, ;
>>>> { "MEMO2", "M", 10, 0 } }
>>>>
>>>> REQUEST DBFCDX
>>>>
>>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>>
>>>> RETURN NIL
>>>>
>>>> Files
>>>>
>>>>
>>>> Library is rdd Header is Dbstruct.ch
>>>>
>>>>
>>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> david fung <davfung@yahoo.com> wrote:
>>>>> Dear Ingo,
>>>>>
>>>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>>>
>>>>> David
>>>>>
>>>>>
>>>>> Ingo Junge-Herrmann wrote:
>>>>>> David,
>>>>>>
>>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not
the
>>>> creator
>>>>>> of the dbf-file.
>>>>>> Use
>>>>>>
>>>>>> DBCREATE(cFile,aFieldList)
>>>>>>
>>>>>> to build a new database.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Ingo
>>>>>>
>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>> I tried to create a physical DBF file with the following but failed
>> !
>>>>>>> Any comment ?
>>>>>>>
>>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>>> {"FLD3", "C", 20, 0} }
>>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>>
>>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource,
cFile)
>>>>>>> :afields := afieldlist
>>>>>>> END WITH
>>>>>>>
>>>>>>> RETURN Nil
>>>>>>>
>>>>>>>
>>>>>>> Thanks.
>>>>>>> David
>>>>>>>
>>>>>>>
>>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

David,
maybe the Xailer's people can help you to get this documentation.
A good online documentation you can find on the xHarbour.com site:
http://www.xharbour.com/xhdn/index.asp? ... 19&show_su b=1
Regards
Ingo
david fung <davfung@yahoo.com> wrote:
>I am using the same file
>
>http://www.xailer.com/files/xharbour.exe
>
>Does not include the doc folder.
>
>David
>
>
>
>
>Ingo Junge-Herrmann wrote:
>> David,
>>
>> I have downloaded and installed xHarbour last year from the Xailer's site:
>>
>> http://www.xailer.com/files/xharbour.exe
>>
>> I don't know if xHarbour.chm is nincluded yet.
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>> Thank you Ingo.
>>>
>>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>>
>>> XailerxHarbourdocchmxHarbour.chm
>>>
>>> Any idea where I could get it ? I don't even have the doc folder.
>>>
>>> Thanks.
>>> David
>>>
>>>
>>>
>>>
>>> Ingo Junge-Herrmann wrote:
>>>> David,
>>>>
>>>> here is the documentation of DBCREATE()
>>>>
>>>> DBCREATE()
>>>> Creates an empty database from a array.
>>>>
>>>> Syntax
>>>>
>>>>
>>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>>> [<cAlias>]) --> NIL
>>>>
>>>> Arguments
>>>>
>>>>
>>>> <cDatabase> Name of database to be create
>>>>
>>>>
>>>> <aStruct> Name of a multidimensional array that contains the a database
>> structure
>>>>
>>>>
>>>> <cDriver> Name of the RDD
>>>>
>>>>
>>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>>>
>>>> NIL The file is not opened.
>>>> True It is opened in a New area.
>>>> False It is opened in the current area.
>>>>
>>>> <cAlias> Name of database Alias
>>>>
>>>> Returns
>>>>
>>>>
>>>> DBCREATE() always returns NIL.
>>>>
>>>>
>>>> Description
>>>>
>>>>
>>>> This function creates the database file specified as <cDatabase> from
>> the
>>>> multidimensional array <aStruct>.If no file extension is use with <cDatabase>
>>>> the .DBF extension is assumed. The array specified in <aStruct> must
follow
>>>> a few guidelines when being built prior to a call to DBCREATE():
>>>>
>>>>
>>>> - All subscripts values in the second dimension must be set to proper
>> values
>>>>
>>>>
>>>> - The fourth subscript value in the second dimension - which contains
>> the
>>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>>
>>>>
>>>> - The second subscript value in the second dimension-which contains
the
>> field
>>>> data type-must contain a proper value: C, D, L, M or N It is possible
>> to
>>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
>> the
>>>> first letter of this array element must be a proper value.
>>>>
>>>>
>>>> The DBCREATE( ) function does not use the decimal field to calculate
the
>>>> length of a character held longer than 256. Values up to the maximum
length
>>>> of a character field (which is 65,519 bytes) are stored directly in
the
>> database
>>>> in the length attribute if that database was created via this function.
>> However,
>>>> a file containing fields longer than 256 bytes is not compatible with
>> any
>>>> interpreter.
>>>>
>>>>
>>>> The <cDriver> parameter specifies the name of the Replaceable Da- tabase
>>>> Driver to use to create the database. If it is not specified, then the
>> Replaceable
>>>> Database Driver in the current work area is tised. The <lOpenNew> parameter
>>>> specifies if the already created database is to be opened, and where.
>> If
>>>> NIL, the file is not opened. If True, it is opened in a New area, and
>> if
>>>> False it is opened in the current area (closing any file already occupying
>>>> that area). The <cAlias> parameter specifies the alias name for the
new
>> opened
>>>> database
>>>> Examples
>>>> function main()
>>>>
>>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>>> { "NUMERIC", "N", 8, 0 }, ;
>>>> { "DOUBLE", "N", 8, 2 }, ;
>>>> { "DATE", "D", 8, 0 }, ;
>>>> { "LOGICAL", "L", 1, 0 }, ;
>>>> { "MEMO1", "M", 10, 0 }, ;
>>>> { "MEMO2", "M", 10, 0 } }
>>>>
>>>> REQUEST DBFCDX
>>>>
>>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>>
>>>> RETURN NIL
>>>>
>>>> Files
>>>>
>>>>
>>>> Library is rdd Header is Dbstruct.ch
>>>>
>>>>
>>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> david fung <davfung@yahoo.com> wrote:
>>>>> Dear Ingo,
>>>>>
>>>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>>>
>>>>> David
>>>>>
>>>>>
>>>>> Ingo Junge-Herrmann wrote:
>>>>>> David,
>>>>>>
>>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not
the
>>>> creator
>>>>>> of the dbf-file.
>>>>>> Use
>>>>>>
>>>>>> DBCREATE(cFile,aFieldList)
>>>>>>
>>>>>> to build a new database.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Ingo
>>>>>>
>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>> I tried to create a physical DBF file with the following but failed
>> !
>>>>>>> Any comment ?
>>>>>>>
>>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>>> {"FLD3", "C", 20, 0} }
>>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>>
>>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource,
cFile)
>>>>>>> :afields := afieldlist
>>>>>>> END WITH
>>>>>>>
>>>>>>> RETURN Nil
>>>>>>>
>>>>>>>
>>>>>>> Thanks.
>>>>>>> David
>>>>>>>
>>>>>>>
>>
_support_
Mensajes: 146
Registrado: Lun Abr 10, 2006 1:29 pm

Create Physical DBF files

Mensaje por _support_ »

Ingo,
I suggest you use any Clipper 5.2 documentation. That will cover the 90% of
xHarbour documentation. The 10% rest wich are the extensions to the language
maybe can be found at xharbour.com
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:452f4053$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>
> David,
> maybe the Xailer's people can help you to get this documentation.
>
> A good online documentation you can find on the xHarbour.com site:
> http://www.xharbour.com/xhdn/index.asp? ... 19&show_su b=1
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>>I am using the same file
>>
>>http://www.xailer.com/files/xharbour.exe
>>
>>Does not include the doc folder.
>>
>>David
>>
>>
>>
>>
>>Ingo Junge-Herrmann wrote:
>>> David,
>>>
>>> I have downloaded and installed xHarbour last year from the Xailer's
>>> site:
>>>
>>> http://www.xailer.com/files/xharbour.exe
>>>
>>> I don't know if xHarbour.chm is nincluded yet.
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> david fung <davfung@yahoo.com> wrote:
>>>> Thank you Ingo.
>>>>
>>>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>>>
>>>> XailerxHarbourdocchmxHarbour.chm
>>>>
>>>> Any idea where I could get it ? I don't even have the doc folder.
>>>>
>>>> Thanks.
>>>> David
>>>>
>>>>
>>>>
>>>>
>>>> Ingo Junge-Herrmann wrote:
>>>>> David,
>>>>>
>>>>> here is the documentation of DBCREATE()
>>>>>
>>>>> DBCREATE()
>>>>> Creates an empty database from a array.
>>>>>
>>>>> Syntax
>>>>>
>>>>>
>>>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>>>> [<cAlias>]) --> NIL
>>>>>
>>>>> Arguments
>>>>>
>>>>>
>>>>> <cDatabase> Name of database to be create
>>>>>
>>>>>
>>>>> <aStruct> Name of a multidimensional array that contains the a
>>>>> database
>>> structure
>>>>>
>>>>>
>>>>> <cDriver> Name of the RDD
>>>>>
>>>>>
>>>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>
>>>>>
>>>>> NIL The file is not opened.
>>>>> True It is opened in a New area.
>>>>> False It is opened in the current area.
>>>>>
>>>>> <cAlias> Name of database Alias
>>>>>
>>>>> Returns
>>>>>
>>>>>
>>>>> DBCREATE() always returns NIL.
>>>>>
>>>>>
>>>>> Description
>>>>>
>>>>>
>>>>> This function creates the database file specified as <cDatabase> from
>>> the
>>>>> multidimensional array <aStruct>.If no file extension is use with
>>>>> <cDatabase>
>>>>> the .DBF extension is assumed. The array specified in <aStruct> must
> follow
>>>>> a few guidelines when being built prior to a call to DBCREATE():
>>>>>
>>>>>
>>>>> - All subscripts values in the second dimension must be set to proper
>>> values
>>>>>
>>>>>
>>>>> - The fourth subscript value in the second dimension - which contains
>>> the
>>>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>>>
>>>>>
>>>>> - The second subscript value in the second dimension-which contains
> the
>>> field
>>>>> data type-must contain a proper value: C, D, L, M or N It is possible
>>> to
>>>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
>>> the
>>>>> first letter of this array element must be a proper value.
>>>>>
>>>>>
>>>>> The DBCREATE( ) function does not use the decimal field to calculate
> the
>>>>> length of a character held longer than 256. Values up to the maximum
> length
>>>>> of a character field (which is 65,519 bytes) are stored directly in
> the
>>> database
>>>>> in the length attribute if that database was created via this
>>>>> function.
>>> However,
>>>>> a file containing fields longer than 256 bytes is not compatible with
>>> any
>>>>> interpreter.
>>>>>
>>>>>
>>>>> The <cDriver> parameter specifies the name of the Replaceable Da-
>>>>> tabase
>>>>> Driver to use to create the database. If it is not specified, then the
>>> Replaceable
>>>>> Database Driver in the current work area is tised. The <lOpenNew>
>>>>> parameter
>>>>> specifies if the already created database is to be opened, and where.
>>> If
>>>>> NIL, the file is not opened. If True, it is opened in a New area, and
>>> if
>>>>> False it is opened in the current area (closing any file already
>>>>> occupying
>>>>> that area). The <cAlias> parameter specifies the alias name for the
> new
>>> opened
>>>>> database
>>>>> Examples
>>>>> function main()
>>>>>
>>>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>>>> { "NUMERIC", "N", 8, 0 }, ;
>>>>> { "DOUBLE", "N", 8, 2 }, ;
>>>>> { "DATE", "D", 8, 0 }, ;
>>>>> { "LOGICAL", "L", 1, 0 }, ;
>>>>> { "MEMO1", "M", 10, 0 }, ;
>>>>> { "MEMO2", "M", 10, 0 } }
>>>>>
>>>>> REQUEST DBFCDX
>>>>>
>>>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>>>
>>>>> RETURN NIL
>>>>>
>>>>> Files
>>>>>
>>>>>
>>>>> Library is rdd Header is Dbstruct.ch
>>>>>
>>>>>
>>>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>>>
>>>>> Regards
>>>>>
>>>>> Ingo
>>>>>
>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>> Dear Ingo,
>>>>>>
>>>>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>>>>
>>>>>> David
>>>>>>
>>>>>>
>>>>>> Ingo Junge-Herrmann wrote:
>>>>>>> David,
>>>>>>>
>>>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not
> the
>>>>> creator
>>>>>>> of the dbf-file.
>>>>>>> Use
>>>>>>>
>>>>>>> DBCREATE(cFile,aFieldList)
>>>>>>>
>>>>>>> to build a new database.
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Ingo
>>>>>>>
>>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>>> I tried to create a physical DBF file with the following but failed
>>> !
>>>>>>>> Any comment ?
>>>>>>>>
>>>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>>>> {"FLD3", "C", 20, 0} }
>>>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>>>
>>>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource,
> cFile)
>>>>>>>> :afields := afieldlist
>>>>>>>> END WITH
>>>>>>>>
>>>>>>>> RETURN Nil
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>> David
>>>>>>>>
>>>>>>>>
>>>
>
_support_
Mensajes: 146
Registrado: Lun Abr 10, 2006 1:29 pm

Create Physical DBF files

Mensaje por _support_ »

Ingo,
I suggest you use any Clipper 5.2 documentation. That will cover the 90% of
xHarbour documentation. The 10% rest wich are the extensions to the language
maybe can be found at xharbour.com
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:452f4053$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>
> David,
> maybe the Xailer's people can help you to get this documentation.
>
> A good online documentation you can find on the xHarbour.com site:
> http://www.xharbour.com/xhdn/index.asp? ... 19&show_su b=1
>
> Regards
>
> Ingo
>
> david fung <davfung@yahoo.com> wrote:
>>I am using the same file
>>
>>http://www.xailer.com/files/xharbour.exe
>>
>>Does not include the doc folder.
>>
>>David
>>
>>
>>
>>
>>Ingo Junge-Herrmann wrote:
>>> David,
>>>
>>> I have downloaded and installed xHarbour last year from the Xailer's
>>> site:
>>>
>>> http://www.xailer.com/files/xharbour.exe
>>>
>>> I don't know if xHarbour.chm is nincluded yet.
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> david fung <davfung@yahoo.com> wrote:
>>>> Thank you Ingo.
>>>>
>>>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>>>
>>>> XailerxHarbourdocchmxHarbour.chm
>>>>
>>>> Any idea where I could get it ? I don't even have the doc folder.
>>>>
>>>> Thanks.
>>>> David
>>>>
>>>>
>>>>
>>>>
>>>> Ingo Junge-Herrmann wrote:
>>>>> David,
>>>>>
>>>>> here is the documentation of DBCREATE()
>>>>>
>>>>> DBCREATE()
>>>>> Creates an empty database from a array.
>>>>>
>>>>> Syntax
>>>>>
>>>>>
>>>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>>>> [<cAlias>]) --> NIL
>>>>>
>>>>> Arguments
>>>>>
>>>>>
>>>>> <cDatabase> Name of database to be create
>>>>>
>>>>>
>>>>> <aStruct> Name of a multidimensional array that contains the a
>>>>> database
>>> structure
>>>>>
>>>>>
>>>>> <cDriver> Name of the RDD
>>>>>
>>>>>
>>>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>
>>>>>
>>>>> NIL The file is not opened.
>>>>> True It is opened in a New area.
>>>>> False It is opened in the current area.
>>>>>
>>>>> <cAlias> Name of database Alias
>>>>>
>>>>> Returns
>>>>>
>>>>>
>>>>> DBCREATE() always returns NIL.
>>>>>
>>>>>
>>>>> Description
>>>>>
>>>>>
>>>>> This function creates the database file specified as <cDatabase> from
>>> the
>>>>> multidimensional array <aStruct>.If no file extension is use with
>>>>> <cDatabase>
>>>>> the .DBF extension is assumed. The array specified in <aStruct> must
> follow
>>>>> a few guidelines when being built prior to a call to DBCREATE():
>>>>>
>>>>>
>>>>> - All subscripts values in the second dimension must be set to proper
>>> values
>>>>>
>>>>>
>>>>> - The fourth subscript value in the second dimension - which contains
>>> the
>>>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>>>
>>>>>
>>>>> - The second subscript value in the second dimension-which contains
> the
>>> field
>>>>> data type-must contain a proper value: C, D, L, M or N It is possible
>>> to
>>>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
>>> the
>>>>> first letter of this array element must be a proper value.
>>>>>
>>>>>
>>>>> The DBCREATE( ) function does not use the decimal field to calculate
> the
>>>>> length of a character held longer than 256. Values up to the maximum
> length
>>>>> of a character field (which is 65,519 bytes) are stored directly in
> the
>>> database
>>>>> in the length attribute if that database was created via this
>>>>> function.
>>> However,
>>>>> a file containing fields longer than 256 bytes is not compatible with
>>> any
>>>>> interpreter.
>>>>>
>>>>>
>>>>> The <cDriver> parameter specifies the name of the Replaceable Da-
>>>>> tabase
>>>>> Driver to use to create the database. If it is not specified, then the
>>> Replaceable
>>>>> Database Driver in the current work area is tised. The <lOpenNew>
>>>>> parameter
>>>>> specifies if the already created database is to be opened, and where.
>>> If
>>>>> NIL, the file is not opened. If True, it is opened in a New area, and
>>> if
>>>>> False it is opened in the current area (closing any file already
>>>>> occupying
>>>>> that area). The <cAlias> parameter specifies the alias name for the
> new
>>> opened
>>>>> database
>>>>> Examples
>>>>> function main()
>>>>>
>>>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>>>> { "NUMERIC", "N", 8, 0 }, ;
>>>>> { "DOUBLE", "N", 8, 2 }, ;
>>>>> { "DATE", "D", 8, 0 }, ;
>>>>> { "LOGICAL", "L", 1, 0 }, ;
>>>>> { "MEMO1", "M", 10, 0 }, ;
>>>>> { "MEMO2", "M", 10, 0 } }
>>>>>
>>>>> REQUEST DBFCDX
>>>>>
>>>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>>>
>>>>> RETURN NIL
>>>>>
>>>>> Files
>>>>>
>>>>>
>>>>> Library is rdd Header is Dbstruct.ch
>>>>>
>>>>>
>>>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>>>
>>>>> Regards
>>>>>
>>>>> Ingo
>>>>>
>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>> Dear Ingo,
>>>>>>
>>>>>> Will this code work when I use different RDD ? such as CDX & ADS ?
>>>>>>
>>>>>> David
>>>>>>
>>>>>>
>>>>>> Ingo Junge-Herrmann wrote:
>>>>>>> David,
>>>>>>>
>>>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not
> the
>>>>> creator
>>>>>>> of the dbf-file.
>>>>>>> Use
>>>>>>>
>>>>>>> DBCREATE(cFile,aFieldList)
>>>>>>>
>>>>>>> to build a new database.
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Ingo
>>>>>>>
>>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>>> I tried to create a physical DBF file with the following but failed
>>> !
>>>>>>>> Any comment ?
>>>>>>>>
>>>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>>>> {"FLD3", "C", 20, 0} }
>>>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>>>
>>>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource,
> cFile)
>>>>>>>> :afields := afieldlist
>>>>>>>> END WITH
>>>>>>>>
>>>>>>>> RETURN Nil
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>> David
>>>>>>>>
>>>>>>>>
>>>
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

Ignacio,
sorry you mistook me with David Fung. He was asking for help. I think he
isn't coming from Clipper but from FoxPro.
I'm coming from Clipper and I'm using the Clipper 5.2 documentation.
Regards
Ingo
"Ignacio Ortiz de Zúñiga" <_support_@xailer.com> wrote:
>Ingo,
>
>I suggest you use any Clipper 5.2 documentation. That will cover the 90%
of
>xHarbour documentation. The 10% rest wich are the extensions to the language
>maybe can be found at xharbour.com
>
>Regards,
>
>
>"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
>news:452f4053$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>>
>> David,
>> maybe the Xailer's people can help you to get this documentation.
>>
>> A good online documentation you can find on the xHarbour.com site:
>> http://www.xharbour.com/xhdn/index.asp? ... 19&show_su b=1
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>>I am using the same file
>>>
>>>http://www.xailer.com/files/xharbour.exe
>>>
>>>Does not include the doc folder.
>>>
>>>David
>>>
>>>
>>>
>>>
>>>Ingo Junge-Herrmann wrote:
>>>> David,
>>>>
>>>> I have downloaded and installed xHarbour last year from the Xailer's
>>>> site:
>>>>
>>>> http://www.xailer.com/files/xharbour.exe
>>>>
>>>> I don't know if xHarbour.chm is nincluded yet.
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> david fung <davfung@yahoo.com> wrote:
>>>>> Thank you Ingo.
>>>>>
>>>>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>>>>
>>>>> XailerxHarbourdocchmxHarbour.chm
>>>>>
>>>>> Any idea where I could get it ? I don't even have the doc folder.
>>>>>
>>>>> Thanks.
>>>>> David
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Ingo Junge-Herrmann wrote:
>>>>>> David,
>>>>>>
>>>>>> here is the documentation of DBCREATE()
>>>>>>
>>>>>> DBCREATE()
>>>>>> Creates an empty database from a array.
>>>>>>
>>>>>> Syntax
>>>>>>
>>>>>>
>>>>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>>>>> [<cAlias>]) --> NIL
>>>>>>
>>>>>> Arguments
>>>>>>
>>>>>>
>>>>>> <cDatabase> Name of database to be create
>>>>>>
>>>>>>
>>>>>> <aStruct> Name of a multidimensional array that contains the a
>>>>>> database
>>>> structure
>>>>>>
>>>>>>
>>>>>> <cDriver> Name of the RDD
>>>>>>
>>>>>>
>>>>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>
>>>>>>
>>>>>> NIL The file is not opened.
>>>>>> True It is opened in a New area.
>>>>>> False It is opened in the current area.
>>>>>>
>>>>>> <cAlias> Name of database Alias
>>>>>>
>>>>>> Returns
>>>>>>
>>>>>>
>>>>>> DBCREATE() always returns NIL.
>>>>>>
>>>>>>
>>>>>> Description
>>>>>>
>>>>>>
>>>>>> This function creates the database file specified as <cDatabase> from
>>>> the
>>>>>> multidimensional array <aStruct>.If no file extension is use with
>>>>>> <cDatabase>
>>>>>> the .DBF extension is assumed. The array specified in <aStruct> must
>> follow
>>>>>> a few guidelines when being built prior to a call to DBCREATE():
>>>>>>
>>>>>>
>>>>>> - All subscripts values in the second dimension must be set to proper
>>>> values
>>>>>>
>>>>>>
>>>>>> - The fourth subscript value in the second dimension - which contains
>>>> the
>>>>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>>>>
>>>>>>
>>>>>> - The second subscript value in the second dimension-which contains
>> the
>>>> field
>>>>>> data type-must contain a proper value: C, D, L, M or N It is possible
>>>> to
>>>>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
>>>> the
>>>>>> first letter of this array element must be a proper value.
>>>>>>
>>>>>>
>>>>>> The DBCREATE( ) function does not use the decimal field to calculate
>> the
>>>>>> length of a character held longer than 256. Values up to the maximum
>> length
>>>>>> of a character field (which is 65,519 bytes) are stored directly in
>> the
>>>> database
>>>>>> in the length attribute if that database was created via this
>>>>>> function.
>>>> However,
>>>>>> a file containing fields longer than 256 bytes is not compatible with
>>>> any
>>>>>> interpreter.
>>>>>>
>>>>>>
>>>>>> The <cDriver> parameter specifies the name of the Replaceable Da-
>>>>>> tabase
>>>>>> Driver to use to create the database. If it is not specified, then
the
>>>> Replaceable
>>>>>> Database Driver in the current work area is tised. The <lOpenNew>
>>>>>> parameter
>>>>>> specifies if the already created database is to be opened, and where.
>>>> If
>>>>>> NIL, the file is not opened. If True, it is opened in a New area,
and
>>>> if
>>>>>> False it is opened in the current area (closing any file already
>>>>>> occupying
>>>>>> that area). The <cAlias> parameter specifies the alias name for the
>> new
>>>> opened
>>>>>> database
>>>>>> Examples
>>>>>> function main()
>>>>>>
>>>>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>>>>> { "NUMERIC", "N", 8, 0 }, ;
>>>>>> { "DOUBLE", "N", 8, 2 }, ;
>>>>>> { "DATE", "D", 8, 0 }, ;
>>>>>> { "LOGICAL", "L", 1, 0 }, ;
>>>>>> { "MEMO1", "M", 10, 0 }, ;
>>>>>> { "MEMO2", "M", 10, 0 } }
>>>>>>
>>>>>> REQUEST DBFCDX
>>>>>>
>>>>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>>>>
>>>>>> RETURN NIL
>>>>>>
>>>>>> Files
>>>>>>
>>>>>>
>>>>>> Library is rdd Header is Dbstruct.ch
>>>>>>
>>>>>>
>>>>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Ingo
>>>>>>
>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>> Dear Ingo,
>>>>>>>
>>>>>>> Will this code work when I use different RDD ? such as CDX & ADS
?
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>>
>>>>>>> Ingo Junge-Herrmann wrote:
>>>>>>>> David,
>>>>>>>>
>>>>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not
>> the
>>>>>> creator
>>>>>>>> of the dbf-file.
>>>>>>>> Use
>>>>>>>>
>>>>>>>> DBCREATE(cFile,aFieldList)
>>>>>>>>
>>>>>>>> to build a new database.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Ingo
>>>>>>>>
>>>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>>>> I tried to create a physical DBF file with the following but failed
>>>> !
>>>>>>>>> Any comment ?
>>>>>>>>>
>>>>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>>>>> {"FLD3", "C", 20, 0} }
>>>>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>>>>
>>>>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource,
>> cFile)
>>>>>>>>> :afields := afieldlist
>>>>>>>>> END WITH
>>>>>>>>>
>>>>>>>>> RETURN Nil
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>>
>>>>
>>
>
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Create Physical DBF files

Mensaje por Ingo Junge-Herrmann »

Ignacio,
sorry you mistook me with David Fung. He was asking for help. I think he
isn't coming from Clipper but from FoxPro.
I'm coming from Clipper and I'm using the Clipper 5.2 documentation.
Regards
Ingo
"Ignacio Ortiz de Zúñiga" <_support_@xailer.com> wrote:
>Ingo,
>
>I suggest you use any Clipper 5.2 documentation. That will cover the 90%
of
>xHarbour documentation. The 10% rest wich are the extensions to the language
>maybe can be found at xharbour.com
>
>Regards,
>
>
>"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
>news:452f4053$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>>
>> David,
>> maybe the Xailer's people can help you to get this documentation.
>>
>> A good online documentation you can find on the xHarbour.com site:
>> http://www.xharbour.com/xhdn/index.asp? ... 19&show_su b=1
>>
>> Regards
>>
>> Ingo
>>
>> david fung <davfung@yahoo.com> wrote:
>>>I am using the same file
>>>
>>>http://www.xailer.com/files/xharbour.exe
>>>
>>>Does not include the doc folder.
>>>
>>>David
>>>
>>>
>>>
>>>
>>>Ingo Junge-Herrmann wrote:
>>>> David,
>>>>
>>>> I have downloaded and installed xHarbour last year from the Xailer's
>>>> site:
>>>>
>>>> http://www.xailer.com/files/xharbour.exe
>>>>
>>>> I don't know if xHarbour.chm is nincluded yet.
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> david fung <davfung@yahoo.com> wrote:
>>>>> Thank you Ingo.
>>>>>
>>>>> BTW, I don't seems to have the xHarbout.chm mentioned in
>>>>>
>>>>> XailerxHarbourdocchmxHarbour.chm
>>>>>
>>>>> Any idea where I could get it ? I don't even have the doc folder.
>>>>>
>>>>> Thanks.
>>>>> David
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Ingo Junge-Herrmann wrote:
>>>>>> David,
>>>>>>
>>>>>> here is the documentation of DBCREATE()
>>>>>>
>>>>>> DBCREATE()
>>>>>> Creates an empty database from a array.
>>>>>>
>>>>>> Syntax
>>>>>>
>>>>>>
>>>>>> DBCREATE(<cDatabase>, <aStruct>,[<cDriver>],[<lOpen>],
>>>>>> [<cAlias>]) --> NIL
>>>>>>
>>>>>> Arguments
>>>>>>
>>>>>>
>>>>>> <cDatabase> Name of database to be create
>>>>>>
>>>>>>
>>>>>> <aStruct> Name of a multidimensional array that contains the a
>>>>>> database
>>>> structure
>>>>>>
>>>>>>
>>>>>> <cDriver> Name of the RDD
>>>>>>
>>>>>>
>>>>>> <lOpenNew> 3-way toggle to Open the file in New or Current workarea:
>>
>>>>>>
>>>>>> NIL The file is not opened.
>>>>>> True It is opened in a New area.
>>>>>> False It is opened in the current area.
>>>>>>
>>>>>> <cAlias> Name of database Alias
>>>>>>
>>>>>> Returns
>>>>>>
>>>>>>
>>>>>> DBCREATE() always returns NIL.
>>>>>>
>>>>>>
>>>>>> Description
>>>>>>
>>>>>>
>>>>>> This function creates the database file specified as <cDatabase> from
>>>> the
>>>>>> multidimensional array <aStruct>.If no file extension is use with
>>>>>> <cDatabase>
>>>>>> the .DBF extension is assumed. The array specified in <aStruct> must
>> follow
>>>>>> a few guidelines when being built prior to a call to DBCREATE():
>>>>>>
>>>>>>
>>>>>> - All subscripts values in the second dimension must be set to proper
>>>> values
>>>>>>
>>>>>>
>>>>>> - The fourth subscript value in the second dimension - which contains
>>>> the
>>>>>> decimal value-must he specified. even 1kw nonnumeric fields.
>>>>>>
>>>>>>
>>>>>> - The second subscript value in the second dimension-which contains
>> the
>>>> field
>>>>>> data type-must contain a proper value: C, D, L, M or N It is possible
>>>> to
>>>>>> use additional letters (or clarity (e.g., 'Numeric' for 'N'): however,
>>>> the
>>>>>> first letter of this array element must be a proper value.
>>>>>>
>>>>>>
>>>>>> The DBCREATE( ) function does not use the decimal field to calculate
>> the
>>>>>> length of a character held longer than 256. Values up to the maximum
>> length
>>>>>> of a character field (which is 65,519 bytes) are stored directly in
>> the
>>>> database
>>>>>> in the length attribute if that database was created via this
>>>>>> function.
>>>> However,
>>>>>> a file containing fields longer than 256 bytes is not compatible with
>>>> any
>>>>>> interpreter.
>>>>>>
>>>>>>
>>>>>> The <cDriver> parameter specifies the name of the Replaceable Da-
>>>>>> tabase
>>>>>> Driver to use to create the database. If it is not specified, then
the
>>>> Replaceable
>>>>>> Database Driver in the current work area is tised. The <lOpenNew>
>>>>>> parameter
>>>>>> specifies if the already created database is to be opened, and where.
>>>> If
>>>>>> NIL, the file is not opened. If True, it is opened in a New area,
and
>>>> if
>>>>>> False it is opened in the current area (closing any file already
>>>>>> occupying
>>>>>> that area). The <cAlias> parameter specifies the alias name for the
>> new
>>>> opened
>>>>>> database
>>>>>> Examples
>>>>>> function main()
>>>>>>
>>>>>> local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
>>>>>> { "NUMERIC", "N", 8, 0 }, ;
>>>>>> { "DOUBLE", "N", 8, 2 }, ;
>>>>>> { "DATE", "D", 8, 0 }, ;
>>>>>> { "LOGICAL", "L", 1, 0 }, ;
>>>>>> { "MEMO1", "M", 10, 0 }, ;
>>>>>> { "MEMO2", "M", 10, 0 } }
>>>>>>
>>>>>> REQUEST DBFCDX
>>>>>>
>>>>>> dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )
>>>>>>
>>>>>> RETURN NIL
>>>>>>
>>>>>> Files
>>>>>>
>>>>>>
>>>>>> Library is rdd Header is Dbstruct.ch
>>>>>>
>>>>>>
>>>>>> Look at XailerxHarbourdocchmxHarbour.chm
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Ingo
>>>>>>
>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>> Dear Ingo,
>>>>>>>
>>>>>>> Will this code work when I use different RDD ? such as CDX & ADS
?
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>>
>>>>>>> Ingo Junge-Herrmann wrote:
>>>>>>>> David,
>>>>>>>>
>>>>>>>> TDbfDataSet():Create() is a constructor of the DataSet object not
>> the
>>>>>> creator
>>>>>>>> of the dbf-file.
>>>>>>>> Use
>>>>>>>>
>>>>>>>> DBCREATE(cFile,aFieldList)
>>>>>>>>
>>>>>>>> to build a new database.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Ingo
>>>>>>>>
>>>>>>>> david fung <davfung@yahoo.com> wrote:
>>>>>>>>> I tried to create a physical DBF file with the following but failed
>>>> !
>>>>>>>>> Any comment ?
>>>>>>>>>
>>>>>>>>> METHOD Button1Click( oSender ) CLASS Tform1
>>>>>>>>> Local afieldlist := { {"KEYFLD1", "C", 10, 0}, ;
>>>>>>>>> {"KEYFLD2", "D", 8, 0}, ;
>>>>>>>>> {"FLD3", "C", 20, 0} }
>>>>>>>>> Local cFile := "MyClient.DBF", lDbf
>>>>>>>>>
>>>>>>>>> WITH OBJECT lDBF := TDbfDataSet():Create(Self, ::oDataSource,
>> cFile)
>>>>>>>>> :afields := afieldlist
>>>>>>>>> END WITH
>>>>>>>>>
>>>>>>>>> RETURN Nil
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>>
>>>>
>>
>
>
Responder