Wrox Home  
Search P2P Archive for: Go

  Return to Index  

activex_data_objects thread: Import spreadsheet whose name contains spaces using ado


Message #1 by throwback10019@y... on Mon, 3 Mar 2003 03:49:01
I have had a problem formulating an sql string for ado. I have no problem 
importing an excel spreadsheet which doesn't contain spaces, but can't 
seem to import whose name contains spaces(e.g., "my spreadsheet"). Does 
anyone know how to do this with ado?

Regards,

Scott
Message #2 by "Tom" <research@a...> on Mon, 3 Mar 2003 00:22:42 -0500
Are you trying to open a worksheet using ado and place the contents in a
recordset?

You could try this...

rs.open = "select * from [your sheet name$]", conn

Where rs is a recordset and conn is the connection you have opened to the
excel file.

Tom

----- Original Message -----
From: <throwback10019@y...>
To: "ActiveX_Data_Objects" <activex_data_objects@p...>
Sent: Monday, March 03, 2003 3:49 AM
Subject: [activex_data_objects] Import spreadsheet whose name contains
spaces using ado


> I have had a problem formulating an sql string for ado. I have no problem
> importing an excel spreadsheet which doesn't contain spaces, but can't
> seem to import whose name contains spaces(e.g., "my spreadsheet"). Does
> anyone know how to do this with ado?
>
> Regards,
>
> Scott
>

Message #3 by throwback10019@y... on Mon, 3 Mar 2003 05:50:20
> Are you trying to open a worksheet using ado and place the contents in a
recordset?

>>>>>>>>>>>>>>yes

You could try this...

rs.open = "select * from [your sheet name$]", conn

>>>>>>>>>>>>>>That was the exact synatx I used which works fine if the 
spreadsheet name is only one word or two words connected with an 
underscore. However, if the name of the spreadsheet contains spaces 
without an underscore, it fails..

Where rs is a recordset and conn is the connection you have opened to the
excel file.

Tom


  Return to Index