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
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.
Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)
:thumb: please do send it.
kevin :wave:
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.
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
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. :thumb: thanks
VB Code:
Dim strConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & g_strAppPath & "\PhoneBook.mdb"
Dim objConn As New System.Data.OleDb.OleDbConnection( strConnectionString )
Dim cb As System.Data.OleDb.OleDbCommandBuilder
' Connect to provider (connectionstring above)
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
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
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:
Dim ADOXcatalog As New ADOX.Catalog
Dim ADOXtable As New ADOX.Table
Dim SecondTable As New ADOX.Table
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 :afrog:
kevin
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
Re: I need to create and maintain a new DB in VB.net (also posted in the DB forum)
:cool: I'm finally moving forward thanks. Now I need to know how to open it after its been created (still feeling like a tard :blush: )
VB Code:
Dim ADOXcatalog As New ADOX.Catalog
Dim ADOXtable As New ADOX.Table
Dim SecondTable As New ADOX.Table
Dim ADOXindex As New ADOX.Index
Dim appPath As String = Application.StartupPath
Try
ADOXcatalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & appPath & "\test.mdb")
Catch ex As Exception
If ex.Message = "Database already exists." Then
'I need code to open the DB
'
'
Else
MessageBox.Show(ex.Message)
End If
End Try
I know I its ADOXcatalog.something, but I can't figure it out nor find it
:confused:
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
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
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
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
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
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.
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