Create mdb file in VB 2005

Hello,

How can i create an Access database (.mdb file) in a VB 2005 project Is this possible

Christos



Answer this question

Create mdb file in VB 2005

  • Everett Buel

    Hi there,

    Here is a best link that could help your problem.

    http://www.dotnet247.com/247reference/msgs/11/59426.aspx

    hth,

    Michael Castillones



  • EDilks

    Hi All,

    I want to do similar thing. Here are the links for C#
    http://support.microsoft.com/default.aspx/kb/317881
    http://www.codeproject.com/books/186100558x_16.asp

    But along with tables, I want to add forms, Macros, reports also. Can I do that If yes, how

    Regards,
    Abhay


  • HKS

    Hi,

    The link shows c#.net code. Here is a VB code I translated.

    Imports System
    Imports ADOX
    Namespace ConsoleApplication1

    Class Class1

    <STAThread()> _
    Shared Sub Main(ByVal args As String())
    Dim cat As ADOX.CatalogClass = 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 = Nothing
    End Sub
    End Class
    End Namespace

    Hth,

    Michael Castillones



  • Bok Geen


    This would require automation with the Microsoft Access object model. It cannot be done through data access methods.

  • Create mdb file in VB 2005