473,387 Members | 3,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Q:Importing an Excel file into a VB application

Hi

I have a question which I hope somebody can answer. I have written a VB
application with which I want to import an Excel file, analyze the data
within it and do some calculations. There are in fact five sheets in the
Excel file. My original idea was to import the file into access and create a
database file; which I did and worked beautifully. It generated five tables
in the database as expected.

However, I then thought why not bypass access and simply use a ODBC data
adaptor to the Excel file. I did this, using the Wizard, creating a new data
source using a (*.xls) driver, database version Excel 97-2000 (this may be
the problem because it may have been made in 2003), selected the workbook
(the Excel file) etc.

Everything seemed to go smoothly until it came to specify what data the data
adaptor loads into the dataset. For some reason, one of the sheets from the
spreadsheet did not appear in the Query builder section. This is puzzling
because when I imported the spreadsheet into Access, generated an access
database from it, loaded this database into the application I've written,
using exactly the same technique except for the datasource being an Access
driver, all five tables were obtained.

By the way, I'd prefer that any solution that is sent relies on the fact
that it is not necessarily the case that the client machines using the
application will have Access or Excel on their systems.

Can anybody suggest what may have gone wrong? Also, if you could direct me
to sites with details about importing and exporting data from Access/Excel
files I'd be most grateful.

Thanks in advance

Geoff
Nov 20 '05 #1
1 2436
Hi Geoff,

I have sended this link tomorrow by mistake to someone else, however it
should fits you.
Probably the most made mistake is giving the wrong sheet names.

(And do not use ODBC when not absolute needed anymore, that gives you in my
opinion only extra work)

http://msdn.microsoft.com/library/de...ntodataset.asp

I hope this helps?

Cor
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Little PussyCat | last post by:
Hello, I nee to write something that will transfer excel data into an SQL Server table. I have for another database application I wrote have it importing Excel spreadsheet data using cell by...
8
by: harry | last post by:
Hi Folks: I'm trying to do something that looks simple, but I can't make it work right. It's Access 2000 on a Win2000 computer. I create a database with 5 columbs. The data I need to import...
1
by: Paul Smith | last post by:
I am trying to re-write and automate an existing procedure, using Excel as the controlling application. I can find code to handle the importing of data from a CSV file into an Access table, but...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
5
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All...
1
by: thadson | last post by:
Hi, I'm trying to import specific cells from MS Excel 2000 spreadsheets to MS Access 2000 tables then move the spreadsheets to a different directory. I'm very new to this and I'm having trouble...
0
by: Shootah | last post by:
Hi, I have succeeded in adding automated relationships with refference tables after importing an excel file created from a query to an Access database. However I have the following problem: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.