473,804 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft Excel ODBC Driver Question

Can this driver return to me the names of the active WorkSheets in an
XLS file?

Dec 7 '05 #1
1 1696
On 7 Dec 2005 11:44:36 -0800, za***@construct ion-imaging.com wrote:

¤ Can this driver return to me the names of the active WorkSheets in an
¤ XLS file?

Not really no. If you want a list of Excel Worksheets use the Jet OLEDB Provider with the Excel ISAM
driver and GetOleDbSchemaT able:

Dim ExcelConnection As System.Data.Ole Db.OleDbConnect ion
Dim ExcelTables As DataTable

Try

ExcelConnection = New
System.Data.Ole Db.OleDbConnect ion("Provider=M icrosoft.Jet.OL EDB.4.0;" & _
"Data Source=e:\My Documents\Book1 0.xls;Extended Properties=Exce l 8.0;")

ExcelConnection .Open()

ExcelTables =
ExcelConnection .GetOleDbSchema Table(System.Da ta.OleDb.OleDbS chemaGuid.Table s, New Object() {Nothing,
Nothing, Nothing})

Dim RowCount As Int32
For RowCount = 0 To ExcelTables.Row s.Count - 1
Console.WriteLi ne(ExcelTables. Rows(RowCount)! TABLE_NAME.ToSt ring)
Next RowCount

frmMain.DataGri d1.DataSource = ExcelTables

Catch ex As Exception
MessageBox.Show (ex.Message)
Finally
ExcelConnection .Close()

End Try
Paul
~~~~
Microsoft MVP (Visual Basic)
Dec 8 '05 #2

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

Similar topics

6
25273
by: Geert-Pieter Hof | last post by:
Hello, My VB 6.0 application read and writes data from and to a MS Excel workbook, using the Microsoft.Jet.OLEDB.4.0 provider. Now I want to protect the Excel workbook with a password, but I figured out that it is not possible to open the workbook for data access with ADO (http://support.microsoft.com/?KBID=211378). Is there another way to use a password protected Excel workbook in my
5
8675
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but it requires Microsoft Excel installed on every machine with my program. It is not quite convenient to do so. Is there another way to export data to Excel, or how simply create file of Microsoft Excel format from my program (of cause, the format of...
1
3953
by: GPBSOFT | last post by:
I am Italian developer, escuse me for my bad English I have a problem with ODBC. I must link to a database from Visual FoxPro, I have installed Windows XP Professional with service pack 2. When I try to install driver for Visual FoxPro i see the message: “Error 1918. Error installing ODBC driver: Microsoft Visual FoxPro Driver, ODBC error 13: : Impossibile caricare la libreria di impostazione o del convertitore. Verify that the file...
1
2462
by: Geoff Jones | last post by:
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...
5
3916
by: somersbar | last post by:
hello all, im trying to connect to a microsoft access database from an ASP.NET web form. i keep getting the following error though: ERROR Could not use '(unknown)'; file already in use. ERROR Driver's SQLSetConnectAttr failed ERROR Could not use '(unknown)'; file already in use.
0
755
by: bazzer | last post by:
hey, i am using visual basic.net 2003 and have an ASP.NET webform application thats accessing a microsoft access 2003 database. i kept getting the following error when i tried to run it: ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR Driver's SQLSetConnectAttr failed ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN...
0
12070
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
0
1293
by: rcamarda | last post by:
I have a machine with SQL Server 2000 loaded and I have the ODBC drivers for Excel listed in the ODBC (Administration Data Sources). Office is not loaded on this windows 2003 server. I have another windows 2003 server and it has SQL 2005 Loaded. I can find find any ODBC drivers other than SQL. I need to find where the ODBC Excel Driver came from, as I dont recall specifically loading this driver. I assume that the drivers came from the...
3
2053
by: peteh | last post by:
Hi All; I have tried to find this info on the IBM site, but alas... We are running DB2 v9.1.1 and making extensive use of Information Integrator (now known as Websphere Federation Server?!) to access Oracle and other DB2s (LUW, AS400 and z/OS). We have some requirements to integrate Excel data. In looking at our options 18 months ago (v8.2), we needed some additional Windows components (drivers and ODBC communication software) to make...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.