[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Two identical(?) projects - one fails, one works

Posted on 2012-03-12
4
Medium Priority
?
203 Views
Last Modified: 2012-03-12
I have attached two seemingly identical VB Express 2010 projects... they both have identical (copied and pasted) code for Button1 to read data from an Excel spreadsheet and display it in a DataGrid... very simple.

However, one project consistently gives me an OLEdb error as you can see in the screenshot (untitled.jpg) and the other works fine... on the same machine (Lenovo W500 laptop)

I have gone through the compilation options, resources, MyProject files, etc for both projects, and I can find no difference. For instance, I made sure the target framework for both was ".NET Framework 4 Client Profile".

I am really scratching my head as to why one works and the other does not... can you detect some difference and/or explain the OLEdb error in this context?
Excel-OLEdb-read-tests.zip
0
Comment
Question by:futuremoose
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37708728
FYI, both run identically for me (both error as they can't find Sheet1, not due to a provider problem).
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 750 total points
ID: 37708998
be sure that the project giving you the error is targeting the x86 platform (it seems to currently target the ANY cpu).
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 750 total points
ID: 37709149
The Jet Database Engine that is used to establish the connection is not recognized by 64-bits applications. You need to set the compilation to 32-bits, that is to x86 in order to work with the Jet, either to connect to Excel or to an Access database.
0
 

Author Closing Comment

by:futuremoose
ID: 37712313
Emoreau and JamesBurger,<br /><br />You were correct in that the x86 platform was being targeted in one project and not the other, although I'm not sure why. <br /><br />I had to do some digging around to figure out how to add "x86" to the list of target CPU's, since only "Any CPU" was listed as an option at first. Once I figured out how to add "x86" and selected it, the project worked. <br /><br />Thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question