In the following sample, GetRows() method returns NIL (correctly returns an
array using xHarbour):
function main()
local oCn, oRs, aRows
oCn := CreateObject( 'ADODB.Connection' )
oCn:ConnectionString := "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=e:\fwharbour\samples\xbrtest.mdb;User Id=admin;Password=;"
oCn:Open()
if oCn:State == 1
? 'Connection Open'
oRs := TOleAuto():New( 'ADODB.RecordSet' )
oRs:ActiveConnection := oCn
oRs:Source := 'CUSTOMER'
oRs:CursorLocation := 3 // adUseClient
oRs:LockType := 3 // adLockOptimistic
oRs:Open()
if oRs:State > 0
? 'Recordset Open'
? 'RecordCount = ', oRs:RecordCount()
oRs:MoveFirst()
aRows := oRs:GetRows()
oRs:MoveFirst()
if ValType( aRows ) == 'A'
? 'oRs:GetRows Successful'
? 'Len( aRows ) =', Len( aRows )
? 'oRs:Fields(0):Value=', oRs:Fields(0):Value
? 'aRows[1][1]=', aRows[1][1]
elseif aRows == nil
? 'oRs:GetRows returned nil'
else
? 'oRs:GetRows return type =', ValType( aRows )
endif
oRs:Close()
else
? 'RecordSet Open Fail'
endif
oCn:Close()
else
? 'Connection Open Fail'
endif
inkey( 0 )
return nil
EMG
--
EMAG Software Homepage: http://www.emagsoftware.it
The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum
The Best of Spectrum Games: http://www.emagsoftware.it/tbosg
The EMG Music page: http://www.emagsoftware.it/emgmusic
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour