fill dataset from reding a delimited text file

T

TJS

attempting to read a delimited text file into a dataset using oledb text
file connection

getting this error message when trying to open connection
----------------------------------------------------
System.Data.OleDb.OleDbException:
No error information available: E_NOINTERFACE(0x80004002).
----------------------------------------------------
I have the schema.ini file in the folder with the delimited text file

what's missing ?

====code====
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>

.....
Dim oCon As OleDBConnection = new OleDBConnection
Dim Adapter as OleDBDataAdapter = new OleDBDataAdapter

Dim strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & vFolderPath & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
oCon.ConnectionString = strConnect

Adapter.selectCommand= new OleDbCommand("SELECT * FROM [" & vFileName
&"]",oCon)
Adapter.selectCommand.Connection.Open '<-----error here

Dim ds As New DataSet()
Adapter.Fill(ds)

.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top