ADOSERVER strange error on Append: nFieldPosition Invalid or Missing
Posted: Sun Dec 05, 2021 11:51 pm
I´ve been going through some corruption of sorts using VO2ADO, VO 2.8 sp4b, with [hide]MS SQL 2008 tables... very strange, the error occurs doing simple statements like ADOSERVER:APPEND or FIELDGET and the trapped error using a codeblock to trap the event reads:
[20936] iPointer=1, instantiating oServer
[20936] error trap, append failed, error: nFieldPosition invalid or missing
[20936] ERROR IN NOIVARGET USED
The error occurs when the server is instantiated but the error also occurs calling any method for this server, Append, FieldPut...
local oServer as adoserver
local cbErr as codeblock
cbErr := ErrorBlock({|oErr|_Break(oErr)})
BEGIN SEQUENCE
oServer := BillingTransactions{nil, oConn1, nil, nil, nil }
RECOVER USING uError
oLog:WriteLine( "Could not open oServer, Error: "+uError:description )
Server declaration:
CLASS BillingTransactions INHERIT AdoServer
//{{%UC%}} USER CODE STARTS HERE (do NOT remove this line)
METHOD INIT(sSource, uConn, nCursorType, nLockType, nOptions ) CLASS BillingTransactions
LOCAL i,nFields AS DWORD
LOCAL aFieldDesc AS ARRAY
LOCAL nPos AS INT
LOCAL nMaxRecords AS LONG
LOCAL sRecnoColumn AS STRING
LOCAL lLongFldNam AS LOGIC
LOCAL sStatement AS STRING
//
// Elements of SQL statement
// TableName : BillingTransactions
// ColumnList :
// WhereClause :
// OrderByClause :
//
IF IsNil(sSource)
// Build Select statement
sStatement := "Select * from BillingTransactions"
sSource := sStatement
ENDIF
lLongFldNam := TRUE
nMaxRecords := 0x7FFFFFFF
sRecnoColumn := ""
IF IsNil(nCursorType)
nCursorType := adOpenStatic
ENDIF
IF IsNil(nLockType)
nLockType := adLockOptimistic
ENDIF
IF IsNil(uConn)
uConn := AdoGetConnection()
// The connection in the AdoServer Editor was; ClientConnector
ENDIF
SELF:PreInit()
SUPER:INIT(sSource, uConn, nCursorType, nLockType, nOptions, lLongFldNam)
oHyperLabel := HyperLabel{#BillingTransactions, "BillingTransactions, "BillingTransactions, NULL_STRING}
IF oHLStatus = NIL
nFields := ALen(aFieldDesc := SELF:FieldDesc)
FOR i:=1 UPTO nFields
nPos := SELF:FieldPos( aFieldDesc[DBC_NAME] )
SELF:SetDataField( nPos,;
DataField{aFieldDesc[DBC_SYMBOL],aFieldDesc[DBC_FIELDSPEC]} )
NEXT
SELF:GoTop()
ENDIF
SELF:PostInit()
[/hide]
RETURN SELF
This makes VO2ADO unusable at this point, ADOSERVERs failed selectively, some fail, otthers operate normallly, I can't get a handle on what is going on. HELP
Thanks
[20936] iPointer=1, instantiating oServer
[20936] error trap, append failed, error: nFieldPosition invalid or missing
[20936] ERROR IN NOIVARGET USED
The error occurs when the server is instantiated but the error also occurs calling any method for this server, Append, FieldPut...
local oServer as adoserver
local cbErr as codeblock
cbErr := ErrorBlock({|oErr|_Break(oErr)})
BEGIN SEQUENCE
oServer := BillingTransactions{nil, oConn1, nil, nil, nil }
RECOVER USING uError
oLog:WriteLine( "Could not open oServer, Error: "+uError:description )
Server declaration:
CLASS BillingTransactions INHERIT AdoServer
//{{%UC%}} USER CODE STARTS HERE (do NOT remove this line)
METHOD INIT(sSource, uConn, nCursorType, nLockType, nOptions ) CLASS BillingTransactions
LOCAL i,nFields AS DWORD
LOCAL aFieldDesc AS ARRAY
LOCAL nPos AS INT
LOCAL nMaxRecords AS LONG
LOCAL sRecnoColumn AS STRING
LOCAL lLongFldNam AS LOGIC
LOCAL sStatement AS STRING
//
// Elements of SQL statement
// TableName : BillingTransactions
// ColumnList :
// WhereClause :
// OrderByClause :
//
IF IsNil(sSource)
// Build Select statement
sStatement := "Select * from BillingTransactions"
sSource := sStatement
ENDIF
lLongFldNam := TRUE
nMaxRecords := 0x7FFFFFFF
sRecnoColumn := ""
IF IsNil(nCursorType)
nCursorType := adOpenStatic
ENDIF
IF IsNil(nLockType)
nLockType := adLockOptimistic
ENDIF
IF IsNil(uConn)
uConn := AdoGetConnection()
// The connection in the AdoServer Editor was; ClientConnector
ENDIF
SELF:PreInit()
SUPER:INIT(sSource, uConn, nCursorType, nLockType, nOptions, lLongFldNam)
oHyperLabel := HyperLabel{#BillingTransactions, "BillingTransactions, "BillingTransactions, NULL_STRING}
IF oHLStatus = NIL
nFields := ALen(aFieldDesc := SELF:FieldDesc)
FOR i:=1 UPTO nFields
nPos := SELF:FieldPos( aFieldDesc[DBC_NAME] )
SELF:SetDataField( nPos,;
DataField{aFieldDesc[DBC_SYMBOL],aFieldDesc[DBC_FIELDSPEC]} )
NEXT
SELF:GoTop()
ENDIF
SELF:PostInit()
[/hide]
RETURN SELF
This makes VO2ADO unusable at this point, ADOSERVERs failed selectively, some fail, otthers operate normallly, I can't get a handle on what is going on. HELP
Thanks