Tuesday, January 28, 2020

ManagedDbf Server


Anyone who can access or has given the right from a shared folder across the local area network environment can delete or replace a file, Dbf files residing  on file servers can face this dilemma, but what if we can access the Dbf  file using IP address and port No. as a replacement to pipe shared directory name... yes, the life of Dbf file  format can be extended more with secured access.

Early test on my Managed Dbf Server of course I'm using my Managed Network Library which I already use on my Multi-player Pac-Man  : )


string m_ConnectionErrorString = "";


//--> Connection string creation
//

MDbf.DbfConnectionString m_DbfConnectionString = new MDbf.DbfConnectionString"10.0.1.1", "2006", "admin", "password", "","","" );


//--> Opening Customer.dbf using connection string
//

MDbf.Table _CUSTOMER_tbl = new MDbf.Tablem_DbfConnectionString "CUSTOMER.DBF", out m_ConnectionErrorString );
//
if ( m_ConnectionErrorString != "" )
{
   MessageBox.Show("Unable to open CUSTOMER table on Managed Dbf Server! \r\n "+m_ConnectionErrorString);
   MDbf.CloseAll();
   return;
}


//--> Opening Salesman.dbf using the same connection string
//

MDbf.Table _SALESMAN_tbl = new MDbf.Table( m_DbfConnectionString, "SALESMAN.DBF", out m_ConnectionErrorString );
//
if ( m_OutConnectionErrorString != "" )
{  
   MessageBox.Show( "Unable to open SALESMAN table on Managed Dbf Server! \r\n "+m_ConnectionErrorString );
   MDbf.CloseAll();
   return;
}

// Wala' you now can use the tables just like you opened it locally.


No comments:

Post a Comment