1) Stolen from Google:
1. Open a new Visual C# .NET console application.
2. In the Solution Explorer window, right-click the References node and
select
Add Reference.
3. In the Add Reference dialog box, click the COM tab and select
Microsoft ADO
Ext. 2.7 for DDL and Security. Click Select to add it to the "Selected
Components". Click OK.
4. Delete all of the code from the code window for Class1.cs.
5. Copy the following code and paste it into the code window:
using System;
using ADOX;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
ADOX.CatalogClass cat = new ADOX.CatalogClass();
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=D:\\AccessDB\\NewMDB.mdb;" +
"Jet OLEDB:Engine Type=5");
Console.WriteLine("Database Created Successfully");
cat = null;
}
}
}
6. Change the path to the new .mdb file as appropriate. Press F5 to
build and
run the project.
The new .mdb file will be created in Access 2000 (Jet 4.0) format. For
a
different Jet format, see "References."
2) ADOX is Microsoft ADO Ext. 2.x for DDL and Security. You add a
reference in the COM section (It's a COM library)
3) You'll have to know SQL to use the API's, look at the look up
System.Data.OleDb.OleDbConnection for a starting point.
4) System.Data.OleDb.OleDb.OleDbCommand, OleDbDataReader and all the
other objects in that space.
5) Yep, all everything in System.Data.OleDb
6) Check CodeProject.com they have excellent tutorials.
Er********@gmail.com wrote:
Hi all,
I need to write app which using MDB files.
Can any one help me with that?
1. Can C# create MDB File(with or without ADOX)? or do i have to create
it manually?
2. How do i set ADOX?
3. Do I have to use SQL or i can use APIs?
4. Can I read/write to this file?
5. is there a C# class that handles MDB file?
6. is there any good tutorial for that?
this file is not shared and has only one table with about 8 coloumns.
thanks for the help,