Code sample for MS Access 2003?
Code sample for MS Access 2003?
I am currently evaluating UniDirect.NET with VS2005. My application is supposed to work with MS Access, SQLServer and Oracle. I am new to UniDirect and I can't find any sample for connecting to an Access 2003 database through OleDb. Has anyone done this before? Could you please post a code sample please?
Code sample for MS Access 2003?
Alexey, thank you for your quick reply. I think I misunderstood the statement on the product page saying "The provider for MS Access enables data access to Microsoft Access data sources through OLE DB.". Nevertheless, do you happen to have some lines of code showing how to connect to an MS Access database through UniDirect?
To be honest, UniDirect .NET uses standard ADO.NET OLE DB provider to connect to MS Access. The connection string looks as follows:
Code: Select all
provider=MS Access;Data Source=D:\Program Files\Common Files\Borland Shared\Data\dbdemos.mdb;
Could you also post an example of using the Access connection to, say, enter some data to a table?Alexey wrote:To be honest, UniDirect .NET uses standard ADO.NET OLE DB provider to connect to MS Access. The connection string looks as follows:Code: Select all
provider=MS Access;Data Source=D:\Program Files\Common Files\Borland Shared\Data\dbdemos.mdb;
Thanks!
Here is a sample:
Code: Select all
UniConnection connection = new UniConnection(@"provider=MS Access;Data Source=D:\Program Files\Common Files\Borland Shared\Data\dbdemos.mdb;");
UniCommand cmd = new UniCommand("insert into table(a,b) values (1,1);", connection);
try {
connection.Open();
cmd.ExecuteNonQuery();
}
finally {
connection.Close();
}
dotConnect Universal 3.0.1 Beta is available for download now.
It can be downloaded from http://www.devart.com/dotconnect/unidir ... nload.html .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=15900 .
It can be downloaded from http://www.devart.com/dotconnect/unidir ... nload.html .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=15900 .