MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ODBC / Vista / Foxpro

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ODBC Dotnet
Author Message
Robert Hooker



Joined: 08 Aug 2007
Posts: 6

PostPosted: Wed Oct 11, 2006 2:06 pm    Post subject: ODBC / Vista / Foxpro Reply with quote

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

Archived from group: microsoft>public>dotnet>framework>odbcnet
Back to top
View user's profile Send private message
Mythran



Joined: 08 Aug 2007
Posts: 12

PostPosted: Wed Oct 11, 2006 1:36 pm    Post subject: Re: ODBC / Vista / Foxpro Reply with quote

"Robert Hooker" wrote in message @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=;Extended
Properties=dBASE IV;User ID=Admin;Password="

as the connection string and use OleDb instead of ODBC.

HTH,
Mythran
Back to top
View user's profile Send private message
Robert Hooker



Joined: 08 Aug 2007
Posts: 6

PostPosted: Wed Oct 11, 2006 3:38 pm    Post subject: Re: ODBC / Vista / Foxpro Reply with quote

Small correction:

It actually fails here:
dbConnection.Open();


"Robert Hooker" wrote in message @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
>
>
>
Back to top
View user's profile Send private message
Cindy Winegarden



Joined: 08 Aug 2007
Posts: 2

PostPosted: Wed Oct 11, 2006 8:53 pm    Post subject: Re: ODBC / Vista / Foxpro Reply with quote

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
cindy@cindywinegarden.com


"Mythran" wrote in message @TK2MSFTNGP03.phx.gbl...
>
> "Robert Hooker" wrote in message
> @TK2MSFTNGP05.phx.gbl...

> You could try:
>
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=;Extended
> Properties=dBASE IV;User ID=Admin;Password="
>
> as the connection string and use OleDb instead of ODBC.
Back to top
View user's profile Send private message
Cindy Winegarden



Joined: 08 Aug 2007
Posts: 2

PostPosted: Wed Oct 11, 2006 9:07 pm    Post subject: Re: ODBC / Vista / Foxpro Reply with quote

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
cindy@cindywinegarden.com


"Robert Hooker" wrote in message @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)?
Back to top
View user's profile Send private message
Kevin Yu [MSFT]



Joined: 08 Aug 2007
Posts: 45

PostPosted: Thu Oct 12, 2006 6:53 am    Post subject: RE: ODBC / Vista / Foxpro Reply with quote

Hi Robert,

Since the connection cannot be opened, the most probability is there might
be something wrong with the FoxPro driver for ODBC.

Currently Windows Vista is in beta versions, the development on this
platform is not supported. You can try to post this in the Windows Vista
development forum.

http://forums.microsoft.com/MSDN/default.aspx?forumgroupid=24&siteid=1

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Back to top
View user's profile Send private message
mayank mishra



Joined: 08 Aug 2007
Posts: 1

PostPosted: Thu Nov 09, 2006 10:59 am    Post subject: Re: ODBC / Vista / Foxpro Reply with quote

hi
hello i am creating asp.net with c# app in which we retive data from or
select data from foxpro2.6 dbf and update the data using ms access query
in c# but update not work error generate like "operation updation use"
sir please help me

using System.Data.Odbc;


string str1="abc";
string str=@"Driver={Microsoft dBASE
Driver(*.dbf)};DriverID=277;Dbq=e:\medicell\comp0009;";
OdbcConnection con=newOdbcConnection(str);
con.Open();
OdbcCommand cmd=new OdbcCommand("update acbal set name2=@name2",con);

cmd.Parameters.Add("@name2",str1);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
Response.Write("Update");

*** Sent via Developersdex http://www.developersdex.com ***
Back to top
View user's profile Send private message
Cindy Winegarden



Joined: 08 Aug 2007
Posts: 3

PostPosted: Thu Nov 09, 2006 7:28 pm    Post subject: Re: ODBC / Vista / Foxpro Reply with quote

Hi Mayank,

Download and install the FoxPro and Visual FoxPro OLE DB data provider from
msdn.microsoft.com/vfoxpro/downloads/updates. It's backward compatible to
all versions of FoxPro DBFs.

The following code worked for me:

OleDbParameter parm1 = new OleDbParameter("parm1", OleDbType.Char);
parm1.Value = "abc";

string str = @"Provider=VFPOLEDB.1;Data Source=C:\Temp;";
OleDbConnection con = new OleDbConnection(str);
con.Open();

OleDbCommand cmd = new OleDbCommand("update acbal set name2=?", con);

cmd.Parameters.Add(parm1);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();

--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
cindy@cindywinegarden.com


"mayank mishra" wrote in message @TK2MSFTNGP04.phx.gbl...
>
> hi
> hello i am creating asp.net with c# app in which we retive data from or
> select data from foxpro2.6 dbf and update the data using ms access query
> in c# but update not work error generate like "operation updation use"
> sir please help me
>
> using System.Data.Odbc;
>
>
> string str1="abc";
> string str=@"Driver={Microsoft dBASE
> Driver(*.dbf)};DriverID=277;Dbq=e:\medicell\comp0009;";
> OdbcConnection con=newOdbcConnection(str);
> con.Open();
> OdbcCommand cmd=new OdbcCommand("update acbal set name2=@name2",con);
>
> cmd.Parameters.Add("@name2",str1);
> cmd.ExecuteNonQuery();
> cmd.Dispose();
> con.Close();

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
FoxPro OleDb (and ODBC) Problem on Windows 2003 I cannot use neither UPDATE nor INSERT commands in ASP.NET (on Windows 2003 !!!!) application which use FoxPro database. When I try update table, then I get error: "Cannot update the cursor. Table since it is read- only" But it isn't true. Win32 a

Reading FoxPro Date field frpm ODBC Ok, what is the trick!!! I am using C# to read a FoxPro DBF file. I do the following: Private DataSet dbfFile) { DataSet ds = new DataSet(); string Sql; int dbfNameStart = string dbfTableName =

VFPODBC.DLL: "ERROR [S1000] [Microsoft][ODBC Visual FoxPro D Hi. I'm using VB.net to access some FoxPro free data table. There are aabout 10 DBF files which I can make connection and using select command and fill into a Data Adaptor with no problem. But there is 'one' particulatar DBF file keep having problem. The

Problem in connecting to FoxPro DB (Type your message here) Hi- I am trying to connect to a FoxPro db. My application is built as a C# user control in .NET. The DB is a free table directory. I created a DSN (Microsoft Visual Foxpro Driver type) on the server and linked to the folder. It cr

FoxPro database via ole db in Reporting Services Hi, I'm accessing a FoxPro database via ole db and ths works fine on my local report server. However, when I deploy the report to the live report server I'm getting the error 'Invalid path or file name' The FoxPro database is on a separate server and the
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ODBC Dotnet All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group