Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a VFP .dbf file
Message
 
À
10/06/2005 18:31:02
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 1.1
Database:
MS SQL Server
Divers
Thread ID:
01022348
Message ID:
01022540
Vues:
11
CREATE TABLE is a legal command for the OleDb driver, so you can easily create DBF file, then reopen it and INSERT data.

There may be issues though depending on how you have set up connection. I *think* if you're using a Directory 'database' you should just be able to go. Otherwise a DBC must exist before you can create anything.

+++ Rick ---

>I am writing a method that needs to save a DataTable in .dbf format so that it can be imported by a program on another system. Each .dbf file will be read without being modified. The file is for a is a regularly occurring, one-way data export.
>
>I was hoping that I could just use System.IO.File.Create to create a file with a .dbf extension, instantiate an OleDbConnection to open it, and then use SQL commands to CREATE TABLE, INSERT all my DataRows into it, then simply close the OleDbConnection and the .dbf file would be usable.
>
>If the OleDb driver can't create a properly formatted .dbf file from an empty file, since the table in each file will always have the same schema, could I create an empty template .dbf file that contained an empty copy of my table, make a copy of it with File.Copy every time I needed to make a new file, and then populate my copy?
>
>Can it be that easy? I can't find any sample code that does more than read from .dbf files. The examples that I have seen use a couple different values/syntax for the Provider attribute in their connection string, which is confusing.
>
>If anyone has some sample code that they could provide me with, I would appreciate it.
>
>What is the correct provider name to use?
>
>If I am missing a necessary step (or basic understanding), any insight would be useful.
>
>Thanks.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform