Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow ADODB command object initializing
Message
From
20/04/2001 15:23:07
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Quebec, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Slow ADODB command object initializing
Miscellaneous
Thread ID:
00498090
Message ID:
00498090
Views:
55
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
Map
View

Click here to load this message in the networking platform