Yogesh
Sat Dec 20 12:35:34 CST 2003
Thx for the reply.. now since Ole db supports full path so=20
there is no need for me to create a dsn...=20
but just fo rknowledge sake.. if i want to create a dsn=20
for Microsoft text driver.. how do i go using managed=20
code...
>-----Original Message-----
>On Sat, 20 Dec 2003 09:56:41 -0800, "Yogesh Shetty"=20
<yogesh_shetty@hotmail.com>
>wrote:
>
>=A4 Just curious to know is there any ole db provider for=20
>=A4 reading csv/text files...=20
>=A4=20
>=A4 i know i can use Ole DB for ODBC ( Text Driver ) or=20
also i=20
>=A4 can use DTSFlatFile ( ships with sQL Server ) but i=20
don't=20
>=A4 want to install sql client on each of the client=20
machine..
>=A4=20
>=A4 in addition is there any managed way of creating a DSN=20
>=A4 rather than going trhu p/invoke...
>=A4=20
>
>Use the Jet OLEDB driver, not the ODBC driver:
>
>ConnectionString =3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _
> "Data Source=3D" & "D:\My Documents\TextFiles"=20
& ";" & _
> "Extended=20
Properties=3D""Text;HDR=3DNO;FMT=3DDelimited"""
>
> Dim TextConn As New=20
System.Data.OleDb.OleDbConnection(ConnectionString)
> TextConn .Open()
> Dim da As New System.Data.OleDb.OleDbDataAdapter
("SELECT * FROM
>Test#csv", TextConn)
>
>If your text files use a field delimiter other than a=20
comma you will need a
>schema.ini file:
>
>
http://msdn.microsoft.com/library/default.asp?
url=3D/library/en-us/odbc/htm/odbcjetsdk_98.asp
>
>A DSN can be created via code. What kind of DSN do you=20
want to create?
>
>
>Paul ~~~ pclement@ameritech.net
>Microsoft MVP (Visual Basic)
>.
>