LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Import CSV fieldname problem

I'm tring to import a csv file by using the following code:

Dim csvFolder As String
Dim sConnectionString As String
Dim objConn As New ADODB.Connection
Dim rs As New Recordset

csvFolder = "C:\csvdata\"
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & csvFolder & ";Extended Properties=Text;"
objConn.Open sConnectionString

SelectStr = "SELECT testing_A1D from Main.csv"
rs.Open SelectStr, objConn, adOpenDynamic

When I run the code, I got the following error message:
"No value given for one or more required parameters"

But if I try to use "Select * " I can get the data. However, I noted that
the fieldname changed to "testing_A#1D".

I also tried "SELECT testing_A#1D from Main.csv", but I got another error:
Syntax errro in date in query expression 'testing_A#1D'

Please advice how to solve the problem. Thanks


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Problem Pepper New Users to Excel 2 November 21st 08 10:52 PM
Import problem µ New Users to Excel 0 April 24th 07 10:27 AM
How to know Rank Of FieldName ?? Samary Excel Worksheet Functions 0 April 26th 06 04:23 AM
Save file as filename plus fieldname annep[_2_] Excel Programming 1 December 18th 05 11:03 PM
Import problem Ted Rogers New Users to Excel 9 July 14th 05 10:52 PM


All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"