|
-
Jan 27th, 2013, 03:01 PM
#1
Thread Starter
Member
Database Questions
As I'm new to VB, I've been trying to come up with some project programs to build - in an attempt to better learn the language and software.
With that said, I have an idea for a program that I would like to try making - a database to store various records.
To start, I just want these records to be text - in the future I may want to explore adding other forms of media to the records.
So, I'm not exactly sure how to go about creating a program that asks for user input, and stores it into files.
And also have the ability to search these files based on the information (search names, phone numbers, invoice numbers, etc).
I assume this would be done w/ XML files?
So, how would I go about creating these files after a user inputs the requested information?
Can I setup the program to create a directory for these files - say a folder in "My Documents" that would store all of this information?
Once I get that stuff figured out - I would like to add some security features to the program - to help protect the files.
Is it possible to force the user to login via username/password before entering the program?
How would I go about setting that up for multiple users?
If I wanted to protect the files in the "My Documents" folder - is there a way that I could encrypt them upon export, and decrypt them upon viewing in the program?
Or create some sort of proprietary file type that no one could open up unless they had this software?
Sorry for the noob questions - really just trying to learn as much about VB as possible - this program is awesome.
I understand that some of my questions maybe span beyond the scope of a simple database, and are most likely very advanced.
Any information you could lend on this would be very helpful!
I'm not asking for someone to write the program for me - maybe just some tips on how to go about doing it, or a link to a tutorial that talks about some of these principles.
Thank you for your time!
-
Jan 27th, 2013, 03:21 PM
#2
Re: Database Questions
Sounds like you should be exploring using databases rather than xml.
SQL Server is a very good choice and makes much of what you would like to do fairly easy plus there are tons of examples all over the internet for doing so.
-
Jan 27th, 2013, 04:07 PM
#3
Thread Starter
Member
Re: Database Questions
thanks for your input, however I would prefer to keep this program on a local machine at this time. Im sure something like this can be done in vb. Anyone have some ideas?
-
Jan 27th, 2013, 04:25 PM
#4
Re: Database Questions
With VB.Net you can create a local database from scratch in Access format without any need to have Access installed. That would appear to be the most obvious next step. XML is a good transporter of relatively static information but it is not a good choice for interactive functions such as searches, filtering etc.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jan 27th, 2013, 05:18 PM
#5
Re: Database Questions
Also note that you can run SQL server on the same machine without an issue
-
Jan 28th, 2013, 10:39 AM
#6
Re: Database Questions
SQL Server Express can run on whatever machine you want it to. There is also SQL Server CE. Access is a common option, as well, as it is so common. In general, a real database is going to solve most of the problems you have more effectively than an XML/file solution can. For one thing, all database engines have some serious search capability using SQL, which will get you better performance than rooting around in XML files. Furthermore, even Access has some security built in, whereas all the things you talked about for XML will have to be written by you.
You can certainly encrypt/decrypt XML files, and you will HAVE to if you want to provide even minimal security, as XML files are otherwise plain text that can be opened, read, and edited with any text editor such as NotePad, WordPad, Word, or anything else of the sort. The files can still be flat out deleted, though, so even that security is a bit off. Of course, if you were to use Access, you would have either an mdb or an accdb file, which could also be delted. The advantage with Access would be that if you lost the file, you'd know about it. Knowing that a file had been deleted from an XML/file store would be more difficult, since you'd have to keep track of which files you had by some means, and where would that information reside?
Still, if you are plinking around with trying things out, XML isn't a bad place to start. The easiest way to go about what you are describing would be to create a datatable in code. Datatables have WriteXML and ReadXML methods that make it very easy to store/load them from XML files. So, the place to start would probably be with creating a datatable in code, which means making a new datatable and adding columns to it.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|