var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Private module variables?
I have a database that has been converted from 97 to 2k3. There is now a problem in the database in that a recordset is closed at the wrong point of time
I know the line that causes the problem i just dont see how it is doing it?!!!
There are two modules both with private recordset and database variables with the same names
These variables are in use in mod1 when it calls methods in mod2 that use the varaibles declared in that module.
Eventulaly the mod2 method closes and sets to nothing the database variable, this causes the recordset variable in mod1 to close and so the code errors when excecution returns to the mod1 method
Both modules use
is this the cause of the problem of private module variables getting closed in the wrong place? i.e. both database variables are seperate but acctualy refference the same database object?
It shouldn't matter. Assuming you're using DAO recordsets, since you converted from 97, each recordset you instantiate is it's own object and independent of all others. could you post the code you're using to instantiate and release your objects from both mods?
code is in the attached, its a bit scrappy but important bits are there
The solution seems to be to explicity define the db and rq varaibles as DAO.Recoredset/Database and use
exactly why this solves the problem im not sure, any ideas/explainations?
I didn't download the code, but yeah, that's exactly what I was looking for.
By default, 97 uses DAO for data manipulation where as 2000 and higher default to ADO. Therefore, when you implicitly define a dataset like so:
Dim myRs As Recordset
it means two different things. In 97, it means DAO.Recordset. In 2000+, it means ADODB.Recordset.