Xbrowse and Mdb

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Xbrowse and Mdb

Post by Silvio »

I try to open Mdb table with Xbrowse but it not run :

first I open the table

Code: Select all

  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
Then I create a Xbrowse table

Code: Select all


  oApp():oGrid := TXBrowse():New( oApp():oDlg )
   oApp():oGrid:nTop    := 00
   oApp():oGrid:nLeft   := nSplit+2
   oApp():oGrid:nBottom :=  ::nGridBottom
   oApp():oGrid:nRight  :=  ::nGridRight


 aBrowse   := { { { || STR( oRs:Fields( "ID" ):Value) }, i18n("Codice"), 150, 0 },;
                  { { || oRs:Fields( "Nome" ):Value }, i18n("Nome"), 150, 0 },;
                  { { || oRs:Fields( "Cognome" ):Value}, i18n("Cognome"), 150, 0 },;
                  { { || oRs:Fields( "Via" ):Value} , i18n("Indirizzo"), 150, 0 } }


   FOR i := 1 TO Len(aBrowse)
      oCol := oApp():oGrid:AddCol()
      oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
      oCol:nDataStrAlign := aBrowse[ i, 4 ]
      oCol:nHeadStrAlign := aBrowse[ i, 4 ]
   NEXT

   oApp():oGrid:SetRDD()
   oApp():oGrid:CreateFromCode()


it make error on this line

Code: Select all

oApp():oGrid:SetRDD()
why ?
Best Regards, Saludos

Falconi Silvio
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Code: Select all


// oApp():oGrid:SetRDD()  

oApp():oGrid:SetADO( oRs )
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Now make another error

Code: Select all

Application
===========
   Path and name: C:\work\prg\Mwopen_W\source\FSDI2006.Exe (32 bits)
   Size: 1,705,984 bytes
   Time from start: 0 hours 0 mins 4 secs 
   Error occurred at: 11-02-2008, 11:03:18
   Error description: Error BASE/1003  Variable does not exist: ORS

Stack Calls
===========
   Called from: pcustomer.prg => (b)CUSTOMER(64)
   Called from: XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(0)
   Called from: XBROWSE.PRG => TXBROWSE:PAINT(0)
   Called from: XBROWSE.PRG => TXBROWSE:DISPLAY(0)
   Called from: CONTROL.PRG => TXBROWSE:HANDLEEVENT(0)
   Called from: WINDOW.PRG => _FWH(0)
   Called from:  => WINRUN(0)
   Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
   Called from: main.prg => TAPPLICATION:ACTIVATE(148)
   Called from: main.prg => MAIN(36)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Sorry Now run I made a mistake ...
Best Regards, Saludos

Falconi Silvio
Post Reply