Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An odd thing happens at about 1.2 millionth record 2

Status
Not open for further replies.

spuppett

Programmer
Jan 25, 2003
48
US
Here's the situation,

I have a table with say 250,000+ records in it. I scan through these records and generate 35 guids per record for another table. Infrequently I get an error say something about an 'Unknow COM status'. I've installed SP5 and that didn't fix the problem.

The code I use to generate the guid is pretty straight forward and I probably use (no exagerating) 2 million times before I get to this part in my code, without problems.

Here's my function:
Code:
oGuid=CREATEOBJECT("scriptlet.typelib")
cGuid=SUBSTR(oGuid.Guid,2,34)
RETURN (SUBSTR(cGuid,1,8)+SUBSTR(cGuid,10,4)+SUBSTR(cGuid,15,4)+SUBSTR(cGuid,20,4)+SUBSTR(cGuid,25,8))

Can anyone shed any light on this??
 
Even though VFP 6.0 has a reputation of being the first stable VFP version, it did still have some remaining quirks even with sp5. I've moved to VFP 9.0 in order to escape weird unpredictable errors with my EXEs that are called from ASP web pages. Maybe that's the issue here?

Just in case any of this helps, here are some other threads mentioning "Unknown COM status", generally when trying to access or copy folders or files that don't exist.

thread184-1106669 - either the source path/file or the destination path doesn't exist
thread184-734855 - Outlook - be sure to specify the destination folder's "implicit" path
thread184-567231 - hints on copying folders and files
thread184-520521 - if copying files then destination folder cannot end with "\"
Code:
* Condensed code
oGuid=CREATEOBJECT("scriptlet.typelib")
RETURN STRTRAN(SUBSTR(oGuid.Guid,2,36),"-")
dbMark
 
One question. Are you releasing the object created each time?
Something like:
Code:
oGuid=CREATEOBJECT("scriptlet.typelib")
cGuid=SUBSTR(oGuid.Guid,2,34)
[COLOR=red]oGuid = .NULL.
RELEASE oGuid[/color]
RETURN (SUBSTR(cGuid,1,8)+SUBSTR(cGuid,10,4)+SUBSTR(cGuid,15,4)+SUBSTR(cGuid,20,4)+SUBSTR(cGuid,25,8))
If not, you could be dealing with a memory leak, which could be causing you problems.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Code:
* Improved condensed code
PRIVATE oGuid, cGuid
oGuid=CREATEOBJECT("scriptlet.typelib")
cGuid=STRTRAN(SUBSTR(oGuid.Guid,2,36),"-")
oGuid = .NULL.
RELEASE oGuid
RETURN cGuid
 
Thank you both for your input. I didn't even think about releasing the object, I'll look in to it. I would think that it would destroy itself when it went out of scope, but I guess better safe then sorry, eh? As for the substr() function, thanks, now that I see it, duh. I'm not a foxpro guy, but it works best for what we're doing, so I've been learning as I go.

Thanks again
 
I would think that it would destroy itself when it went out of scope
It does go out of scope, but it doesn't necessarily release that chunk of memory it utilizes. It just becomes unaccessible. Hence, the reasoning behind memory leaks.
This seems to be most prevelant with created objects.

Anyway, I'm not sure that will cure your problem, but it seemed the most likely cuplrit.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top