johnallen1
asked on
CDaoRecordSet SetFieldValue Performance
I have a CDaoRecordSet derived class and sometimes when I perform a setfieldvalue on it it is really fast any other times it can take 6 or 7 seconds (measured using beep()).
It has 200 fields and the delay happens in the same place all the time. I open it using Open().
It has 200 fields and the delay happens in the same place all the time. I open it using Open().
200 fields on one recordset?
I don't remember the numbers or the location of the documentation, but there are some performance notes somewhere in regards to Access databases and field count per table. The performance starts to break down, I think it was... 40 fields? You may want to reconsider your database schema and break that table up a bit.
Also as jdev points out, additional information would be helpful. Is this the same field all the time that's troubling you? Is it a memo field? What about the content that you are trying to stuff into the field?
-Ray
I don't remember the numbers or the location of the documentation, but there are some performance notes somewhere in regards to Access databases and field count per table. The performance starts to break down, I think it was... 40 fields? You may want to reconsider your database schema and break that table up a bit.
Also as jdev points out, additional information would be helpful. Is this the same field all the time that's troubling you? Is it a memo field? What about the content that you are trying to stuff into the field?
-Ray
I'v seen the same thing. Never found the solution to it. Maby its a bug in the CDao* classes.
I have switched to OLE DB in the newest version and I have not seen such problem. So maby you should do the same!
I have switched to OLE DB in the newest version and I have not seen such problem. So maby you should do the same!
ASKER
It doesn't matter which field (type) I try to setfieldvalue for.
It takes about eight seconds for the first field and 1 second for each one after that.
I think my problem is a number of fields. In DAO documentation it says that in the classwizard that when you define a class as bieng derived from cdaorecordset you can name the source table AND the fields to grab in the dynaset. I can name the table but it doesn't ask me which fields. Has anyone seen this? How can it be done?
It takes about eight seconds for the first field and 1 second for each one after that.
I think my problem is a number of fields. In DAO documentation it says that in the classwizard that when you define a class as bieng derived from cdaorecordset you can name the source table AND the fields to grab in the dynaset. I can name the table but it doesn't ask me which fields. Has anyone seen this? How can it be done?
I don't know that you can select the fields of the table when you are first creating the class via class wizard. However, once the class is created, switch to the member variables tab (in class wizard) and delete the members you do not want.
-Ray
-Ray
ASKER
Rayb,
That worked a treat. the function decreased from 24 seconds per record to 0.8! Good work!
How do I acept the answer so you get your points?
Thanks
John A.
That worked a treat. the function decreased from 24 seconds per record to 0.8! Good work!
How do I acept the answer so you get your points?
Thanks
John A.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
regards,
jdev