QIF text file and ADO

K

Keith Bozek

For demonstration purposes, I am trying to open a QIF file via the
OleDbConnection->OleDbCommand->OleDbDataReader. If I maintain the QIF
extension, I encounter the Database or object is read-only error when
I atttempt to execute the DataReader against a QIF file. However, if
I use the .txt extension the code is happy.

I have been looking around but just cannot remember how to set
extended properties so that it knows about a QIF file.


Keith

ERROR:
An exception occurred. Message: Cannot update. Database or object is
read-only.
ErrorCode: -2147217911
Source: Microsoft JET Database Engine

CODE BLOCK:
OleDbConnection conn = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + strPath + ";" +
"Extended

Properties=\"text;HDR=NO;FMT=Delimited\"");
conn.Open();
OleDbCommand SearchCmd = new OleDbCommand ("SELECT * FROM
Quicken.qif", conn);
OleDbDataReader Reader =
SearchCmd.ExecuteReader(CommandBehavior.Default);
 
P

Paul Clement

On 19 Aug 2003 21:58:47 -0700, (e-mail address removed) (Keith Bozek) wrote:

¤ For demonstration purposes, I am trying to open a QIF file via the
¤ OleDbConnection->OleDbCommand->OleDbDataReader. If I maintain the QIF
¤ extension, I encounter the Database or object is read-only error when
¤ I atttempt to execute the DataReader against a QIF file. However, if
¤ I use the .txt extension the code is happy.
¤
¤ I have been looking around but just cannot remember how to set
¤ extended properties so that it knows about a QIF file.
¤
¤
¤ Keith
¤
¤ ERROR:
¤ An exception occurred. Message: Cannot update. Database or object is
¤ read-only.
¤ ErrorCode: -2147217911
¤ Source: Microsoft JET Database Engine
¤
¤ CODE BLOCK:
¤ OleDbConnection conn = new OleDbConnection(
¤ "Provider=Microsoft.Jet.OLEDB.4.0;" +
¤ "Data Source=" + strPath + ";" +
¤ "Extended
¤
¤ Properties=\"text;HDR=NO;FMT=Delimited\"");
¤ conn.Open();
¤ OleDbCommand SearchCmd = new OleDbCommand ("SELECT * FROM
¤ Quicken.qif", conn);
¤ OleDbDataReader Reader =
¤ SearchCmd.ExecuteReader(CommandBehavior.Default);

You need to add the custom extension to a Registry entry for the Text ISAM:

See the following:

ACC2000: How to Import a Text File That Has an Extension That Access Does Not Recognize
http://support.microsoft.com/default.aspx?scid=kb;en-us;306144


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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

Top