Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 16th, 2008, 02:34 PM
Registered User
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginner seeks advice - Address Book

Hi all

I'm learning VB.net express 2008.

I have murachs 2008 book, which reviews said is good for beginners but tbh I find it struggling.
I think the 2008 step by step book is better for beginners.
Anyway, I've read through loops, varibles, data types and msg box etc etc a few times.
Some still confuses me.... like all the data types and Conversion commands etc etc.
Should I understand all from a first/second read?
Seem to struggle with some bits.

Anyway to my main questioin-

My goal is to make a program that contains a staffs details like address, NI number, annual leave entitlement, annual leave left etc.

I not got a clue where to start, I've tried by adding buttons and textbox controls that can add a employee etc but it never saves it or anything or I can't call it up to be used.

Where do i start?
I have a rough idea for some things like leave entitlement I can use if or select case.
But example if i want a ADD button, once you click add you can add new entries for each fieild which is then saved.
And then search for these which lists all the info.

Where do i start, its alright reading about the code for loops, varibles, data types but hard to actually do something with it.

Any help is great!

Old June 16th, 2008, 03:37 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

When learning the ins and outs of variables, it can be helpful to keep in mind how the memory is being used. Every variable type handles memory differently, and so cannot be directly copied between differing types. To copy an integer into the memory that is defined as a Single requires modifying the actual way in which that number is stored. That means that a conversion is required, and it will either be explicit or implicit. If Option Strinct is On, it will have to be explicit. Thinking (as best a human can) as a computer helps.

You are biting off a big piece to chew... (Make careful, deliberative steps.)

Start away from a computer, designing what will become your project.

Design the database, and the relationships between the tables.

Then design a story board for how you will accomplish the work that the project is going to do.

Having the basic outline, you will better be able to fill in the means of implementing the idea, an idea which will at that point be much clearer in your head. (Even that clarity will be helpful.) Plus, you will have the reduced stress of only having to solve a small section of the overall design at any given time.

If you couch your story board and narrative in strict, terse, logical form, you can sometimes just past your narrative into the code window, with only a few modifications. For instance, if you write, “If just 1 person is found in the NAMES table, then present frmEdit. If more than one are found, display frmHUH. Otherwise display frmNOT_FOUND,” then you can enter into the code window (using a little pseudo-code here for clarity):
    Dim rsName As Recordset = "SELECT COUNT(*) " & _
                              "FROM   NAMES " & _
                              "WHERE  LNAME = '" & txtName & "'"

    If rsName.Recordcount = 1 Then
    ElseIf rsName.Recordcount > 1 Then
    End If

    ' Or

    Select Case rsName.RecordCount()
        Case 1
        Case Is > 1
        Case Else
    End Select
Old June 16th, 2008, 04:14 PM
Registered User
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I'm a little lost on what you said...................

But I got a good idea of wht I like to do.

You state to make the database first..

Is this like a database I make with details in EXCELl and then it's loaded from VB?

Not too sure on that..

I'm a beginner remember.

Does it take time to remeber all these basic things like varibles, conversions, data types, if, elseif, select case?

The way the books talk it's as if once I read it and code a bit i should be the bees knees at it and be making some programs.

But im still lost what to do with alot of it and forgot alot.

Does a average person take awhile to get used to all them basics or am I struggling here?

Old June 18th, 2008, 10:14 AM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

Actually, I didn't say make the database, I said design the database.

Excel is not a database program; it is a very poor choice if you have anything better. MS Access is a database program. SQL Server is a database program; so is Oracle. A database program allows you to create related tables. An example of this might be one table with persons’ names (one record per person), and a related table which has educational degrees held. The Degrees table can have any number of entries per person, including zero entries for a given person. Once these tables are properly related to each other, you will not be able to enter a record in the Degrees table without it having a person in the Names table to which it is related. Additionally, if you delte a name from the Names table, all of the records related to that person in the Degrees table will be deleted automatically.

You relate these table through a colum in the names table that is unique, and does not contain a datum associated with that person. You would use a uniquely generated number, not the age, address, Social-Security number, or any other datum that pertains to that person. That way, even if every piece of information was entered wrong (misspelled, wrong date, whatever), you can correct all ot the data without changing the number that identified the row, and therefore which identifies all of the “child” records that belong to this “name.” In designing the database, you restrict this field to “No duplicates.”
Then, in the Degrees table you ad a filed that id called a “foreign key.” This is the same type of data as the unique ID in the Names table (say a long integer), but is not specified as “No duplicates.” When you want to add a degree that a person holds, you enter the unique ID from the Names table in this column, and then fill in the degree name, school, date awarded, etc.

Of course, the database that you design will dictate the code you write to work with it.

It takes awhile. It really does help to try to visualize what the book is saying as it describes the available variable types. Thinking as best you can like a computer will facilitate “putting the pieces together.” It is a different form of undertaking than other fields...

What book is it that you are reading (the title)? I have a couple of Murach’s books, and as I remember he is very sequential in his presentations, teaching the building blocks in the order that you need them so as to learn the next logical step. But because of that, skipping ahead is a bad plan when you are unfamiliar with the basics.

I could pick up a book of his, and turn to the chapter of the topic I’m after, because I already know the basics. But if you don’t, you really need to be systematic about absorbing the book, and work all the examples.

Most books talk “as if once [you] read it and code a bit [you] should be the bees knees” at the topic—math books, programming books, car repair books, economics books, knitting books, etc. They present the facts, and it is up to the student to keep at the current topic until they have it well enough to use it to build on for the next topic.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner to the book with problem Happy Tommy BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 July 9th, 2007 01:09 AM
Newbie... outdated book.. advice apprciated! mysticpain Beginning PHP 1 September 2nd, 2006 10:06 AM
Any good book for beginner to learning asp.net kalunalan ASP.NET 1.0 and 1.1 Basics 6 July 24th, 2006 10:50 PM
Address Book Program jongree VB Databases Basics 0 June 12th, 2003 09:36 AM
Address Book Program jongree Beginning VB 6 0 June 11th, 2003 05:28 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.