Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB^ and Data Designer problem

Status
Not open for further replies.

Raffles666

IS-IT--Management
Dec 8, 2004
149
GB
I have a tricky little problem (well, to me).

I have used the Data Designer (DataEnvironment) to create all the links to my mdb and the containing tables and fields.

This works well - and is quite fast. However, this is my problem...

1) When I first start my program and do a record count - all is well.
2) If I do not make any changes to the mdb (data wise) - all is still well (.RecordCount is still correct - obviously).
3) I now download a new copy of said database (using the VB program to download it) - using the same name.
4) The databse does get over-written with no problems - however, if the database contains new records, the .RecordCount still comes up with the old number of records.

I can only assume that this is because the original mdb is being held in memory.

So, my question is - how do I 'flush' this memory and populate it with the contents of the updated mdb?

There is probably a very simple answer to this - and I'm looking past it. So, any help would be appreciated.

Thanks


Old school Alchemy engineer - trying to keep up with the times [hourglass]
 
Sorry - title should say VB6...

Old school Alchemy engineer - trying to keep up with the times [hourglass]
 
Because you have replaced the db, I would close and reopen the connection object of the DE and the recordsets. It would be safer than just re-opening/requerying the recordset.
 
That's what I am trying to do - but I am not sure of the syntax (or order).

I can :
dsrData.conDATs.Close
dsrData.conDATs.Open

with no problems.

The trouble is when I try and do a 'recordcount' on the recordset. I get an error 3704 (telling me the object is closed).

I assume I need to re-open the recordsets as well? If so, how?

Thanks

dsrData = DataEnvironemnt
conDATs = Connection
tblGBA = Table
rstblGBA = RecordSet



Old school Alchemy engineer - trying to keep up with the times [hourglass]
 
Sorted this now guys (after much fiddling). I just needed a dsrData.tblGBA command. That refreshed the links and all is fine.

Thanks anyway.


Old school Alchemy engineer - trying to keep up with the times [hourglass]
 
After the connection is reopened, then use the DE method which opens the recordset and sets the recordset object again:


If dsrData.rstblGBA.State=adStateClosed Then Call dsrData.tblGBA

(Notice that there is a method of the DE for each recordset, named after the original recordset, which can be used to reopen/refresh the recordset.)


 
I did - but thanks a lot for your input. It would have proved very useful had I not found it in time.

In fact - your line is better than mine - so I'm still going to pinch (err - use) it ;).

Thanks again


Old school Alchemy engineer - trying to keep up with the times [hourglass]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top