General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only