Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Slow ADODB command object initializing
HI,
I need to perform distincts counts on tables. For that I initialize an array of tables that I traverse with a FOR loop. My problem occurs when I try initialize the fields commnadtext property of the Command Object. The text goes a bit lijke this
CMD.COMMANDTEXT =
"INSERT INTO STAGEDB.TO_STATS_FIELDCOUNTS VALUES ( " + ;
STR(iTableId) + ", " + ;
STR(IIf(IsNull(rsMax.Fields(0).Value), 1, (rsMax.Fields(0).Value + 1))) + ;
",'" + rs.Fields(i).Name + ;
"'," + STR(rsFldCounts.Fields(i).Value) + ",'" + strSystemChosen + "')"
that gives something like this :
"INSERT INTO STAGEDB.TO_STATS_FIELDCOUNTS VALUES ( 110, 10,'SNAPSHOT_DATE', 1,'PMDB')"
After that I simply issue cmd.execute to insert the values into Oracle. My problem is that when the CMD.COMMANDTEXT line is executed, VFP stops for a few seconds (minutes). If it were stopping at the CMD.EXECUTE line, I would simply use a DO WHILE CMD.STATE = ... to know wheter the line is executing or not and if yes issue a DOEVENTS command to send it to background and display to the user wich table is being processed.
Finally, my question is : why does the program stops when I initialize teh CMD property and how can I avoid this. I had the same behaviour in VB/VBA.
Thnak you for your help,
Christian Cote
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement