FUNCTION MAIN()
LOCAL oRS
USE CLIENTI
oRS = CREATEOBJECT( "ADODB.Recordset" )
oRS:Open( "SELECT * FROM Clienti", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clienti.mdb", 0, 3 )
WHILE !EOF()
oRS:AddNew()
oRS:Fields( "Cliente" ):Value = FIELD -> cliente
oRS:Update()
SKIP
ENDDO
oRS:Close()
CLOSE
RETURN NIL
@ 0, 0 LISTBOX oBrw FIELDS STR( oRs:Fields( "id" ):Value ),;
Rick Lipkin wrote:And .. how do I pass an object value like the 'file_num" to put in my sql statement to relate and spin off another listbox opening another table to return just those matching rows ??
Rick Lipkin wrote:Also .. I will have to edit some of the row data and build a dialog of values .. How would I define a column object like field->address ??
oRS1:Open( "SELECT * FROM CERCLA_INDEXING WHILE ASSOCIATED_FILE_NUM ='"+cFILENUM+"'" , "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=LWMFS.mdb", 1, 3 )
Rick Lipkin wrote:1) How would I do a table scan .. something like Locate for oRs:Fields( "file_num" ):Value = "010462' ??
#include "Fivewin.ch"
#include "Tcbrowse.ch"
FUNCTION MAIN()
LOCAL oRs, oErr
oRs = CREATEOBJECT( "ADODB.Recordset" )
TRY
oRS:Open( "SELECT * FROM Clienti", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clienti.mdb", 1, 3 )
CATCH oErr
? oErr:Description
RETURN NIL
END TRY
WBROWSERECORDSET( oRs )
TCBROWSERECORDSET( oRs )
oRs:Close()
RETURN NIL
STATIC FUNCTION WBROWSERECORDSET( oRs )
LOCAL oWnd, oBrw, nRec
DEFINE WINDOW oWnd
@ 0, 0 LISTBOX oBrw FIELDS oRs:Fields( "Cliente" ):Value;
HEADERS "CLIENTI";
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"
oWnd:oClient = oBrw
ACTIVATE WINDOW oWnd
RETURN NIL
STATIC FUNCTION TCBROWSERECORDSET( oRs )
LOCAL oWnd, oBrw, oCol, nRec
DEFINE WINDOW oWnd
@ 0, 0 BROWSE oBrw;
ON RIGHT CLICK ( nRec := oRs:AbsolutePosition,;
oBrw:Report( "TWBrowse report", .T. ),;
oRs:MoveFirst(),;
oRs:Move( nRec - 1 ) )
ADD COLUMN TO oBrw;
DATA oRs:Fields( "Cliente" ):Value;
HEADER "CLIENTI"
oBrw:lCellStyle = .T.
oBrw:bLogicLen = { || oRs:RecordCount }
oBrw:bGoTop = { || oRs:MoveFirst() }
oBrw:bGoBottom = { || oRs:MoveLast() }
oBrw:bSkip = { | nSkip | Skipper( oRs, nSkip ) }
oBrw:cAlias = "ARRAY"
oWnd:oClient = oBrw
ACTIVATE WINDOW oWnd
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 78 guests