Results 1 to 12 of 12

Thread: Create a database...How to get started?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Create a database...How to get started?

    Hello,

    I am a bit of a newbie and am looking for the basics of how to get started creating a database. I just would like to hear from the experts and experience folks on their opinions and experiences. What works best? What is the initial things to do? In other words, just plain ole good advice.

    The project I am thinking of doing involves pretty much the usual....Entering data in and querying.

    Thanks!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    How do you want to create the new database by code or just using UI in Access ?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    VB

    I want to create it using code in VB.NET.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Apparently , there is no pure .NET code that can create new MS Access database from scratch . Here is a way that can be possible to do in VB.NET .It's interop. though , it's working fine . http://www.vbforums.com/showthread.p...e+new+database

  5. #5
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    you can create it without a reference , going along the lines of what Pirate created, but using Objects....
    VB Code:
    1. [COLOR=BLUE]Dim[/COLOR] obCat [COLOR=BLUE]As Object[/COLOR] = [color=blue]CreateObject[/color]("ADOX.Catalog")
    2.         [COLOR=BLUE]Dim[/COLOR] objTab [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]Object[/COLOR] = [COLOR=BLUE]CreateObject[/color]("ADOX.Table")
    3.         [COLOR=BLUE]Dim[/COLOR] objInd [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]Object[/COLOR] = [COLOR=BLUE]CreateObject[/color]("ADOX.Index")
    4.         [COLOR=BLUE]Try
    5. [/COLOR]            obCat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:\My.mdb")
    6.             obCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\My.mdb"
    7.             [COLOR=BLUE]With[/COLOR] objTab
    8.                 .Name = "Table1"
    9.                 .Columns.Append("NAME", ADOX.DataTypeEnum.adVarWChar, 40)
    10.                 .Columns.Append("ADDRESS", ADOX.DataTypeEnum.adVarWChar, 20)
    11.                 .Columns.Append("ID", ADOX.DataTypeEnum.adInteger)
    12.                 obCat.Tables.Append(objTab)
    13.                 .Indexes.Append(objInd)
    14.             [COLOR=BLUE]End[/COLOR] [COLOR=BLUE]With
    15. [/COLOR]        [COLOR=BLUE]Catch[/COLOR] ex [COLOR=BLUE]As[/COLOR] Exception
    16.             MessageBox.Show(ex.Message)
    17.         [COLOR=BLUE]End[/COLOR] [COLOR=BLUE]Try[/COLOR]
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    The initial variables in my thread are objects as well .

  7. #7
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    i only saw this....
    'a reference to ADOX (Microsoft ADO Ext. 2.x for DDL and Security)
    Dim ADOXcatalog As New ADOX.Catalog
    Dim ADOXtable As New ADOX.Table
    Dim ADOXindex As New ADOX.Index
    seems to be needing a reference to the ADOX library that way, just showing a way to do it without a reference ( ie: through vb code ) like this...
    Dim obCat As Object = CreateObject("ADOX.Catalog")
    Dim objTab As Object = CreateObject("ADOX.Table")
    Dim objInd As Object = CreateObject("ADOX.Index")
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    CreateObject is just like New method . And actually you are referring (early-binding) the variables ADOX.blah to the newly created obj .

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Access

    Thanks......

    So.......is it common place to use Microsoft Access as the database? Just for the sake of discussion, are there other ways other than Access?

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Access is common because it's easier , common , easy when distributing your app ...etc . Yes , there are other Databases you can use . One of them is SQL Server database 2000 , Oracle , MySQL , FoxPro ..etc . If you want how to create new SQL Database from scratch , I can give you the link .

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Great!

    Yes please, I would like to explore all the options.

    Thanks!

  12. #12

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