Hi!
Currently we are using the following method to copy (or link in this case) a
DBF table into an Access database. I'm running into very odd problems with
using ADO within .NET and was hoping i could eliminate the need for
referencing the ADO libraries by rewriting the code in ADO.NET.
Here is a snippet of the original code:
connMDB = new ADODB.ConnectionClass();
connMDB.Open( @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
MDBPathAndFileName_ + ";User ID=Admin;Password=", null, null, 0 );
ADOX.Catalog cat = new ADOX.CatalogClass();
cat.ActiveConnection = connMDB;
//Create the new table.
ADOX.Table tbl = new ADOX.TableClass();
tbl.Name = NewTableName_;
tbl.ParentCatalog = cat;
//Set the properties to create the link.
tbl.Properties[ "Jet OLEDB:Create Link" ].Value = true;
tbl.Properties[ "Jet OLEDB:Link Datasource" ].Value = DBFPath_;
tbl.Properties[ "Jet OLEDB:Link Provider String" ].Value = "Dbase IV";
tbl.Properties[ "Jet OLEDB:Remote Table Name" ].Value = DBFName_;
//Append the table to the tables collection of the catalog.
cat.Tables.Append( tbl );
----------
Does anyone know of an ADO.NET equivalent?
Thanks in advance,
Charles
|