Click to See Complete Forum and Search --> : I need help to open a RecordSet
Reyes
April 21st, 1999, 03:17 AM
I need help because I don't Know if I can open two recordset at the same time.
For example:
CRecordSetA RecordSetA(Database);
CRecordSetB RecordSetB(Database);
SelectA = "{CALL ProcedureA}"
SelectB = "{CALL ProcedureB}"
if (RecordSetA.Open(CRecordset::forwardOnly, SelectA, Recordset::readOnly)){
while (!RecordSetA.IsEOF()){
if (RecordSetB.Open(CRecordset::forwardOnly, SelectB, CRecordset::readOnly)) {
while (!RecordSetB.IsEOF()){
RecordSetB.MoveNext();
}
}
RecordSetB.Close();
RecordSetA.MoveNext();
}
}
RecordSetA.Close();
Can I make somthing like this?.
If I can, What must I put in the options to make this?
Thanks,
Reyes
Hussam
April 21st, 1999, 04:01 AM
Hello!
In theory you can open as many recordsets as you want. When you ask about the option, the answer is that it depends on what you need to do with the recordsets.
I have for example an application that opens several recordsets from the same table where the purpose of every recordset is something else than all others.
Specifically may program opens Bulck set when I am fetching records from a DB and it opens single recordsets when I modify ( new, edit and delete) a record in the Bulckset.
Good luck
Hussam
Reyes
April 21st, 1999, 08:48 AM
First of all, thanks Hussam
The second thing is that I can open several RecordSet, but my problem is that I want make this at the same time, like I show in the code of the another message, and when I try to make this the computer give me an run time error, and say that the canal is bussy.
Have you make somthing like this?
Chiao,
Reyes
Hussam
April 26th, 1999, 01:49 AM
Hello again!
Sorry that it took long time.
As I said earlier it does not matter how many recordsets you open at the same time or not as long as you remember to close the tables when you do not need them.
Usually the limit of open tables is between 150- 200. If you reach this limit, you will get DBException. The options you set are depending on the procedures you want to execute. I did never seen the message "Canal is busy" but it sounds like that the driver is completely occupied with an operation(-s).
Hussam
Reyes
April 26th, 1999, 02:06 AM
Thank you, Hussam.
I must look why gives me this error, but I think that you are in the good way.
"See you"
Reyes
Braulio
April 26th, 1999, 03:48 AM
Jayol Reiez !
En teoria creo que si se puede, el problema puede estar en que la base de datos se use o no de forma exclusiva ??, no se, prueba a preguntar si puedo abrir dos instancias de recordsets iguales con la misma base de datos asociada, a ver que dicen, de todas formas es muy raro,
Ciao !
Brous-lee
Reyes
April 26th, 1999, 03:59 AM
Yolja, Brous-lee
El problema es que las instancias de los recordset son distintas, es decir, que abro un objeto de una clase (CRecordSetA) y otro de otra (CRecordSetB) (con la misma base de datos en común), pero esto me dice que el canal esta ocupado. De cualquier forma con los procedimientos que tengo ahora no necesito abrir dos recordsets a la vez, lo he preguntado porque no sabía si los iba a necesitar o no y porque me parece interesante saber como se hace.
De cualquier forma, gracias.
Reiez
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.