469,291 Members | 1,717 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,291 developers. It's quick & easy.

ODBC / Vista / Foxpro

I have installed our .NET application on a system running Microsoft Windows
Vista operating system.

When I run our application, I receive the following error message whenever
it tries to create a DBF file using VFPODBC:
"ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support this
function"

I am using a connection string that I have used for many years with no
problems, here is some sample C# code:

try
{
string connectionStatement = "Driver={Microsoft Visual FoxPro
Driver};SourceType=DBF;SourceDb=C:\\temp";
string createTableStatement = "CREATE TABLE [c:\\temp\\test] FREE(field1
C(10), field2 C(10), field3 C(10))";

OdbcConnection dbConnection = new OdbcConnection(connectionStatement);
dbConnection.Open();

OdbcCommand createCmd = new OdbcCommand(createTableStatement,
dbConnection);
createCmd.ExecuteNonQuery(); <<<< Fails here with the
message above >>>>
}
catch( System.Exception e )
{
MessageBox.Show(e.Message, "Error Creating Report Table"
,MessageBoxButtons.OK, MessageBoxIcon.Error);
}
How can I get my program to work in Vista (32 and 64bit)?
Rob

Oct 11 '06 #1
4 8172

"Robert Hooker" <rh*****@noemail.noemailwrote in message
news:OG**************@TK2MSFTNGP05.phx.gbl...
>I have installed our .NET application on a system running Microsoft Windows
Vista operating system.

When I run our application, I receive the following error message whenever
it tries to create a DBF file using VFPODBC:
"ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support
this function"

I am using a connection string that I have used for many years with no
problems, here is some sample C# code:

try
{
string connectionStatement = "Driver={Microsoft Visual FoxPro
Driver};SourceType=DBF;SourceDb=C:\\temp";
string createTableStatement = "CREATE TABLE [c:\\temp\\test] FREE(field1
C(10), field2 C(10), field3 C(10))";

OdbcConnection dbConnection = new OdbcConnection(connectionStatement);
dbConnection.Open();

OdbcCommand createCmd = new OdbcCommand(createTableStatement,
dbConnection);
createCmd.ExecuteNonQuery(); <<<< Fails here with the
message above >>>>
}
catch( System.Exception e )
{
MessageBox.Show(e.Message, "Error Creating Report Table"
,MessageBoxButtons.OK, MessageBoxIcon.Error);
}
How can I get my program to work in Vista (32 and 64bit)?
Rob
You could try:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<path>;Extended
Properties=dBASE IV;User ID=Admin;Password="

as the connection string and use OleDb instead of ODBC.

HTH,
Mythran
Oct 11 '06 #2
Small correction:

It actually fails here:
dbConnection.Open();
"Robert Hooker" <rh*****@noemail.noemailwrote in message
news:OG**************@TK2MSFTNGP05.phx.gbl...
>I have installed our .NET application on a system running Microsoft Windows
Vista operating system.

When I run our application, I receive the following error message whenever
it tries to create a DBF file using VFPODBC:
"ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support
this function"

I am using a connection string that I have used for many years with no
problems, here is some sample C# code:

try
{
string connectionStatement = "Driver={Microsoft Visual FoxPro
Driver};SourceType=DBF;SourceDb=C:\\temp";
string createTableStatement = "CREATE TABLE [c:\\temp\\test] FREE(field1
C(10), field2 C(10), field3 C(10))";

OdbcConnection dbConnection = new OdbcConnection(connectionStatement);
dbConnection.Open();

OdbcCommand createCmd = new OdbcCommand(createTableStatement,
dbConnection);
createCmd.ExecuteNonQuery(); <<<< Fails here with the
message above >>>>
}
catch( System.Exception e )
{
MessageBox.Show(e.Message, "Error Creating Report Table"
,MessageBoxButtons.OK, MessageBoxIcon.Error);
}
How can I get my program to work in Vista (32 and 64bit)?
Rob

Oct 11 '06 #3
Hi Mythran,

For the record, not all DBFs are compatible with the dBase driver. FoxPro
DBFs created with VFP3-6 may be accessed via the FoxPro and Visual FoxPro
ODBC drivers, downloadable from
msdn.microsoft.com/vfoxpro/downloads/updates/odbc, and also DBFs that are
created with VFP7-9 if they don't use any of the new data features added in
VFP7 and above.

All versions of FoxPro DBFs are accessible via the FoxPro and Visual FoxPro
OLE DB data provider, downloadable from
msdn.microsoft.com/vfoxpro/downloads/updates .
--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
ci***@cindywinegarden.com
"Mythran" <ki********@hotmail.comwrote in message
news:em**************@TK2MSFTNGP03.phx.gbl...
>
"Robert Hooker" <rh*****@noemail.noemailwrote in message
news:OG**************@TK2MSFTNGP05.phx.gbl...
You could try:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<path>;Extended
Properties=dBASE IV;User ID=Admin;Password="

as the connection string and use OleDb instead of ODBC.

Oct 11 '06 #4
Hi Robert,

Have you tried the FoxPro and Visual FoxPro OLE DB data provider,
downloadable from msdn.microsoft.com/vfoxpro/downloads/updates ? A typical
OLE DB data provider connection string (in VB) looks like:

connString = "Provider = VFPOLEDB.1; Data Source = C:\Temp;"

You can only work with Visual FoxPro ODBC or OLE DB in a 64-bit environment
in compatibility mode. There are no plans to create a 64-bit FoxPro ODBC
driver or OLD DB data provider. I'm told there will, however, be a .NET data
provider for FoxPro.

--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
ci***@cindywinegarden.com
"Robert Hooker" <rh*****@noemail.noemailwrote in message
news:ON**************@TK2MSFTNGP04.phx.gbl...
It actually fails here:
dbConnection.Open();
>"ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support
this function"
>try
{
string connectionStatement = "Driver={Microsoft Visual FoxPro
Driver};SourceType=DBF;SourceDb=C:\\temp";
string createTableStatement = "CREATE TABLE [c:\\temp\\test]
FREE(field1 C(10), field2 C(10), field3 C(10))";

OdbcConnection dbConnection = new OdbcConnection(connectionStatement);
dbConnection.Open();
>How can I get my program to work in Vista (32 and 64bit)?

Oct 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Salad | last post: by
4 posts views Thread by Robert Hooker | last post: by
3 posts views Thread by Salad | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.