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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP: Visual Basic very slooooow... Using Lot's forms and Data Control

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0


Visual Basic very slooooow if I use DATA CONTROL why?
It seems that if I use 24 forms and 2 data control in each
visual basic is very slooooow! why?
... and if I assign form1.data1.databasename="x.mdb" then,
it is more, more, more slooooooooooow!
Could you help me solve this problem?

Thanks
 
Someone correct me if I am wrong, but I believe that each Datacontrol establishes its own connection to the database. If you have all 24 forms (each with 2 controls) loaded into memory at the same time, you will have 48 connections going into you access database (*.mdb). I would guess that this is overwhelming the Jet Engine.
Personally, I never use any DataControls, because they just seem slow to begin with. I usually keep a global reference to the database so that all forms can use the same connection. On the last project that I worked on (it was very big . . . over 200 forms) we used the straight ODBC APIs and threw out DAO altogether. That performed very well. - Jeff Marler
(please note, that the page is under construction)
 
Yep...that is correct. It is not a good programming practice to use a data control since it never allows you the flexibility to control database connections. You should always try opening up one connection and use it throughout your project just as Jeff suggested. I do the same too unless extreme conditions force me to open up a second connection. But even if it does, I make sure I close it if it is not being used.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top