CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1

    Set cat = CreateObject("ADOX.Catalog") in C# ??

    What do I do to convert this VB-code to C# ?

    Example 1:

    Dim cat As New ADOX.Catalog



    Example 2:

    Set cat = CreateObject("ADOX.Catalog")
    cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb"

    Set tbl = CreateObject("ADOX.Table")
    tbl.Name = "tBeispielTabelle"
    cat.Tables.Append tbl



    Regards
    Johan

  2. #2
    Join Date
    Jul 2002
    Location
    .NET 2.0/.NET 3.0/.NET 3.5 VS2005/VS2008
    Posts
    284
    this is probably the code you need:
    Code:
    ADOX.Catalog cat = new ADOX.Catalog();
    Example 2:
    Code:
    cat = new ADOX.Catalog();
    
    cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.mdb";
    
    ADOX.Table tbl = new ADOX.Table();
    
    tbl.Name = "ExampleTable";
    cat.Tables.Append(tbl);
    WM.

    What about weapons of mass construction?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured