Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread DBISAM with D2006?
Wed, Sep 13 2006 2:25 AMPermanent Link

"Ian Branch"
Hi Guys,

   What's the best way to access a DBISAM database/table in D200 Delphi.Net?
Delphi.w32 is OK but in .net I'm lost.  It shouldn't be this hard...  It's just
as difficult in VS2005 too.

Regards & TIA,

Ian
   

--
Wed, Sep 13 2006 3:28 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi Ian,

You can either use the ODBC driver or the http://www.contextsoft.com/
driver (Client/Server only).

ElevateDB will have its own ADO driver so you can use that when it is
released.

Something like this in C# for the ODBC Driver:
(Note this is untested)

OdbcConnection MyConnection = new OdbcConnection();
OdbcCommand MyCommand = new OdbcCommand("", MyConnection);
OdbcDataAdapter MyDA = new OdbcDataAdapter(MyCommand);
DataSet MyDS = new DataSet();

try
{
 MyConnection.ConnectionString =
  "DRIVER={DBISAM 4 ODBC DRIVER};CatalogName="C:\\Data;";

  MyConnection.Open();

  try
  {
    MyCommand.CommandText = "SELECT * FROM MyTableName";

    MyDS.Clear();
    MyDA.Fill(MyDS, "MyTableName");
    DataTable MyTable = MyDS.Tables["MyTableName"];
    foreach (DataRow row in MyTable.Rows)
    {
   // Process data here ....      
    }
  }
  catch (OdbcException)
  {
   // Catch errors here
  }
}
catch (OdbcException e)
{
  // Catch connection errors here
}
finally
{
  Disconnect(MyConnection);
}

Hope this helps

If you would like me to post a small example in VS2005 (in C#) just let
me know.

Chris Holland


Ian Branch wrote:
> Hi Guys,
>
> What's the best way to access a DBISAM database/table in D200
> Delphi.Net? Delphi.w32 is OK but in .net I'm lost.  It shouldn't be
> this hard...  It's just as difficult in VS2005 too.
>
> Regards & TIA,
>
> Ian
>
Image