Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

5333 erro in VO 2.5

11 views
Skip to first unread message

Klaus Stinshoff

unread,
May 3, 2002, 6:33:23 AM5/3/02
to
Hallo,

in one of my methods I get a 5333 error. It is a very simple method and I
don't know how to make it save.

This method is doing something like that:

LOCAL cTab as STRING
LOCAL cSQL as STRING
LOCAL oSQL as SqlSelect

oSql:=SqlSelect{cSql,oConn}
oSql:Execute()

cTab:=oSql:fieldget(#tabelle) // 5333 error


A call to the function CollectForced() at the beginning of the method an at
the end does not avoid this error.

Where have I look for to avoid this error.

Thanks in advance


Klaus


Markus Feser

unread,
May 3, 2002, 7:05:58 AM5/3/02
to
Hello Klaus,

> LOCAL cTab as STRING
> LOCAL cSQL as STRING
> LOCAL oSQL as SqlSelect
>
> oSql:=SqlSelect{cSql,oConn}
> oSql:Execute()
>
> cTab:=oSql:fieldget(#tabelle) // 5333 error

please show us your SQL-Statement (cSQL).

Markus Feser

Klaus Stinshoff

unread,
May 3, 2002, 7:22:51 AM5/3/02
to
Hello Markus,

The SQL-Statement is:

cSQL := "select * from datafelder where nametabelle = '" +
Upper(cTabName)+ "'" ;
+ " order by reihenfolge"

Klaus

"Markus Feser" <markus...@imsgear.com> schrieb im Newsbeitrag
news:aatqul$dn8sr$1...@ID-72150.news.dfncis.de...

Pierre Honore

unread,
May 3, 2002, 8:30:58 AM5/3/02
to
Hi Klaus
You may need to test your SQLSelect object to see if it is valid.
Status returns a Hyperlabel or NULL_OBJECT. In the case of NULL_OBJECT you
may then "read" the data set returned.

oSql:=SqlSelect{cSql,oConn}
oSql:Execute()
IF oSql:Status = NULL_OBJECT
cTab:=oSql:fieldget(#tabelle)
ELSE
// Something's wrong
...
See in your doc SQLSelect class for more info.


"Klaus Stinshoff" <stin...@gmx.net> a écrit dans le message news:
aatp1m$bjn$07$1...@news.t-online.com...

Markus Feser

unread,
May 3, 2002, 8:36:27 AM5/3/02
to
ok, maybe it's the SQLConnection...???

Markus Feser

Klaus Stinshoff

unread,
May 3, 2002, 11:12:18 AM5/3/02
to
Hello Piere,

in my method I have testet whether the oSQL:execute() was successfull and
whether the data which is returned is valid.
I only giv an example and not the complete method.

I have have a lot of oSQL:fieldget(#fieldname) in the method before and they
work. And the database must return at least one record and every field must
contain a non NULL-value. Somtime I get that 5333 error.

Klaus

"Pierre Honore" <pierre...@options.fr> schrieb im Newsbeitrag
news:3cd28305$0$11110$626a...@news.free.fr...

Klaus Stinshoff

unread,
May 3, 2002, 11:55:31 AM5/3/02
to
Hello,

here is the complete method, but I thank I have to look for that error in
any other method. I don't where I have to look for.
If I uncomment the CollectForced() functions I get this error at an other
line. But everytime I get it in a fieldget(#fieldname) method..

The programm works fine for some weeks and the suddenly I get this 5333
everytime the programm is startet. Ig get it working with Oracle or working
with Access. I get it on NT4.0 on Win2000 on Windows ME.

I have absolutly no idea where to search for that error.

Klaus

METHOD GetSpecsOfTabForFields(cTabName AS STRING, aFlds AS ARRAY) AS ARRAY
PASCAL CLASS DataDic

//l Ermittelt alle Feldinformationen für die Felder von aFlds und
//l erzeugt EnFieldSpecs. Bezieht sich auf Tabelle cTabName
//l Feld- und Tabellennamen werden IN Großschrift konvertiert

//l Für Checkboxen wird Validationsblock neu gesetzt !!!!!

//L Da im DataDic noch Angaben zum Ctrl(Länge & Position fehlen, werden
//l hier zu TESTZWECKEN defnierte Werte verwendet

//p cTabName STRING Name der Tabelle
//p aFlds ARRAY Liste mit Feldname
//r aSpecs ARRAY Feld mit EnFieldSpecs

LOCAL cStr, cSelect,cDescript, cName, cType,cSubType, cText, cTab, cSelFld,
cRetFld AS STRING

LOCAL uVal,uVal1,uVal2 AS USUAL
LOCAL lEdit,lAnzeigen AS LOGIC
LOCAL i, nLen, nDec, nRet,nPos AS INT
LOCAL oSpec AS EnFieldSpec
LOCAL oLabel AS Hyperlabel
LOCAL aSpecs AS ARRAY
LOCAL oSel AS SQLSelect
LOCAL oListe AS lookup
LOCAL cBlock AS STRING
LOCAL cbBlock AS _CODEBLOCK
#IFDEF __DEBUG__
LOCAL cTemp AS STRING
// cTabName:="BSCHACHT"
#ENDIF
aSpecs := {}

// Liste der Feldnamen zusammenstellen
cStr := ""
nLen := ALen(aFlds)
FOR i:=1 UPTO nLen
cStr := cStr + "'" + aFlds[i] + "' ,"
NEXT

IF SLen(cStr) >0
cStr := Left(cStr,SLen(cStr)-1)
cSelect := "select * from datafelder where nametabelle = '" +
Upper(cTabName)+ "'" ;
+ "and namefeld in (" + cStr + ") order by reihenfolge"
ELSE
cStr := "*"
cSelect := "select * from datafelder where nametabelle = '" +


Upper(cTabName)+ "'" ;
+ " order by reihenfolge"

ENDIF
#IFDEF __DEBUG__
cTemp:=ProcName() + " -- "+cTabName+ +" Execute "+AsString(Seconds())
StartTime(cTemp)
#ENDIF

oSel:=SQLSelect{"",_oConData}
oSel:NullAsBlank:=TRUE
oSel:sqlString := cSelect
oSel:Execute()
#IFDEF __DEBUG__
EndTime(cTemp)
#ENDIF

i:=0
IF oSel:used

#IFDEF __DEBUG__
cTemp:=ProcName() + " -- "+cTabName+AsString(Seconds())
StartTime(cTemp)
#ENDIF

DO WHILE !oSel:EOF
++i
// Falls Feld NULL enthält wird NIL zurückgeliefert, deshalb konvertieren !
// Tabellen bzw. Feldnamen werden in Großbuchstaben konv.
// CollectForced()
cName := oSel:FIELDGET (#Namefeld)
// EnforceType(@uVal,STRING)


cText := oSel:FIELDGET (#Kurztext)
// EnforceType(@uVal,STRING)

IF cText==NULL_STRING
cText:=cName
ENDIF

// uVal := oSel:FIELDGET (#Typ)
// EnforceType(@uVal,STRING)
cType := SubStr3(oSel:FIELDGET (#Typ),1,1)
cSubType:= SubStr(oSel:FIELDGET (#Typ),2,1)
/* IF cType==NULL_STRING
cType:=' '
ENDIF
*/

nLen := oSel:FIELDGET (#Lange)
nDec := oSel:FIELDGET (#Dez)

cTab := oSel:FIELDGET (#Auswahltabelle) =========== 5333 error !!!!!!!!

cSelFld := oSel:FIELDGET (#Auswahlfeld)
cRetFld := oSel:FIELDGET (#Returnfeld)

// DB enthält 0,1 statt false und true
nRet := oSel:FIELDGET(#Aenderneditieren)
IF nRet = 0
lEdit := FALSE
ELSE
lEdit := TRUE
ENDIF

nRet := oSel:FIELDGET(#AendernAnzeigen)
IF nRet = 0
lAnzeigen := FALSE
ELSE
lAnzeigen := TRUE
ENDIF

oLabel := HyperLabel {cName, cText, cText, cName}
oSpec := EnFieldSpec {oLabel, cType, nLen, nDec, cTabName, cName}
oSpec:Editable := lEdit
oSpec:Anzeigen := lAnzeigen
IF oSel:FIELDGET (#NEUEDITIEREN)=0
oSpec:AppendEditable :=FALSE
ELSE
oSpec:AppendEditable :=TRUE
ENDIF
oSpec:FieldId:=oSel:FIELDGET(#MSLINK)
oSpec:SubType:=cSubType

oSpec:Kurztext:=cText
// Auswahltabelle, -feld und Returnfeld nur übernehmen falls <>""
IF SLen(cTab) <> 0
oSpec:SelectionTab := cTab
nPos:=AScanExact(_aAuswahlListen[1],cTab)
IF nPos=0 // Listen nur einmal aufnehmen
//Wenn SelectionTab Systemtabelle ist
// muß _oConData als Connection genommen werden
oListe:=LookUp{cTab,cSelFld,cRetfld,_oCon,_oConData}
oListe:erzeugeListe()

AAdd(_aAuswahlListen[1],cTab)
AAdd(_aAuswahlListen[2],oListe)
oListe:destroy()
oListe:=NULL_OBJECT

ENDIF


ENDIF
IF SLen(cSelFld) <> 0
oSpec:SelectionField := cSelFld
ENDIF
IF SLen(cRetFld) <> 0
oSpec:ReturnField := cRetFld
ENDIF


// Angaben zu Größe & Position des Ctrl., sind z. Zeit nicht im DataDic
enthalten
uVal := String2Symbol(oSel:FIELDGET (#Feldart))
oSpec:CtrlType := uVal
DO CASE
CASE uVal = CTRL_CMB_ID .or.uVal = CTRL_CMB_ID_OLD
oSpec:CtrlDim:= Dimension {CTRL_CMB_WIDTH,CTRL_CMB_HEIGHT}
CASE uVal = CTRL_SLE_ID .or.uVal = CTRL_SLE_ID_OLD
oSpec:CtrlDim:= Dimension {CTRL_SLE_WIDTH,CTRL_SLE_HEIGHT}
CASE uVal = CTRL_CHK_ID .or.uVal = CTRL_CHK_ID_OLD
oSpec:CtrlDim:= Dimension {CTRL_CHK_WIDTH,CTRL_CHK_HEIGHT}
// Bei Checkbox neuen Validationsblock setzen
oLabel := HyperLabel {cText, cText, cText, cText}
//oSpec:setvalidation({|val,ctrl| test(uval,ctrl)},oLabel)
OTHERWISE
oSpec:CtrlDim:= Dimension {CTRL_SLE_WIDTH,CTRL_SLE_HEIGHT}
END CASE

oSpec:CtrlPos := Point {0,0}

IF oSel:FIELDGET(#PrimeryKey)=1
oSpec:Primkey:=TRUE
ELSE
oSpec:Primkey:=FALSE
ENDIF

cDescript:= "Das Ausfüllen des Feldes " + cText + " ist erforderlich"
oLabel := HyperLabel {cName, cText, cDescript, cText}
oSpec:SetRequired(iif(oSel:FIELDGET(#Required)=1,TRUE,FALSE),oLabel)
IF oSel:FIELDGET(#Suchfeld)=1
oSpec:Suchfeld:=TRUE
ELSE
oSpec:Suchfeld:=FALSE
ENDIF
IF oSel:FIELDGET(#Sortierfeld)=1
oSpec:Sortierfeld:=TRUE
ELSE
oSpec:Sortierfeld:=FALSE
ENDIF
IF oSel:FIELDGET(#Autoincrement)=1
oSpec:AutoIncrement:=TRUE
ELSE
oSpec:AutoIncrement:=FALSE
ENDIF
IF oSel:FIELDGET(#Summierung)=1
oSpec:Summierung:=TRUE
ELSE
oSpec:Summierung:=FALSE
ENDIF
cDescript:= "Mindestlänge für das Feld " + cText + " ist " +
Str1(oSel:FIELDGET(#minLength))
oLabel := HyperLabel {cName, cText, cDescript, cText}
oSpec:SetMinLength(oSel:FIELDGET(#minLength),oLabel)

cDescript:= "Der Wertebereich für das Feld " + cText + " ist mit " +
Str1(oSel:FIELDGET(#minVal))+ " < X < " + Str1(oSel:FIELDGET("maxVal")) +"
vorgegeben"

oLabel := HyperLabel {cName, cText, cDescript, cText}
uVal1:=oSel:FIELDGET(#minVal)
uVal2:=oSel:FIELDGET(#maxVal)
IF uVal1=0
uVal1:=NIL
ENDIF
IF uVal2=0
uVal2:=NIL
ENDIF

oSpec:SetRange(uVal1,uVal2,oLabel)
cBlock:=oSel:FIELDGET(#validierung)

IF SLen(cBlock)>0 .and. Instr("{",cBlock)
cDescript:= "Die Validierungsregel " + oSel:FIELDGET(#validierung) + "
ist nicht eingehalten worden."
oLabel := HyperLabel {cName, cText, cDescript, cText}
cbBlock:=&cBlock
oSpec:setValidation(&cBlock,oLabel)
ELSE // Hier sind infos für ein virtuelles Feld hinterlegt

oSpec:ctrlCargo1:=cBlock
ENDIF
oSpec:picture:=oSel:FIELDGET(#Picture)

cBlock:=oSel:FIELDGET(#Farbblock)
IF SLen(cBlock)>0
oSpec:Farbblock:=&cBlock
// oSpec:Farbblock:=cBlock
ENDIF

oSpec:Langtext:=oSel:FIELDGET(#LangText)
uVal:=oSel:FIELDGET(#neuVorbelegen)
DO CASE
CASE cType =="C"
IF IsNil(uVal)
oSpec:DefaultVal:=""
ELSE
oSpec:DefaultVal:=uVal
ENDIF
// oSpec:Suchfeld :=iif(oSel:FIELDGET("Suchfeld")=1,TRUE,FALSE)
CASE cType =="N"
IF IsNil(uVal)
oSpec:DefaultVal:=0
ELSE
oSpec:DefaultVal:=Val(uVal)
ENDIF

CASE cType =="D"
OTHERWISE
ENDCASE

IF oSel:FIELDGET(#breite)=0
oSpec:ColWidth:=0
ELSE
oSpec:ColWidth:=oSel:FIELDGET(#breite)
ENDIF
// Spec ist vollst. belegt
AAdd(aSpecs, oSpec)

IF !oSel:skip() .AND. ! oSel:Eof
// IF !oSel:EXTEndedFetch(SQL_FETCH_NEXT,SQL_FETCH_RELATIVE) .AND.
!oSel:Eof
//Irgendein Fehler ist aufgetreten
uVal:=oSel:close()
oSel:FreeStmt(SQL_DROP)

RETURN NULL_ARRAY
ENDIF

// IF i=100
// EXIT
// ENDIF
ENDDO
#IFDEF __DEBUG__


EndTime(cTemp)
DebugOut32(i)

#ENDIF

uVal:=oSel:close()
oSel:FreeStmt(SQL_DROP)
// DataDic kann genutzt werden
_nAktTable:=AScanExact(_aTabNames,cTab)
_lValid := TRUE
ELSE
// DataDic kann NICHT genutzt werden
_lValid := FALSE

oSel:errInfo:showErrorMsg() // Mesage wird nicht ausgegeben
ENDIF


RETURN aSpecs


"Markus Feser" <markus...@imsgear.com> schrieb im Newsbeitrag
news:aatqul$dn8sr$1...@ID-72150.news.dfncis.de...

0 new messages