ThinkGeo.com    |     Documentation    |     Premium Support

Problem with ExecuteQuery

 I have a problem when I run execute query against shape files where it is one of a number of shape files with the same first 8 characters.


The problem seems to be that the way that the short file name is generated for OLE DB does not match with the way Windows has generated the short filename.


The error message I get is The Microsoft Jet database engine could not find the object 'AI56-9~5 '


I have attached a screenshot illustrating this:



Note the last shape file. You would expect the short filename to be AI56-9~5 but windows has mangled it.


Cheers


Steve



Hi Steve, 
  
 We haven’t met the situation you mentioned before, could you upload a really simple sample which can reproduce your problem so our developer can work for you? 
  
 Regards, 
  
 Don

I am having this same problem.  Has this been fixed? 



To reproduce, have 5 shapefiles in the same directory where the first 6 characters in the filenames are the same, but such that the filenames are longer than 8 characters.  The data in the shapefiles does not matter. 



For example, 

abcdef____1.shp 

abcdef____2.shp 

abcdef____3.shp 

abcdef____4.shp 

abcdef____5.shp 





Now you will find that while the first 4 files can be queried successfully, the exception is thrown when querying the 5th file: 



ShapeFileFeatureSource.ExecuteQuery(String.Format("select * from [{1}]", System.IO.Path.GetFileNameWithoutExtension(ShapeFileFeatureSource.ShapePathFileName)))



Hi Matt, 
  
 We are confirming with our development team now, If anything I get, I will update it here. Sorry for the inconvenience . 
  
 Thanks, 
 Johnny

Hi Matt, 
  
 Thanks for reporting the problem, which is proved to be a bug in Map Suite, it has been fixed now, can you download the lasted "Development" version 6.0.319.0 to have a try? 
  
 Thanks, 
 Johnny

Thanks Johnny, 
  
 We appreciate the fast response time on this.  I have downloaded Development Build 6.0.322.0 and have verified that this issue is fixed.  Will this be merged into the production build?

Hell Matt, 
  
 We are prepare MapSuite 7.0 public release, so most time we won’t synchronize anything to release version(production build) for now, if you have some special requirements for this, please feel free to let us know. 
  
 Regards, 
  
 Gary

We can use the development build.  Thanks for your help on this!

Hello Matt, 
  
 You are welcome! 
  
 Regards, 
  
 Gary

Hello, I have the same problem of this post. I´m using mapsuite v 8.0.0.50 and the problem occurs only in windows server 2012 R2, do you know if in that version the mentioned bug exists?

Thanks in advance.

Hi Julieta,

I find a 2012 VM but hadn’t succeed reproduce that with the latest version.

So I think I need more detail description include your data names and your test code, if I missed anything I can find that from your description.

And if possible could you please have another try with our latest 9.0 in your environment?

Because the problem if we reproduce that with 8.0, our developer cannot fix that for your currently version.

Regards,

Don

Hello, we are using Windows Authentication and it seems the shape files cannot be opened, I get the error The Microsoft Jet database engine could not find the object ‘namefile’. I can´t use mapsuite 9.0 because we don´t have that license.
Do yoy think the problem could be related to this post ? https://support.microsoft.com/en-us/kb/209685

Thanks in advance.

Hi Julieta,

From the symptoms description, it looks that’s the same problem like yours.

From this link, it looks microsoft think the solution is rename your file.

But I want to double check with you, have you tried to reproduce it in other OS like win7 win8 or win10. And have you tried to reduce the file number, then find which file make this exception is thrown, and only rename this file to see whether it can be solved.

If rename files cannot be used for your scenario, we need more information to reproduce that first, and research whether we can solve that from our product.

Regards,

Don

Hello Don, we have used the program “ProcessMonitor”, that program is provided by microsoft. With that program we notice that the file name is truncated, by example if file name is “configestilos” the exception is thrown because its trying to open “configes.dbf” and the exception shows that “the file not exists”.

We reproduced the same with win7, win8 and server 2012 R2, but only with server 2012 R2 the exception is thrown. I reduced the lenght of filename to 8, and that solve the problem.

I´m worried about this post because other programmers said that the lenght of shape files must be 8, we need to use file names with more than 8. I´d like to know if the problem is for executequery only or for other type of queries, I mean those related with featuresource, like QueryTools.GetFeaturesByColumnValue or other similar ?

Thanks in advance

Hi Julieta,

That’s different, the Executequery is implemented by OLEDB, so the limitation is related with system. The other query is implemented by managed code.

I think you can did a quickly test about it on 2012 R2.

Wish that’s helpful.

Regards,

Don