Mythran
10/11/2006 4:37:00 PM
"Robert Hooker" <rhooker@noemail.noemail> wrote in message
news:OG3ny8U7GHA.4552@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