473,387 Members | 1,362 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.

ASP OLE Import of access files with named areas : formules in column title

Hi,

I have a very tricky problem...

I import an XLS file from my asp web application; this xls file
contains lots of single-cell named areas.
Usually, I know how to get them, this way :

' Create temporary dataset
Dim ds As New DataSet
' Get the nammed area
Dim myData As New OleDbDataAdapter("SELECT * FROM Name_Of_Area",
OleConnectionToAccessFile)
myData.TableMappings.Add("Table", "Name_Of_Area")
' Fill the temporary dataset
myData.Fill(ds)
' As the first row is always assumed as containing the names of the
columns of the zone
' If I get the first column name of the resulting dataset, I get the
value I want.
Return ds.Tables("Name_Of_Area").Columns(0).ColumnName

THIS WORKS FINE....MOST OF THE TIME...
The problem I have is that in my access file, one of the named areas
contains the date value [12/10/2006]
If I use the code above, it returns [F1]
If I put a quote juste before my date in the access file (e.g.
['12/10/2006]) to tell Access it's a string, it works back again,
returning [12/10/2006] (and I have the same problem if the cell
contains a formula)
The problem is that this access file is meant to be filled by lots of
users and I can't ask them to put a quote before each date they enter.

When I import a bigger named area which have more than 1 row, all
subsequent rows are correctly retrived because they are part of the
data of the table that is assumed by OLDEB in the named area. only the
first row has problem because OLEDB wants column names and nothing else
in this first row.

MY QUESTION :
How can I force OLEDB to NOT import column names from my nammed area
and start importing data from the very first row.
I can NOT change my nammed zone my moving it 1 row upwards and
increasing its height, this is not an option.

Thank you for your answers !!

Oct 20 '06 #1
1 2095
Hi again,

I have found my problem (and solution) by searching then msdn documentation

On the connexion string, I just added HDR=No parameter (like IMEX=1) to tell
access NOT to return column names.

As usual, this was a RTFM case !!

Bye
"The_Fakir_42" <fr*****************@tiscali.fra écrit dans le message de
news: 11**********************@m73g2000cwd.googlegroups. com...
Hi,

I have a very tricky problem...

I import an XLS file from my asp web application; this xls file
contains lots of single-cell named areas.
Usually, I know how to get them, this way :

' Create temporary dataset
Dim ds As New DataSet
' Get the nammed area
Dim myData As New OleDbDataAdapter("SELECT * FROM Name_Of_Area",
OleConnectionToAccessFile)
myData.TableMappings.Add("Table", "Name_Of_Area")
' Fill the temporary dataset
myData.Fill(ds)
' As the first row is always assumed as containing the names of the
columns of the zone
' If I get the first column name of the resulting dataset, I get the
value I want.
Return ds.Tables("Name_Of_Area").Columns(0).ColumnName

THIS WORKS FINE....MOST OF THE TIME...
The problem I have is that in my access file, one of the named areas
contains the date value [12/10/2006]
If I use the code above, it returns [F1]
If I put a quote juste before my date in the access file (e.g.
['12/10/2006]) to tell Access it's a string, it works back again,
returning [12/10/2006] (and I have the same problem if the cell
contains a formula)
The problem is that this access file is meant to be filled by lots of
users and I can't ask them to put a quote before each date they enter.

When I import a bigger named area which have more than 1 row, all
subsequent rows are correctly retrived because they are part of the
data of the table that is assumed by OLDEB in the named area. only the
first row has problem because OLEDB wants column names and nothing else
in this first row.

MY QUESTION :
How can I force OLEDB to NOT import column names from my nammed area
and start importing data from the very first row.
I can NOT change my nammed zone my moving it 1 row upwards and
increasing its height, this is not an option.

Thank you for your answers !!

Oct 23 '06 #2

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

Similar topics

2
by: The Pig | last post by:
Guys, Got a bunch of DBF files all named pikcup.dbf. They are all stored under a directory named c:\reports but are all under multiple sub directories. I need Access to import all pickup.dbf...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: John Hewitt | last post by:
A 'newbie' question - importing into Access from Excel. Googled the group postings but I can't find the amswer I have a 50 line three column file in Excel that contains Names and Tel numbers....
3
by: ninrulz | last post by:
I will try to explain my situation. I know that it is hard to offers solutions without fully understanding what people would like to achieve. I receive 2 csv files every month. The csv files...
11
by: kaisersose1995 | last post by:
Hi, I've got an import procedure working, using a standard import specification to import a .csv file into a temporary table. The problem i'm having is that i have 4 different sets of borrower...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
7
by: Pete | last post by:
I need to import multiple tab delimited files for which I do not have the formats. All files have column headers in the the line. The files must be dynamic. The only common value is that the...
18
by: PW | last post by:
Convert them to CSV in Excel, then use TransferText (which does not work correctly and also doesn't accept XLS/Excel files directly) or create a link to an Excel XLS workbook and do an Append Query...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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: 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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.