473,386 Members | 1,873 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,386 software developers and data experts.

Microsoft.Jet text file query

I'm trying to read a CSV file that happens to have some spaces in
it...(Land - Lot.csv) For some reason, the SQL statement can't find
the file...ne1?

// CSV file connection
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
OleDbConnection oleCon = new OleDbConnection(strCon);
oleCon.Open();

strSQL = "SELECT * FROM Land - Lot.csv";
OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
TIA,
~Gordon
Nov 18 '05 #1
3 1833
Hi Gordon,

Try using brackets around the file in the SQL Statement: [Land - Lot.csv]

Alex Papadimoulis
"Simple Simon" <re***@newsgroup.only> wrote in message
news:tm********************************@4ax.com...
I'm trying to read a CSV file that happens to have some spaces in
it...(Land - Lot.csv) For some reason, the SQL statement can't find
the file...ne1?

// CSV file connection
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
OleDbConnection oleCon = new OleDbConnection(strCon);
oleCon.Open();

strSQL = "SELECT * FROM Land - Lot.csv";
OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
TIA,
~Gordon

Nov 18 '05 #2
Hi Alex,
Thxs for replying...No go :(

~Gordon

On Fri, 5 Dec 2003 16:07:21 -0500, "Alex Papadimoulis"
<alexp-at-halogenstudios.com> wrote:
Hi Gordon,

Try using brackets around the file in the SQL Statement: [Land - Lot.csv]

Alex Papadimoulis
"Simple Simon" <re***@newsgroup.only> wrote in message
news:tm********************************@4ax.com.. .
I'm trying to read a CSV file that happens to have some spaces in
it...(Land - Lot.csv) For some reason, the SQL statement can't find
the file...ne1?

// CSV file connection
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
OleDbConnection oleCon = new OleDbConnection(strCon);
oleCon.Open();

strSQL = "SELECT * FROM Land - Lot.csv";
OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
TIA,
~Gordon


Nov 18 '05 #3
Wait! It does work...sorry, I forgot to update the filename in my
schema.ini file.

Thank you!

On Fri, 5 Dec 2003 16:07:21 -0500, "Alex Papadimoulis"
<alexp-at-halogenstudios.com> wrote:
Hi Gordon,

Try using brackets around the file in the SQL Statement: [Land - Lot.csv]

Alex Papadimoulis
"Simple Simon" <re***@newsgroup.only> wrote in message
news:tm********************************@4ax.com.. .
I'm trying to read a CSV file that happens to have some spaces in
it...(Land - Lot.csv) For some reason, the SQL statement can't find
the file...ne1?

// CSV file connection
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\Temp;Extended Properties=\"Text;HDR=YES;FTM=Delimited\"";
OleDbConnection oleCon = new OleDbConnection(strCon);
oleCon.Open();

strSQL = "SELECT * FROM Land - Lot.csv";
OleDbDataAdapter daRead = new OleDbDataAdapter(strSQL, oleCon);
TIA,
~Gordon


Nov 18 '05 #4

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

Similar topics

7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
0
by: Rob | last post by:
I doubt this is the best way to do it, but what I came up with was to hide the XML in an HTML Comment then edit the file deleting the HTML stuff and keep the XML results. If anyone has a better...
1
by: PaulieS | last post by:
Hi all. Am migrating a customer from IIS5 on W2K server to IIS6 on W2K3. Zipped all the websites and unzipped them to the identical locations on new server. Used IISMT to migrate metabase. ...
1
by: JNariss | last post by:
Hello, I have created a connection to my Access database with Dreamweaver and made a simple form with 4 fields. The code behind this form was/is: <%@LANGUAGE="VBCRIPT" CODEPAGE="1252"%>...
2
by: nuhura01 | last post by:
Hi.. I'm trying to save query path which is in text box to text file. Below is the coding that i'm using currently: Private Sub SaveQueryPath() 'save to text file Response.Clear()...
0
by: JosAH | last post by:
Greetings, Introduction Last week I was a bit too busy to cook up this part of the article series; sorry for that. This article part wraps up the Text Processing article series. The ...
5
by: md9108 | last post by:
I created, using some borrowed code, an asp search page for our intranet. I'm using frontpage 2003. When I publish I get that complation error on different lines at different times. They all seem...
0
by: Stephen Thomas | last post by:
Hi there I wonder if any one has encountered this problem or can suggest what is wrong. I am trying the a procedure from the msn site but get the following message: Error 1 The type or...
3
by: Wayne | last post by:
I'm trying to automate the export of a query to a text file using code. If I export the query manually I get the exact result that I want i.e. If I select the query then choose File/Export from...
2
by: secutos | last post by:
I have the option of storing data online as text files, or storing data online in a MySQL database. If the information is stored as a text file, all I have to do is a HttpWebRequest to the text file...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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,...
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,...
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...

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.