Results 1 to 17 of 17

Thread: I need to create and maintain a new DB in VB.net [pretty much resolved]

  1. #1

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    I need to create and maintain a new DB in VB.net [pretty much resolved]

    I would like to write my own version of Quicken, and I think I need a DB to store everything(I could put in all in files, but I think it would be slow.) In the DB, for to start, I will have accounts, spending categories (who or what money the money gets spend on) and payees. Each member of the Accounts field (a particular account) will have information like name, address, phone, etc. Also each account will need and account register that holds daily transaction in the account. I don't know who to set this up in VB.net. How do I set up the DB, and what tools/code statement are available in VB.net? Does any one have a sample project regarding DB's? Not necessarily a quicken type DB, just something that might have the same type of structure.
    thanks a bunch
    kevin
    Last edited by kebo; Jan 19th, 2005 at 12:12 PM.
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  2. #2
    Lively Member
    Join Date
    Oct 2004
    Posts
    66

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    I have made an application that might be intresting for you. i wrote it for a cycling club, and it is used for maintaining a member database.

    i used an ms access database, to store the data

    data that will be stored are:

    First and lastname, adress, date of birth, some numbers, and how many kilometers each member has.

    i can send it to you if you like.

  3. #3

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    please do send it.
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  4. #4
    Junior Member
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    30

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    I think this link might contain some useful stuff on working with datasets and Access:

    http://www.programmersheaven.com/zon...1000/23332.htm

    If you're also interested in a text reference, I found Day 12 in Sams 'Teach Yourself Visual Basic.NET in 21 Days' (Mackenzie and Sharkey) a good start.

  5. #5

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    thanks, I'll check it out
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  6. #6

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    that is exactly what I was looking for. thanks
    VB Code:
    1. Dim strConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & g_strAppPath & "\PhoneBook.mdb"
    2. Dim objConn As New System.Data.OleDb.OleDbConnection( strConnectionString )
    3. Dim cb As System.Data.OleDb.OleDbCommandBuilder    
    4.        
    5. ' Connect to provider (connectionstring above)
    6. objConn.Open()
    In this code, if Phonebook.mdb doesn't exist in the right place the code errors. Is there a way that I can create an mdb file from VB code? If the mdb file ever gets delete, the code breaks.
    thanks
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  7. #7
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    It took some digging but i found an old post that may help you.

    Create Database Programmatically

  8. #8

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    ok...Im getting close (but I kinda feel like a tard), but
    VB Code:
    1. Dim ADOXcatalog As New ADOX.Catalog
    2. Dim ADOXtable As New ADOX.Table
    3. Dim SecondTable As New ADOX.Table
    4. Dim ADOXindex As New ADOX.Index
    give me errors that ADOX is not defined. Do I need to add a control to the form...I'm so lost but so close to learning
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  9. #9
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    Sorry gave you the wrong link. You need to reference Microsoft ADO Ext. 2.7 for DDL and Security to access ADOX.

    The right link.

    Microsoft

  10. #10

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    I'm finally moving forward thanks. Now I need to know how to open it after its been created (still feeling like a tard )
    VB Code:
    1. Dim ADOXcatalog As New ADOX.Catalog
    2.         Dim ADOXtable As New ADOX.Table
    3.         Dim SecondTable As New ADOX.Table
    4.         Dim ADOXindex As New ADOX.Index
    5.         Dim appPath As String = Application.StartupPath
    6.         Try
    7.             ADOXcatalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & appPath & "\test.mdb")
    8.         Catch ex As Exception
    9.             If ex.Message = "Database already exists." Then
    10.                 'I need code to open the DB
    11.                 '
    12.                 '
    13.             Else
    14.                 MessageBox.Show(ex.Message)
    15.             End If
    16.         End Try
    I know I its ADOXcatalog.something, but I can't figure it out nor find it
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  11. #11
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    To open it just use the normal code to open a database file. Below is a sample. I am still very new to programming in general but this should help you.

    If you have any other questions feel free to ask.

    [Code]

    Imports System.Data.OleDb

    Dim dconn As OleDbConnection = New OleDbConnection _(provider=Microsoft.Jet.OLEDB.4.0;Data Source = nameOfDatabase.mdb)

    ' Open the database
    dconn.Open

    ' Close the database
    dconn.Close

  12. #12

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    so what's the difference then between using ADOX and OleDB? I can't find hardly any documentation about ADOX in either of my .net books
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  13. #13
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    To tell you the truth all i know is that ADOX was used in vb6. I just searched the forums for creating a new access database and found this post . Your question peaked my interest because right know I am thinking about doing the same thing in a program that I am writing.

    Will

  14. #14

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)

    thanks gunslngr, its been a big help.
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  15. #15
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Re: I need to create and maintain a new DB in VB.net [pretty much resolved]

    No problem at all. You helped me think of something that I should add to my project. And hopefully I did not send you someplace you did not need to go.

    Will

  16. #16
    Junior Member
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    30

    Re: I need to create and maintain a new DB in VB.net [pretty much resolved]

    kebo

    Just caught up with the thread. Thought I'd mention that the easiest way to create a .mdb file structured as you want is in Access itself.

    Once created, put it in the application's 'Bin' folder to link in with the application's AppPath.

  17. #17
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Re: I need to create and maintain a new DB in VB.net [pretty much resolved]

    NetNovice i am pretty sure that Kebo wanted to make if somebody decided to delete or rename the database his program does not break. Instead it creates a new database and adds the necessary tables and columns.

    Will

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