I am putting together a major application with a MS Access backend .. I have a strange problem..
I have a xbrowse property table that when you double click .. the detail screen opens six tables which in turn I view thru panels ..
Where I am having problems is as I open and close the detail records from the master Property table ( about 10 times ) .. the related six tables fail to open always at the forth table. I have temporarily rem'd out the forth table and again after a few open and closes .. the forth table refuses to open...
The only way I can get the tables to re-open is to quit the Master Property table and re-open the Property table and once again the relational tables open.
Unfortunitly I do not know if this is a timing issue with Access or resource problem ? When I close the detail screen I am closing all the relational tables and I know they are all closing properly ..
Any Ideas would be appreciated !
Thanks
Rick Lipkin
- Code: Select all Expand view
//-------------------------------
FUNC _PropView( cMODE,oRsProp,oWnd,oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6,oBtn7,oBtn8,oBtn9,oBtn10,oBrw )
LOCAL SAYING,cDEFA
LOCAL cTITLE, lOK1
LOCAL oIco,oBrush
LOCAL oRsOwn,oERR,cSQL,cPROPEID,oRsDwell,oRsRes,oRsVeh,oRsPet,oRsBoat
LOCAL cEID
// will always be in view or edit
IF cMODE = "A"
cMODE := "V"
ENDIF
IF oRsProp:EOF
SAYING := "SORRY ... Before you can EDIT or View a record"+chr(10)
SAYING += "You have to ADD one First"+chr(10)
MsgInfo( SAYING )
_CleanUP()
RETURN(NIL)
ENDIF
IF xWRITE = 'Y' .or. xSUPER = 'Y'
ELSE
SAYING := "You have READ ONLY Rights Here"
MsgInfo( SAYING )
cMODE := "V"
ENDIF
cDEFA := SET(7)
lOK := .F.
lOK1 := .F.
// relational key
cPROPEID := oRsProp:Fields("propeid"):Value
// open Owner table
cSQL := "SELECT * from OWNER where PROPEID = '"+cPROPEID+"' order by CurrentOwner,LastName"
oRsOwn := TOleAuto():New( "ADODB.Recordset" )
oRsOwn:CursorType := 1 // opendkeyset
oRsOwn:CursorLocation := 3 // local cache
oRsOwn:LockType := 3 // lockoportunistic
TRY
oRsOwn:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening OWNER table" )
_CleanUP()
RETURN(.F.)
END TRY
SysReFresh()
// open dwelling table
cSQL := "SELECT * from DWELLING where PROPEID = '"+cPROPEID+"'"
oRsDwell := TOleAuto():New( "ADODB.Recordset" )
oRsDwell:CursorType := 1 // opendkeyset
oRsDwell:CursorLocation := 3 // local cache
oRsDwell:LockType := 3 // lockoportunistic
TRY
oRsDwell:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening DWELLING table" )
oRsOwn:Close()
_CleanUP()
RETURN(.F.)
END TRY
SysReFresh()
// open resident table
cSQL := "SELECT * from RESIDENT where PROPEID = '"+cPROPEID+"' order by ResidentSort,LastName,FirstName"
oRsRes := TOleAuto():New( "ADODB.Recordset" )
oRsRes:CursorType := 1 // opendkeyset
oRsRes:CursorLocation := 3 // local cache
oRsRes:LockType := 3 // lockoportunistic
TRY
oRsRes:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening RESIDENT table" )
oRsOwn:Close()
oRsDwell:Close()
_CleanUP()
RETURN(.F.)
END TRY
// open pets table .... dies here
cSQL := "SELECT * from PETS where PROPEID = '"+cPROPEID+"'"
oRsPet := TOleAuto():New( "ADODB.Recordset" )
oRsPet:CursorType := 1 // opendkeyset
oRsPet:CursorLocation := 3 // local cache
oRsPet:LockType := 3 // lockoportunistic
TRY
oRsPet:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening PETS table" )
oRsOwn:Close()
oRsDwell:Close()
oRsRes:CLose()
_CleanUP()
RETURN(.F.)
END TRY
// open vehicle table
cSQL := "SELECT * from VEHICLE where PROPEID = '"+cPROPEID+"'"
oRsVeh := TOleAuto():New( "ADODB.Recordset" )
oRsVeh:CursorType := 1 // opendkeyset
oRsVeh:CursorLocation := 3 // local cache
oRsVeh:LockType := 3 // lockoportunistic
TRY
oRsVeh:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening VEHICLE table" )
oRsOwn:Close()
oRsDwell:Close()
oRsRes:CLose()
oRsVeh:CLose()
_CleanUP()
RETURN(.F.)
END TRY
// open boats table
cSQL := "SELECT * from BOATS where PROPEID = '"+cPROPEID+"'"
oRsBoat := TOleAuto():New( "ADODB.Recordset" )
oRsBoat:CursorType := 1 // opendkeyset
oRsBoat:CursorLocation := 3 // local cache
oRsBoat:LockType := 3 // lockoportunistic
TRY
oRsBoat:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening VEHICLE table" )
oRsOwn:Close()
oRsDwell:Close()
oRsRes:CLose()
oRsVeh:CLose()
oRsPet:Close()
_CleanUP()
RETURN(.F.)
END TRY