In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

How come tDbfDataSet:Open, doesn't actually open anything?

Xailer English public forum
Responder
Guest

How come tDbfDataSet:Open, doesn't actually open anything?

Mensaje por Guest »

When a tDbfDataSet is created, points to a valid dbf, and is Opened, how come Open() doesn't actually open the file for reading or writing?
The Open Method which includes the statements
IF ! ::lCreated
::FlOpen := .T.
RETURN .T.
ENDIF
near the top of the source, and since ::lCreated is true, it sets ::FlOpen to true, then returns. But it doesn't actually open the table, and therefore none of the data access methods will work.
It never actually gets to the
DbUseArea( ::lNew, ::oDataSource:cDriver, ::oFileName:cFileName, ::cAlias, ::lShared, ::lReadonly )
statement.
Guest

How come tDbfDataSet:Open, doesn't actually open anything?

Mensaje por Guest »

I think this is just another case of requiring these very useful classes - because they are components - to be called as part of a form.
Responder