It's not your code; it's the data (of course, your code can take this into account).

 

The most likely reason is that the table Inspection_Copy has deleted records in it. You should always issue a "Pack table" statement before any Add Column that gets values by joining from another table.  If you can't pack because the table is (or might be) a layer in a Map window, you can't use Add Column; instead, you must join the two tables with select and do an update on the result.

 

"File # not registered for access" can sometimes happen when another user locks or deletes one of a table's files outside MapInfo, or if the server hosting the table goes down.   But it's far more likely to result from deleted records.  

 

This issue has been around for so long, it's astonishing that it hasn't worked its way into the MapBasic help topic for Add Column (yes, I checked).

 

Hope this helps

Spencer

 

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hayden Fisher
Sent: Thursday, October 05, 2006 7:42 PM
To: [email protected]
Subject: [MI-L] File not registered for access

 

Hi All,

 

If someone could help me out on this one I’d really appreciate it. Having trouble finding what is wrong with this code. The first “Add Column” statement works however the second throws the “File #0 not registered for access” error. So failing on the last line, help!

 

‘********************************Example************************

close all interactive

Open Table "c:\inspections\AMS_Final\MAINTENANCE\Inspection.TAB" as inspection_local Interactive

Open Table "C:\Inetpub\wwwroot\biz_e_asset\AMS_Final\MAINTENANCE\Inspection_Graphic.TAB" as inspection_server Interactive

Open Table "C:\Bizeasset\Inspection_Graphic.TAB" as inspection_copy Interactive

Open Table "C:\Inetpub\wwwroot\biz_e_asset\AMS_Final\rd\lines\core\rd_line.tab"

Register Table "C:\Bizeasset\CompletedInspections.mdb"  Type ACCESS Table "CompletedInspections" Into "C:\Bizeasset\CompletedInspections.TAB"

Open Table "C:\Bizeasset\CompletedInspections.TAB" Interactive

 

select * from inspection_local where inspector = "" into answer

update answer set inspector = "Unknown"

 

Create Map For Inspection_copy CoordSys Earth Projection 8, 33, "m", 147, 0, 0.9996, 500000, 10000000

 

select * from Inspection_local where Inspection_Lookup_Type like "%rd_line%" into answer

Add Column "answer" (Road_Name )From rd_line Set To Road_Name Where asset_id = asset_id

Add Column "answer" (Locality )From rd_line Set To Locality Where asset_id = asset_id

 

Select * from Inspection_local where Uploaded not like "y%" into not_uploaded

insert into inspection_server select * from not_uploaded

insert into inspection_copy select * from not_uploaded

 

Add Column "Inspection_server" (Complete_Date )From CompletedInspections Set To TSDate Where Inspection_Number =oreftext

Add Column "Inspection_copy" (Complete_Date )From CompletedInspections Set To TSDate Where Inspection_Number =oreftext

‘******************************************************************

 

Hayden Fisher

[EMAIL PROTECTED]

 

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to