473,811 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 OleDbDataAdapte r("SELECT * FROM Name_Of_Area",
OleConnectionTo AccessFile)
myData.TableMap pings.Add("Tabl e", "Name_Of_Ar ea")
' 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").Colu mns(0).ColumnNa me

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 2116
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.f ra écrit dans le message de
news: 11************* *********@m73g2 00...legr oups.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 OleDbDataAdapte r("SELECT * FROM Name_Of_Area",
OleConnectionTo AccessFile)
myData.TableMap pings.Add("Tabl e", "Name_Of_Ar ea")
' 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").Colu mns(0).ColumnNa me

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
2543
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 files into a single table. I have no idea where to start. Any ideas. The Pig
6
4766
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 appreciated. Thanks in advance
1
2486
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. Each column is named to agree with the Access database. Read the instructions "Import Excel files into an Access database". Followed them to the letter. Everything goes well until the final Wizard action is clicked "Import to table 'PHONEDIR'.
3
8826
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 change name each month. Each file contains 13 columns and around 20k rows. In each file, the first row is the heading. I have created a database that helps me sort out the data. Prior to importing into the database, I have been copying the csv...
11
2468
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 details on the same line e.g. B1-Title, B1-Initials, B1-Surname, B2-Title, B2-Initials, B2-Surname, etc. all linked to my main borrower table via an unique account number. My 1st append query matches which account numbers are new to the main...
13
4905
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, suggestions or improvements? if( wmv file) document.write("<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 height="354" width="479">
7
12275
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 files are text and use tabs to delimit the column data. I can not use the File/Import as people using the program do not have the necessary experience to perform this function. Therefore, I need to programtically create unique tables for each...
18
2570
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 (as some have suggested here)?? I find that hard to believe as Access is part of MS Office and Visual FoxPro is not. I split my time using both and I can do a simple copy command to XLS in VFP or an Append command to DBF or use Office...
6
26337
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 one table. My problem is I have two buttons I want to use this code for for the two buttons would put the data in different tables. I have tried copying and changing a few things and nothing will work for me. The code is set up in a module and then I...
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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
10386
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
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
7669
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...
1
4339
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
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
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.