Code: Select all
PROC Main()
DBCREATE( "AInsTest", { { "FLD1", "+", 4, 0 } },,.T. )
FOR nRec := 1 TO 3
DBAPPEND()
NEXT
GO 2
REPL FLD1 WITH 10
RETU
Moderator: Rathinagiri
Code: Select all
PROC Main()
DBCREATE( "AInsTest", { { "FLD1", "+", 4, 0 } },,.T. )
FOR nRec := 1 TO 3
DBAPPEND()
NEXT
GO 2
REPL FLD1 WITH 10
RETU
Code: Select all
#include <hmg.ch>
Function Main
Local cRDD:="Clipper"
// "Harbour/FPT"
// DBCREATE( "AInsTest", { { "FLD1"+"+", 4, 0 } },"",.T. )
cToRDD:=If(cRDD="Harbour/FPT",'DBFCDX','DBFNTX')
If !File("AInsTest.Dbf")
DbCreate("AInsTest",{ { "FLD1", "+", 4, 0 } },cToRDD)
Endif
Use AInsTest
FOR nRec := 1 TO 3
DBAPPEND()
NEXT
GO Bottom
// REPLACE FLD1 WITH +10
MsgInfo(Str(FLD1))
Return
So, Ithink, once created autoinc field cannot be set by user.El 18/06/2012 15:31, Przemysław Czerpak escribió:
> Hi Juan,
>
> We do not have and fieldinfo actions which can be used to control
> autoincrement values (counter and step).
> I'll try to remember about it and them in the future.
>
> best regards,
> Przemek
>
>
> On Mon, 18 Jun 2012, Juan Gálvez wrote:
>> Any comments ?
>>
>> El 23/05/2012 16:49, Juan Gálvez escribió:
>>> Hi all, Przemek,
>>>
>>> Is there any DbFieldInfo() to set/get the counter and step values of
>>> autoinc fields (+) ?
>>>
>>> Many thanks
>>> Juan
Sorry for my weak English"NO ! as you see below sample, auto increment fields doesn't replaceable in Harbour".
Code: Select all
DBCREATE( "AInsTest", { { "FLD1"+"+", 4, 0 } },"",.T. )
Code: Select all
DBCREATE( "AInsTest", { { "FLD1"+"+", 4, 0 } },"DBFNTX",.T. )
Sorry for this long ( and mostly unnecessary ) speech. I like "chatting" with you"Please search through forum posts before writing on any subject."
Qatan wrote:AFAIK you can change the counter with
DbFieldInfo( DBS_COUNTER, 1, 10 )
DbAppend()
For prevent anyone to misunderstand :Pablo César wrote:#include "DBINFO.CH"
Use AInsTest
DbFieldInfo( DBS_COUNTER, 1, 10) // Reset count from number 10
DbFieldInfo( DBS_STEP, 1, 5) // Change counter from 5 to 5
FOR nRec := 1 TO 3
DBAPPEND()
NEXT