oRs:ActiveConnection:hObj := nil
oRs = CREATEOBJECT( "ADODB.Recordset" )
oRs:cursortype :=1
oRs:cursorlocation :=3
oRs:locktype := 3
oRs:open('SELECT * FROM artikel',Connectionstring)
oRs:ActiveConnection:hObj := nil
oRs:ActiveConnection:Close()
oRs = CREATEOBJECT( "ADODB.Recordset" )
oRs:cursortype :=1 // Try with number 2 adOpenDynamic
oRs:cursorlocation :=3 // adUseClient
oRs:locktype := 3 // adLockOptimistic
oRs:open('SELECT * FROM artikel',Connectionstring)
oRsWrk:Properties("Unique Table"):Value := "artikel" // Here
oRs:ActiveConnection:hObj := nil
Enrico Maria Giordano wrote:As I already said, try to close the connection:
- Code: Select all Expand view
oRs:ActiveConnection:Close()
EMG
oRs = CREATEOBJECT( "ADODB.Recordset" )
oRs:cursortype :=1
oRs:cursorlocation :=3
oRs:locktype := 3 //alleen lees
oRs:open('SELECT * FROM artikel',Connectionstring)
?oRs:recordcount() -----> Give number of records
oRs:ActiveConnection:close()
?oRs:recordcount() ------> Give error
function Test()
local oCn, oRs
oCn := FW_OpenAdoConnection( "testins.mdb" )
oRs := FW_OpenRecordSet( oCn, "testtable", adLockBatchOptimistic )
xbrowser oRs fastedit
// Edit, delete, addnew as you like
// but do not use oRs:UpdateBatch()
oRs:Close()
oCn:Close()
return nil
function TestDiscon()
local oCn, oRs
local cDat := "mycopy.dat"
oCn := FW_OpenAdoConnection( "testins.mdb" )
oRs := FW_OpenRecordSet( oCn, "testtable", adLockBatchOptimistic )
if File( cDat )
FErase( cDat )
endif
oRs:Save( cDat )
oRs:Close()
oCn:Close()
oRs := FW_OpenRecordSet( nil, cDat )
// oRs:ActiveConnection is NIL
xbrowser oRs fastedit
// Edit, delete, addnew as you like
// In case you still like to save changes
// Assign oRs:ActiveConnection := oCn
// and then oRs:UpdateBatch
oRs:Close()
return nil
function FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 96 guests