|
-
Aug 7th, 2000, 10:57 AM
#1
I have a CSV file called "olb.txt" with 5 fields. I created a User ODBC source called "TEST" with the fields defined as:
StartDate
StartTime
AppName
Agent
Duration
While I've successfully used ADO to connect to an Access database, I can't get ADO to connect to this ODBC file and keep getting the error message that the driver is unrecognized.
Can someone tell me how to setup the connection string?
Thanks.
-
Aug 7th, 2000, 11:48 AM
#2
Frenzied Member
Ca you use the Jet "transferSpreadsheet" function to copy the table into Access and manipulate it from there?
-
Aug 7th, 2000, 12:07 PM
#3
New Member
If is of any help, check the preferences.
-
Aug 7th, 2000, 10:41 PM
#4
Guru
Here is how you can connect to a CSV file without using ODBC or Automation:
Code:
'Uses ADO 2.1/5
Dim cn As ADODB.Connection
Dim rs As Recordset
Set cn = New Connection
Set rs = New Recordset
'open connection to folder that contains the CSV file
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=Text;"
'open the file
rs.Open "select * from test.csv", cn
'we have data
MsgBox rs.Fields(1).Value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|