[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Zachary Burns

1/10/2003 4:06:00 PM

I've got a problem. I am trying to connect to a DBF file using the
following code. It worked on a test DBF file, but not this particular one.
I get an error at the dbReader = dbCommand.ExecuteReader() line and it says:
"ERROR [HY000] [Microsoft][ODBC dBase Driver] Unexpected error from external
database driver [10023]. Can anybody give me any clues as to why this would
happen. The using another client application.

Zack

Microsoft.Data.Odbc.OdbcConnection dbConnection = new
Microsoft.Data.Odbc.OdbcConnection("Driver={Microsoft dBase Driver
(*.dbf)};DBQ=C:\\PfeCode");
dbConnection.Open();
Microsoft.Data.Odbc.OdbcCommand dbCommand = new
Microsoft.Data.Odbc.OdbcCommand("SELECT * FROM payhist",dbConnection);
Microsoft.Data.Odbc.OdbcDataReader dbReader;
dbReader = dbCommand.ExecuteReader();
while(dbReader.Read())
{
lblStatus.Text = dbReader[0].ToString();
lblStatus.Refresh();
}
dbConnection.Close();


2 Answers

Zachary Burns

1/10/2003 5:05:00 PM

0

An additional note: Deleting the index (CDX) from the DBF file allowed it to
open up, but that would be problematic on my production database. Does this
make any sense?

Zack

"Zachary Burns" <zacharyburns@hotsmail.com> wrote in message
news:OSOiPlLuCHA.2124@TK2MSFTNGP12...
> I've got a problem. I am trying to connect to a DBF file using the
> following code. It worked on a test DBF file, but not this particular
one.
> I get an error at the dbReader = dbCommand.ExecuteReader() line and it
says:
> "ERROR [HY000] [Microsoft][ODBC dBase Driver] Unexpected error from
external
> database driver [10023]. Can anybody give me any clues as to why this
would
> happen. The using another client application.
>
> Zack
>
> Microsoft.Data.Odbc.OdbcConnection dbConnection = new
> Microsoft.Data.Odbc.OdbcConnection("Driver={Microsoft dBase Driver
> (*.dbf)};DBQ=C:\\PfeCode");
> dbConnection.Open();
> Microsoft.Data.Odbc.OdbcCommand dbCommand = new
> Microsoft.Data.Odbc.OdbcCommand("SELECT * FROM payhist",dbConnection);
> Microsoft.Data.Odbc.OdbcDataReader dbReader;
> dbReader = dbCommand.ExecuteReader();
> while(dbReader.Read())
> {
> lblStatus.Text = dbReader[0].ToString();
> lblStatus.Refresh();
> }
> dbConnection.Close();
>
>


Zachary Burns

1/13/2003 5:09:00 PM

0

Okay....no help from Microsoft or the group, but if anybody comes across
this I just did the following:

1.) Downloaded Visual Foxpro 8.0 Beta from Microsoft
2.) Installed on an old Windows 98 machine I had
2a.) Had to uncompress the Beta to a directory other than what Microsoft had
setup, otherwise their install wouldn't run
3.) Took VFPOLEDB.DLL and VFPOLEDB.MSM and copied them to my development
machine and stuck them in C:\Program Files\Common Files\System\OLE DB
4.) Ran the command "regsvr32 vfpoledb.dll" to register the dll.

After that, just used the standard OLEDB connection string for dbf files.
So far working and having no problems connecting to this free table. So I
basically was not able to use the ODBC connection. Ah, the joys of open
database connectivity!

Don't you just love talking to yourself.....Hope this helps someone out some
day.

Zack

"Zachary Burns" <zacharyburns@hotsmail.com> wrote in message
news:eCi#TGMuCHA.1668@TK2MSFTNGP09...
> An additional note: Deleting the index (CDX) from the DBF file allowed it
to
> open up, but that would be problematic on my production database. Does
this
> make any sense?
>
> Zack
>
> "Zachary Burns" <zacharyburns@hotsmail.com> wrote in message
> news:OSOiPlLuCHA.2124@TK2MSFTNGP12...
> > I've got a problem. I am trying to connect to a DBF file using the
> > following code. It worked on a test DBF file, but not this particular
> one.
> > I get an error at the dbReader = dbCommand.ExecuteReader() line and it
> says:
> > "ERROR [HY000] [Microsoft][ODBC dBase Driver] Unexpected error from
> external
> > database driver [10023]. Can anybody give me any clues as to why this
> would
> > happen. The using another client application.
> >
> > Zack
> >
> > Microsoft.Data.Odbc.OdbcConnection dbConnection = new
> > Microsoft.Data.Odbc.OdbcConnection("Driver={Microsoft dBase Driver
> > (*.dbf)};DBQ=C:\\PfeCode");
> > dbConnection.Open();
> > Microsoft.Data.Odbc.OdbcCommand dbCommand = new
> > Microsoft.Data.Odbc.OdbcCommand("SELECT * FROM payhist",dbConnection);
> > Microsoft.Data.Odbc.OdbcDataReader dbReader;
> > dbReader = dbCommand.ExecuteReader();
> > while(dbReader.Read())
> > {
> > lblStatus.Text = dbReader[0].ToString();
> > lblStatus.Refresh();
> > }
> > dbConnection.Close();
> >
> >
>
>