Hello,
I would like to know please how to support in RDDADS "T" fields, which work perfect with xHarbour.
Thank you very much. Best regards
Here is a sample. With DBFCDX it creates the dbf, but not with RDDADS:

include "ads.ch"

REQUEST HB_Lang_ES REQUEST HB_CODEPAGE_ESWIN

//----------------------------------------------------------------------------- FUNCTION MAIN() //-----------------------------------------------------------------------------

LOCAL aStruct, cFichero, nRet := 0

// Idioma español para Harbour HB_LangSelect("ES") // Para mensajes, fechas, etc.. HB_CDPSELECT("ESWIN") // Para ordenación, requiere CodePage.lib

REQUEST DBFCDX, DBFFPT Request ADS,ADSKeyCount,ADSKeyNo,OrdKeyCount,OrdKeyNo, AdsGetRelKeyPos, AdsSetRelKeyPos

RddRegister( "ADS", 1 ) RddSetDefault( "ADS" )

adsSetServerType( 1 ) // ó ADS_LOCAL_SERVER

//setting up the file types adsSetFileType( ADS_CDX )

// resto de sets AdsRightsCheck( .F. ) SET DELETED ON

aStruct := { { "NAME", "C", 15, 0 },; { "DATE", "D", 08, 0 },; { "TIME", "T", 08, 0 },; { "TEXTO", "C", 50, 0 } }

cFichero := hb_dirbase() + "MOISES.DBF" FErase( cFichero )

nRet := DbCreate( cFichero, aStruct ) //, "DBFCDX" ) Alert( "DbCreate() " + cValToChar( nRet ) )

USE &cFichero NEW APPEND BLANK

REPLACE FIELD->NAME WITH "Test Moises" REPLACE FIELD->DATE WITH Date() REPLACE FIELD->TEXTO WITH "Bla bla bla" DbGoTop()

Browse()

DbCloseAll()

QUIT

RETURN NIL

asked 21 Nov '14, 02:19

Moises's gravatar image

Moises
11112
accept rate: 0%

edited 21 Nov '14, 02:47

Joachim%20Duerr's gravatar image

Joachim Duerr
8.7k1031133

Thank you. I will follow in the future.

Reinaldo, can you please tell me which ADS version are you using?.

(22 Nov '14, 03:21) Moises

TIME is not part of standard, extended or VFP field types. There's a timestamp (date+time) supported for VFP 9 style DBF. ADS supports DBF up to DBase III+ or VFP9.
Please find here a list of supported field types: http://devzone.advantagedatabase.com/dz/webhelp/Advantage11.1/index.html?master_dbf_field_types_and_specifications.htm

link

answered 21 Nov '14, 02:51

Joachim%20Duerr's gravatar image

Joachim Duerr
8.7k1031133
accept rate: 18%

Thank you.

So, with dbcreate() function, how I indicate to make a TimeStamp field?.

link

answered 21 Nov '14, 03:03

Moises's gravatar image

Moises
11112
accept rate: 0%

first of all, you need to select a different table type (is ADS_VFP supported)? Regarding the field type: I don't know how it is implemented in Harbour. You might find the definition in the header files.

(21 Nov '14, 03:21) Joachim Duerr

The following works for me:

aStruct := { { "NAME", "C", 15, 0 },; { "DATE", "D", 08, 0 },; { "TIME", "TIMESTAMP", 08, 0 },; { "TEXTO", "C", 50, 0 } }

(21 Nov '14, 07:23) Jack
1

Table type being created by this code is .adt not dbfs. Notice he is already setting default table type to .adt before executing the dbcreate() func. I no longer use dbcreate() function and instead I'm using SQL syntax, thus I might remember incorrectly, but I think the only change needed to his code is changing the field type from "T" to "TimeStamp". I'm assuming his version of rddads.lib and ace32.lib being linked are recent ones.

(21 Nov '14, 09:25) Reinaldo

Jack,

Thank you.

Do you use DBF or ADT tables?.

link

answered 21 Nov '14, 07:50

Moises's gravatar image

Moises
11112
accept rate: 0%

Moises;

I think you only need to change this line:

 { "TIME", "T", 08, 0 },;

For this:

 { "TIME", "TimeStamp", 08, 0 },;

That should create your .adt table with the field "Time" as a timestamp field. Try it.

link

answered 21 Nov '14, 09:19

Reinaldo's gravatar image

Reinaldo
816202346
accept rate: 6%

Reinaldo,

I am afraid it is failing.

Do you use DBFs or ADTs tables?.

And which version of ADS are you using?.

Thank you very much!:

(21 Nov '14, 09:54) Moises

By "failing" you mean that the .adt table is not being created? I tested the code. It works perfectly. I use ADS 10 and 11. Why would you ask if I'm using dbfs? dbfs can not use timestamp fields, therefore dbfs are not an option here. Only .adt and extended vfp tables can.

(21 Nov '14, 11:00) Reinaldo

I see thank you.

I need to use DBF tables with this feature, it seems it is not possible.

(21 Nov '14, 11:17) Moises

Just FYI- the way this forum works you should post this as a comment not as an answer. It works better for everyone that way. Take a look at other questions you'll see what I mean. No big deal. Hopefully someone with permissions will edit all these answers and reformat as comments.

(21 Nov '14, 11:22) Reinaldo
Your answer to the original question.
If responding to a request for additional information, please edit the question or use the comment functionality.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×20

Asked: 21 Nov '14, 02:19

Seen: 3,607 times

Last updated: 22 Nov '14, 03:21

Advantage Developer Zone Contact Us Privacy Policy Copyright Info


Powered by Advantage Database Server and OSQA
Disclaimer: Opinions expressed here are those of the poster and do not necessarily reflect the views of the company.