questo esempietto con pochi field funziona poi quandoinserisco altri campi mi fa errore :
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oRs, oErr
oRs = CREATEOBJECT( "ADODB.Recordset" )
TRY
oRS:Open( "SELECT * FROM Utenti", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ecom.mdb", 1, 3 )
CATCH oErr
? oErr:Description
RETURN NIL
END TRY
WBROWSERECORDSET( oRs )
oRs:Close()
RETURN NIL
STATIC FUNCTION WBROWSERECORDSET( oRs )
LOCAL oDlg, oBrw, nRec
DEFINE DIALOG oDlg SIZE 800, 300
@ 0, 0 LISTBOX oBrw FIELDS ;
oRs:Fields( "ID" ):Value,;
oRs:Fields( "Nome" ):Value,;
oRs:Fields( "Cognome" ):Value,;
oRs:Fields( "Via" ):Value,;
oRs:Fields( "Civico" ):Value,;
oRs:Fields( "Cap" ):Value,;
oRs:Fields( "Citta" ):Value,;
oRs:Fields( "Provincia" ):Value,;
oRs:Fields( "Stato" ):Value,;
oRs:Fields( "Telefono" ):Value,;
oRs:Fields( "CodiceFiscale" ):Value;
HEADERS "Codice","Nome","Cognome","Indirizzo",;
"Numero","Cap","Provincia","Città","Provincia",;
"Stato","Telefono","Codice Fiscale";
ON RIGHT CLICK ( nRec := oRs:AbsolutePosition,;
oBrw:Report( "TWBrowse report", .T. ),;
oRs:MoveFirst(),;
oRs:Move( nRec - 1 ) )
oBrw:bLogicLen = { || oRs:RecordCount }
oBrw:bGoTop = { || oRs:MoveFirst() }
oBrw:bGoBottom = { || oRs:MoveLast() }
oBrw:bSkip = { | nSkip | Skipper( oRs, nSkip ) }
oBrw:cAlias = "ARRAY"
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
RETURN NIL
STATIC FUNCTION SKIPPER( oRs, nSkip )
LOCAL nRec := oRs:AbsolutePosition
oRs:Move( nSkip )
IF oRs:EOF; oRs:MoveLast(); ENDIF
IF oRs:BOF; oRs:MoveFirst(); ENDIF
RETURN oRs:AbsolutePosition - nRec
l'errore è
Application
===========
Path and name: C:\work\errori\mdb\test.Exe (32 bits)
Size: 1,395,712 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 02/11/08, 01:43:25
Error description: Error BASE/1132 Bound error: array access[/code]