PDA

View Full Version : A question for anyone who knows about Visual Basic (I'm using 6)



ReaperFett
Feb 19th, 2004, 01:31:29 PM
Okay, for my project I have to make a library database system. It has a list of members and books, it has an outstanding loans section and an archive of completed loans.


My basic question is, what would be the best way to make the databse behind the GUI? Would it be best to do it using an internal feature of VB or something else like MS Access or what have you?

TheHolo.Net
Feb 19th, 2004, 01:37:58 PM
An Excel spreadsheet (or CSV file) for the DB data would probably be the easiest and most portable if its just a single table, if you need more than a single DB table then Access is the next best option for your situation.

ReaperFett
Feb 19th, 2004, 01:44:14 PM
More than one, as you have a members table, a book table, a rental table using both and the archive.


Thanks. Now I just have 5 weeks or so to learn and program the damn thing :D

TheHolo.Net
Feb 19th, 2004, 01:49:38 PM
Seperate CSV files or spreadsheet files for each table may also work and be easier than making an Access DB.

Khendon Sevon
Feb 19th, 2004, 02:03:36 PM
I usually just use a bunch of arrays and save to seperate files then load it all into listboxes. Very basic and effective.

ReaperFett
Feb 19th, 2004, 02:39:36 PM
Originally posted by SWFans.Net
Seperate CSV files or spreadsheet files for each table may also work and be easier than making an Access DB.
If I used Excel Spreadsheet files, could I then import pieces of data from others into it? For example, if the MEMBER one had member number, name, address and phone number and the BOOK one had book number, name, author and pages, could I then put into the BOOK LOAN one the member number and name from MEMBER and book number and name from BOOK, as well as new data?




Also, are there any good online tutorials for this?

Lilaena De'Ville
Feb 19th, 2004, 02:42:39 PM
I love excel. :D I have a blast poking around with that program.

If you're using Excel, then put the Member, Book Loan, and Book 'files' on separate pages in the one workbook. You can then use your equations to bring information from one page to another.

For instance I just made a workbook to track employee sales from week to week, month to month (and quarterly). I have 12 pages in my workbook, titled January, Feb, etc etc.

To calculate quarterly sales I have to pull the monthly totals from three pages (January, Feb, and March.)


=SUM(C122+FEB!C122+JANUARY!C122) is what my March quarterly total looks like.

Does that help at all?

edit: Just tried it with a mock up, you can import info like names, etc with Excel as well no problem. it would look like this:


=member!B1 Your 'member' sheet has in B1 the name Anne. Now on the 'book' sheet you can put that equation and it will plug in the contents from 'memberB1' which is Anne.

ReaperFett
Feb 19th, 2004, 02:55:12 PM
In theory that might work, yeah. The only thing is you wouldn't know the excel line from VB.

Lilaena De'Ville
Feb 19th, 2004, 02:56:23 PM
*shrug* just tryin' to help.

TheHolo.Net
Feb 19th, 2004, 02:56:43 PM
I'm not sure how well Excel spreadsheets interact with Visual Basic 6 so seperate worksheets in a single file may not be possible. Flat data files like arrays or csv files may work better.

Lilaena De'Ville
Feb 19th, 2004, 02:57:52 PM
I'm pretty sure there's a way to do it from workbook to workbook - if you have them both open, just click on the cell in the second workbook while you're inputting your equation in the original workbook. It'll fill in the correct info for you. In theory.

TheHolo.Net
Feb 19th, 2004, 02:59:30 PM
Its been 9 years since I had a VB class so I am uncertain how Excel spreadsheets and VB can interact.

I typically just use Access for personal DB stuff and make my own forms through its built in tools. :)

Khendon Sevon
Feb 19th, 2004, 03:27:10 PM
Have you found an excel OCX yet?

I searched the default list and didn't find any (though there are a lot of default database oriented ocx files that can be used).

Googled a little bit and the only OCX I found is designed simply to export to excel, it doesn't actually provide an alternate way to display the information within your application.

Also, the version of the excel OCX I found had a limited 100 time use -- they wanted you to buy it.

Mu Satach
Feb 19th, 2004, 10:25:08 PM
I'd use seperate flat CSV files.
Text files are easy to read and write to...

But if you really wanted to play with the Visual Basic & Excel together, I believe Alt+F11 will open up an editor window where you can start playing with stuff.

Marcus Telcontar
Feb 19th, 2004, 10:38:07 PM
Dunno, reading the original request, I'm thinking Excel might not be the way to go. As mch as I hate saying it, Access would be a simpler solution.


Originally posted by SWFans.Net
Its been 9 years since I had a VB class so I am uncertain how Excel spreadsheets and VB can interact.

I typically just use Access for personal DB stuff and make my own forms through its built in tools. :)

VB + Excel work very well together, even if I'm a dunce at it, Helen has created some pretty interesting things using VB and Excel. But... eh.... I just cant bring my mind around to how Excfel would be easier in this case.

Lilaena De'Ville
Feb 20th, 2004, 12:29:29 AM
I took a class in both, and I can't tell the difference between the two. As far as I could figure Access did a few things that Excel didn't do, but all of the things Excel did as well?