Do While Loop Structure

this is the basic code of Do While Loop Structure in VB6
this structure is similar to Do Loop While Structure

Private Sub Command1_Click()

Dim co As Integer

        co = 1'set co to 1

              Do While co <= 10

                   Print co 'print the value of co
                   co = co + 1'increment by 1

              Loop
   
End Sub

Happy Coding
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Do Loop While Structure

This is the Basic way on how to do the coding of Do Loop While Structure in VB6

this condition will print vertically 1 through 10

Private Sub Command1_Click()
   Dim co As Integer

      co = 1 'set the value of co to 1

            Do

                 Print co 'print the value of co
                 
                          co = co + 1 'co increment by 1

            Loop While co <= 10'exit if <=10
    
End Sub

Happy Coding
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Select Case Structure

this is the basic code of Selection Structure

Dim Adrian as Integer
Adrian=Text1.Text

Select Case Adrian

   Case Val(Adrian) > 100 
        MsgBox"You Enter Greater than 100"
   Case Else
       MsgBox"You Enter less than 100"

End Select

Happy Coding
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

How to Add Data Enviroment in Vb6

This is the Basic way on how to add Data Environment on your Visual Basic 6.0 and adding
some commands for your database data manipulation for data reporting

1.) You must go to Project>More Active X > Data Enviroment
like shown in the image below






















2.) then it will Look like this









3.) to create a connection through your database just simply  right click on a connection then
click Properties



















4.) Then the Data link Properties pop-up for choosing the driver of what database type
you used,on this situation i use Access so i choose   Microsoft.Jet.Oledb Provider like
shown on the image below: then click Next






















5.) at the Select or enter Database Name just click the buttonto browse your database
directory like shown below






















at this case i choose the default database on what visual basic 6.0 have during the
installation process the Biblio and Nwind database select one like i did the press open

6.) after that press Test Connection button like in the image below

    




















it will show you the message  Test connection Succeeded

7.) for adding a Command to view the   Table or the Views or the Stored Procedure 
on your Database  just right click the connection then press Add Command

  
















8.) then the Command you added is shown in Hierarchy view

    









9.) To link the data on your command just follow the step below






















right click the Command>Properties 

10.) then Command Proprieties appear then type the appropriate   fields like i
did in image below






















Command Name:(the name of your command)
Connection:(the Connection name)
Database Object:(Table)

Note: in the Database Object there is a type of object you want to display like,Views,
Stored Procedure,Tables but now i want the Table to link on my Command

Object Name:(this is Tables stored on your database)then click Apply

11.) then it will look like below it shown in Hierarchy view










Hope this will help you a lot!!!
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

How to Connect Database via System DSN using VB6

Hello guys this single line of codes will show to you on how to connect your database via
System DSN connecting your database is very use-full because you can Easily locate your
database and open it through your VB6 without typing a lot of Code>>>

NOTE
Make sure that you Add a Active X data Objects to
build a Database and Record-set Connection

Dim Conn As Adodb.Connection

Private Sub Form_Load()

      Set Conn=New Adodb.Connection
'for example my system dsn name is Adrian
      Conn.Open "Adrian"

End Sub

For Creating System DSN for MS Access just Click the
link Creating System DSN for MS Access
For Creating System DSN for SQL Server just click the
link Creating System DSN for SQL Server
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

How to Create a System DSN of SQL Server

This is a few steps on how to Create a System DSN of SQL Server







Locate your Control Panel then Click Administrative Tools







Then Click Data Source (OBDC)

 

















Click the System DSN Tab then click ADD button



















hen Locate for the SQL Driver named
SQL Server then click Finish

















then Create a New Data Source to SQL Server Dialog will prompt
under Name:(give the name of your connection)
Description:(give the name of your connection)
Server: (browse your active server) then press NEXT

















at this time we will connect on Windows authentication for

Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

How to Create a System DSN of MS Access

This is a few steps on how to create as System DSN of a MS Access Database






Locate your Control Panel then Click Administrative Tools







Then Click Data Source (OBDC)



















Click the System DSN Tab then click ADD button



















then Locate for the MS Access Driver named

Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

How to Format Currency in VB6

This basic and a single line codes will demonstrate to you on how to Format in a Currency
form a General Number type like 123456, it will be done  like this

     Format$("123456","#,##0.00")

So the Output is 123,456.00 it turn into Currency Form

in the Other hand you can Insert a single letter in this format like for example,my Currency
Symbol is P, it look like this

    Format$("123456","P #,##0.00")

So the Output is P 123,456.00

Happy Coding
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

IF Then Else Selection Structure in Vb6

A selection structure is used yo choose among alternative courses of action or instruction.
Like for Example the if the Required Number is greater than 50,so we can coded it like
this:

If NumberOfPeople >50 then
  MsgBox"You Meet the Number of People"
   Else
   MsgBox"Sorry!,You Did Not Meet the Number of People"
End If

the  pseudo-code of this is

If the number of people is greater than 50
    display that you meet the number of people
Else
    display that you did not meet the number of people
End If

Happy Coding
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

How to Use A Boolean Data Types in V6

Hello guys this sample code,i will show to you on how to use a Boolean Data Types on your
own Visual Basic Program

first you must Declare it,whether on a Module for the user can access it or used it all the time,
or in a Control Event like Load,click,Mose-move event etc...

 we can code it like this

Public Adrian As Boolean or 
Dim Adrian As Boolean

Note:
Boolean Data Types can only Holds a
True And False Statement

We can use it via code like shown below:
'i declare it via General declaration
Dim Adrian As Boolean

Private Sub Form_Load()
    Adrian=True
 End Sub

Private Sub Command1_click()
    If Adrian=True then
          MsgBox"Boolean is True"
    End If
End Sub

Happy Coding!!!!
Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Library and Billing System

Hello guys this is my sample Library Management System, this will do the basic task of a
School Library










System Features>>

Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Hotel Reservation And Billing System

This is my simple project Hotel Reservation and Billing System,it can do the basic Process
of a Hotel Management











Continue Reading with Borgy's Blog »
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Copyright @ Codes-47.Blogspot.Com. Powered by Blogger.