Solved

Accessing Visual FoxPro DBF Files using VB.Net

Posted on 2004-03-30
5
866 Views
Last Modified: 2008-02-26
Hi, I'm writing a program in Vb.Net that will edit data in some Visual FoxPro DBF Tables.  I can create the connection without a hitch, however, I cannot generate the update/Add statements for the data table as VB.Net says it cannot identify the primary key for the DBF table.  The FoxPro tables are taken from an outside source and as such I can't open them with any other software to try to manually add primary keys to it.  I can happily view the table structure so I know what the fields are, and I know which field SHOULD be the primary key field for that table, but I just can't get VB.Net to recognise it as such.  Any help or advice you can give me on this would be really helpful, as this is time critical.

Thanks in advance

Liteswitch
0
Comment
Question by:Liteswitch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10723244
I assume that you are using the OleDb provider for Visual FoxPro.  You can manually create your own Update and Insert commands for the OleDbAdapter, but you will have to have some way of uniquely identifying the correct record to update.  Insert commands don't require a primary key, but the way that the wizard tries to generate the SQL it does.

Bob
0
 

Author Comment

by:Liteswitch
ID: 10755557
Thanks for that help so far.  I am trying to use OleDb for the connection yes.  In the FoxPro table, I do know what the primary key is and so I can uniquely identify each row in the table without a problem, but it is just creating the Update and Insert commend that I am having problems with.

How do I manually create these commands, rather than use the wizard?

Cheers,
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 200 total points
ID: 10756647
The OleDbAdapter has Update and Insert command properties in the Properties window.  To access them, expand each command property by clicking on the '+'.  Then you can enter in the Update and Insert SQL statements in the CommandText properties.  You can use the SQL builder by clicking on the <...> button.

Bob
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question