Hi Stephan
We have used the ODBC Driver to write dBase files. I think it was dBase IV or V. You have to try, if it works for you with dBase 3.
Here is an example code, we have used with .NET 2.0:
using System;
using System.Data;
using Microsoft.Data.Odbc;
public class DBaseConnector
{
private IDbConnection m_conn;
public DBaseConnector(string directory)
{
m_conn = OpenConnection(directory);
}
internal IDbConnection OpenConnection(string directoryName)
{
string connectionString = @"Provider=MSDASQL;Driver={Microsoft dBase Driver (*.dbf)};DBQ=" + directoryName;
try
{
OdbcConnection conn = new OdbcConnection(connectionString);
conn.Open();
return conn;
}
catch (Exception)
{
// If you need your Exception handling, it goes here; if not
// forget about the try..catch statements.
throw;
}
}
public int Execute(string sql)
{
using(IDbCommand cmd = m_conn.CreateCommand())
{
cmd.CommandText = sql;
return cmd.ExecuteNonQuery();
}
}
public void Close()
{
m_conn.Close();
}
}
and you call from outside:
....
DBaseConnector connector = new DBaseConnector(m_destinationDir);
try
{
connector.Execute("INSERT INTO MyDbaseTable ...");
...
}
finally
{
connector.Close();
}
Greetings from Switzerland
Thomas