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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class not registered: Datensatz Nr: 493

Status
Not open for further replies.

Harry_Clipper

Programmer
Dec 2, 2020
12
0
0
DE
Hello,
I'm not a native english speaker....

I got the above error when starting the exe-file.

Each year I release a new version of my programm.
Last year I used a lot of external controls like msflexgrid, sliders, etc.
I worked on it the whole year to get rid of them and replace them with pure VFP controls.
This is done.

I tried to find what "Datensatz Nr: 493" mean.
"Datensatz" is a german word with means an entry in a table.
I would like to find what is this entry Nr: 493.
is there a file, a method or anything else, where I can look into this table to find what is not registered?

Thanks Harald
 
Hi Harald,

[pre]
use myform.scx
go 493
?OLE2
USE
[/pre]

MartinaJ
 
Martina is giving the very short answer, but you may first need to learn two things:

1. Forms (SCX) and also classlibs (VCX) are actually DBFs and organize their structure in records for objects (controls), code and parent relationships to what contains them.

2. These errors only happen when you start a form or instantiate a class that still has what you tell is replaced in your application: an OLE control, well, any class, not only ActiveX, which VFP searches in the registry, so that would also apply to COM automation servers, but they would usually be instantiated by code and not give such a record number related error message. A line of oExcel=CreateObject("Excel.Application") causes a "class not registered" error in the normal way, for a method or program and line number. The way a record-number related error message is caused is when a form or class is constructed from the data in the SCX or VCX. And as that also happens without code in init, too, it's not related to code, also not Load event code, it's related to the construction mechanism of forms and classes driven by data about their composition.

It could be something you still use and consider available without (co-)installation, like the Common Controls or an Excel Spreadsheet. The former isn't as common since several Windows versions, you're having the license to deploy them with your setup, but they don't get there automatically and are not part of the core VFFP runtime. And the latter (an Excel Spreadsheet or any such Office specific visual class) won't work if Office isn't installed or if the control on the form specified a version number not installed. I would also say an Olebound control can cause that, though it's a native VFP control. But its main intent is to combine an OLE server with data or a concrete OLE instance, and one part is usually general field and then an OLE control that is using this general field, i.e. it would contain the cell content of an Excel spreadsheet object, but not be the Excel spreadsheet itself, it still needs Office Excel to become an actual Excel Spreadsheet.

So there are things you could have overlooked. Besides even just the usual Ole control you already focused on replacing. It's not hard to overlook something.

Which loops back to perhaps not knowing SCXes and VCXes are DBF tables: Because if you knew that, it would be easy to ensure you have worked on every form or class that uses OLE, if you looked for content in the OLE2 fields of all SCX and VCX and FRX and LBX files in your project.

Chriss
 
Hello Martina,

I've about 120 scx-files in my program.

I thought about the pjx-file (the project file).

But 493 is marked as deleted and it contains the name of a DBF.
Any idea?

thanks Harald


 
Hello Chris,

thank you.

I will go over my scxes and look for the content as you and Martine told.

I will report later.

Thanks Harald
 
The error message should tell the SCX or VCX name, not 100%, but pretty sure.

Harry Clipper said:
I've about 120 scx-files in my program.
Even if the message doesn't tell which file. You're limited to SCXes or VCXes having at least 493 records. And data in Ole2 at record 493.

And a for-each loop would make things easier than manually going through 120 forms, too:
Code:
For Each loFile in _vfp.activeproject.Files
...
Not all files are tables, of course... You also have PRGs, images and some more that can't be USEd, but you can find out with loFile.Type or use TRY...CATCH.
Creating code for project analysis isn't magic, once you know most files are data.

Chriss
 
Well, and record number 493 of possibly even more objects. Maybe less per class, if it's a library with several classes each of "normal" size.

But if it's an SCX it points out it's an object of very many. It's easy to overlook an Ole control when it's on a page of a pageframe, that's embedded on the page of an outer pageframe, for example. Or even deeper nested. So manual inspection only you likely overlook something.

Chriss
 
Hello Chris,

I was able to find the control.

It was autside the visible part of my biggest form.

after removal all was fine.

many thanks to you and also Martina!

Harald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top