This is a multi-part message in MIME format.
------=_NextPart_000_01AA_01C3BAA0.55E26560
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hope somebody can help...
I'm trying to load up a text file using ADO.net, as follows:
Dim TextConnectionString As String
TextConnectionString =3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _
"Data Source=3D" & FilePath & ";" & _
"Extended Properties=3D""Text;HDR=3DNO;FORMAT=3DDelimited"""
Dim TextConn As New =
System.Data.OleDb.OleDbConnection(TextConnectionString)
TextConn.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from " & =
filename, TextConn)
Dim ds As DataSet =3D New DataSet("CSVFiles")
da.Fill(ds, filename)
When I run this, it fails at the "fill" statement with the error =
"Database
or object is read only".
The file in question can definitely be read and written (it's a short =
CSV
file). What have I done wrong???
Many thanks in advance.
Simon
------=_NextPart_000_01AA_01C3BAA0.55E26560
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hope somebody can help...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR><FONT face=3DArial><FONT =
size=3D2>I'm trying=20
to load up a text file using ADO.net, as follows:<BR><BR></FONT><FONT=20
size=3D2><FONT face=3D"Courier New">Dim TextConnectionString As=20
String<BR>TextConnectionString =3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;" =
&=20
_<BR>"Data Source=3D" & FilePath & ";" & _<BR>"Extended=20
Properties=3D""Text;HDR=3DNO;FORMAT=3DDelimited"""<BR>Dim TextConn As =
New=20
System.Data.OleDb.OleDbConnection(TextConnectionString)<BR>TextConn.Open(=
)<BR>Dim=20
da As New System.Data.OleDb.OleDbDataAdapter("Select * from " & =
filename,=20
TextConn)<BR>Dim ds As DataSet =3D New =
DataSet("CSVFiles")<BR>da.Fill(ds,=20
filename)<BR></FONT><BR><BR>When I run this, it fails at the "fill" =
statement=20
with the error "Database<BR>or object is read only".<BR><BR>The =
file in=20
question can definitely be read and written (it's a short=20
CSV<BR>file). What have I done =
wrong???<BR><BR>Many=20
thanks in=20
advance.<BR><BR><BR>Simon<BR><BR><BR><BR><BR><BR></FONT></FONT></DIV></BO=
DY></HTML>
------=_NextPart_000_01AA_01C3BAA0.55E26560--