1.) First you must click the Project Tab shown in the figure below,Then Click Add Data 
Environment












































2.) Connection Environment will Appear













3.) To connect to Data Source Name,just right-click the connection,then click properties
like shown on the image below























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

1.) First you must click the Project Tab shown in the figure below,Then Click Add Data 
Environment






















2.) Connection Environment will Appear

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

1.) First you must click the Project Tab shown in the figure below,Then Click Add Data
Environment






















2.) Connection Environment will Appear













3.) To connect to Data Source Name,just right-click the connection,then click properties like
shown on the image below























4.) Data Link Properties dialog will appear and select Microsoft OLEDB Provider For 
OBDC Drivers,then Click Next






















5.) From the Connection Tab,select the button Use data source name, then press the drop
down button of the combo box then select your DSN file listed,like what i did






















6.) then at User Name:(enter the username of your server) password:(enter your server
password) then at the Enter Initial catalog to use: just select your listed  server database 























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 Display Data in Combo Box

This is the basic way and a basic code on how you to Add Data on Combo Box Control of
your Vb6 program the code below is show you the static way that the data has never change
during runtime:

With Combo1
   .AddItem "Adrian"
   .AddItem "Panoy"
End With

The Code below show you the dynamic way because the data are fetch from your database:

Note: Make sure that your Database Connection is
properly established

Adrian="SELECT * FROM <your tableName>"
Rs.Open Adrian,Conn
     Do While Not Rs.EOF
                Combo1.AddItem Rs!P_Type
         Rs.MoveNext
    Loop

Hope this will Help
Happy Coding ^_^
The Hardest thing to Do is to Do Nothing
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 Count Down Timer in Vb6

This is the very basic way on how you to create your own count down timer using timer
Control on your Visual Basic Project just add 1 Label,1 Command button,and also a timer
control,at label caption property make it 15,then at the timer control property under
Enabled=False,and Interval=1000 which is equivalent to 1 seconds,then under command
button clivk event place this code below

Private Sub Command1_Click()
    Timer1.Enabled = True
End Sub

and at the timer timer event

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 Toolbar in Vb6

 This Tutorial will Show you on how to add a Toolbar Control on your visual Basic program,
just follow the few steps below:

 1.) Go to Project Tab like shown on the image below then click Components






















 2.)the components dialog box will prompt,and just simply find the Microsoft windows 
common Controls 6.0 (sp6),like what i did on the image below,then click Apply button

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

this is the very basic way on how to use the DATEPART function in vb6,to retrieve
the day,month,year passed to the current date:

CODE:

Print "Days: " & DatePart("d", Now)
Print "Year: " & DatePart("yyyy", Now)
Print "Month: " & DatePart("m", Now)
Print "Quarter: " & DatePart("q", Now)
Print "Weeks: " & DatePart("w", Now)
Print "Hour: " & DatePart("h", Now)
Print "Minutes: " & DatePart("n", Now)
Print "Seconds: " & DatePart("s", Now)

Output:
the output will depends in your current system date,for my case,since my syte my
system date is December 21,2010 19:52:44 PM the output will look like this:

Days: 21
Year: 2010
Month: 12
Quarter: 4
Weeks: 3
Hour: 19
Minutes: 52
Seconds: 44

The Hardest Thing to Do is to Do Nothing
Hope you Like it 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 Replace String in VB6

This sample code will show you on how to Replace a string on a Text-box Control using the  
Replace Function and the code will done like this:

Add  1 Text-box Control and 1 Command Button at the Text-box,Text property Put a Letter
A and put this code under the Command Button Click Event

Text1.Text = Replace(Text1.Text, "A", "B")

'this will Replace the letter A on the Text-box Control with Letter B, Hope you get the Logic!!!

The Hardest Thing to Do is to Do Nothing
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 Create a Slot Machine using VB2010

This is my first sample program using Visual Basic 2010 because
i want to upgrade to Vb2010 from Vb6.0 and i hope you like it,
this is a Simple program that generate 3 Random Numbers on a
label control,and compute the price on each combination,on this
program i used the Calling method,the Val function,If and Else
Statement,the simple use of Link Label: to download this file just
follow this link SlotMachineNiAdrianPanoy























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 Generate Random Numbers in Vb2010

Generating Random Numbers in Visual Basic 2010 is similar on how to Generate Random
Numbers in Visual Basic 6.0, first you must add 1 button and 3 labels on the form then create
a Sub Procedures named Randomize that shown in the code below:

'place this code on your button click event
Call Randomize

Sub Randomize() 'this is your random number generator
        lbl1.Caption = CStr(Int(Rnd() * 10))
        lbl2.Caption = CStr(Int(Rnd() * 10))
        lbl3.Caption = CStr(Int(Rnd() * 10))
End Sub

The Hardest Thing to Do is to Do Nothing
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 Generate Random Numbers in Vb6

this is the basic way on how to generate a Random Numbers in VB6, Just Add 3 Label
Control named it with lbl1,lbl2,lbl3 and 1 command button, and create a Sub Procedure
and call it vial click event of your command button and the code will look like this:

Private Sub Command1_Click()
Call Randomize
End Sub
Sub Randomize()
        lbl1.Caption = CStr(Int(Rnd() * 10))
        lbl2.Caption = CStr(Int(Rnd() * 10))
        lbl3.Caption = CStr(Int(Rnd() * 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

Insert,Update,Delete













this is my sample program on how to Insert, Update, and Delete Via your database: the
connection is Done through system DSN, before running this program first create a
simple DSN connection via control panel,if you have no idea on how to create a DSN
Connection just follow this Link How to  create a System DSN of MS Access,follow the
steps that are stated there:in this sample  program will include a simple Error handler,
at a simple calling method


for the INSERT Statement Code this will
look like this:

Conn.Execute "INSERT INTO Names (ID_Num,FName,MName,LName,C_N) " _
& " VALUES ('"& (txtID.Text) & "','"& (txtFN.Text) & "','"& (txtMN.Text) _
& "','"& (txtLN.Text) & "','" & (txtCn.Text) & "')"

'you must state your Database Table Field Name and for the Values is the  control where did 
you store the data to Insert on your Database so for example at the code above is ID_Num is 
my database table field Name and the data that i want to put on its column is the data holds by 
the txtID control or by default is Textbox Control

For the UPDATE Statement:

Conn.Execute "UPDATE Names SET FName='" & (txtFN.Text) & "',MName='" _
& (txtMN.Text) & "',LName='" & (txtLN.Text) & "',C_N='" & (txtCn.Text) & "' 
WHERE ID_Num='" & (txtID.Text) & "'"

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 Display Data on List View in Vb6

This is the basic way on how to display data on a List View Control in Visual Basic 6.0, First
you must Add the control Project > Components > Microsoft Windows Common  Controls 
6.0 (SP6), then drag the List view Control: at the general tab, at View: select the Report View:

Here the sample Code:

'Declare a variable that holds for ListItem

Dim Panoy As ListItem

'set the listitem shown in the code below
   Set Panoy = ListView1.ListItems.Add(, , "Adrian")


Displaying Data from your Database:
make sure that your database connection are properly set initialize the Connection and the
Record-set,  this is done through the Do While Loop structure:

Dim Mrhumble As String ' this the string holds the query
Dim Panoy As ListItem 'holds your Listitem

With ListView1
     Set RS=New Adodb.Recordset
     Set Conn=New Adodb,Connetion
         Mrhumble="SELECT * FROM MyName"
        Rs.Open Mrhumble,Conn
           Do While Not RS.EOF
               Set Panoy=.ListItems.Add(, , Rs!FName)
                     Panoy.Subitems(1)=Rs!MI
                     Panoy.Subitems(2)=Rs!LName
              Rs.MoveNext
         Loop
End With

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 Capitalize the First Letter on a Text Box in VB6

this time i will show you on how to capitalize every first letter of a word in a Text box Control,
follow the codes below:

This code will write on a module as a function just copy and paste on a module

Public capT As Object

Public Sub cap(frm As Form)
cr = vbCrLf

For Each capT In frm.Controls
 If TypeOf capT Is vkTextBox Then
 t = capT.Text
        If t <> "" Then
         Mid$(t, 1, 1) = UCase$(Mid$(t, 1, 1))
         For i = 1 To Len(t) - 1
           If Mid$(t, i, 2) = cr Then Mid$(t, i + 2, 1) 
               = UCase$(Mid$(t, i + 2, 1))
           If Mid$(t, i, 1) = " " Then Mid$(t, i + 1, 1) 
             = UCase$(Mid$(t, i + 1, 1))
         Next
         capT.Text = t
        End If
    End If
Next capT
End Sub

Hope you Like it
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 Icon on List View

This sample tutorial is showing you on how to add an icon or image on a List-view control on
your own program:
1.) you must Add Microsoft Windows Common Controls  6.0 (SP6) , to simply add a  
List-view Control and a  Image-list Control:

2.) set up the List-view Control on your form and also a  Image-list Control, to set a List-view 
on a General Tab set the View to Report, like show on the figure below:




















then you must add a Column Header for your column  Title like shown Below:























then click Apply button .

4.) to put an Image on a Image List just follow the steps below right-click the Image-list >
Properties and the Property Dialog will prompt


















at General Tab choose the size of the image you want  then at the Image Tab click Insert 

Picture like shown below: then the Select Picture Dialog will Prompt for you to add image
on a Image List, then click Open button the OK.
















then the simple code will look like this: the code will placed on the Form Load event

Private Sub Form_Load()
'first you must declare a variable that holds as Listitem
    Dim panoy As ListItem
'lv1 is the Listview name so we can initialized first like shown
'below
          lv1.SmallIcons = ImageList1
'set the listitem 
              Set panoy = lv1.ListItems.Add(, , "Panoy")
'and the icon will down to this code calling the image
'on a imagelist and the index of image is 1
        panoy.SmallIcon = 1       
End Sub

and the output  will look like this:























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

Run Time Error 35613

"Imagelist must be initialized before it can be used" if you got this error message, your  
imagelist is need to initialized first before declaring it for the certain used.for example if the
imagelist is used as a image container for a Listview control so before you declare it via this
code:

    panoy.smallicon=1

with out initializing imagelist,you always got this error so to avoid this kind of error you need
to initialized first through this code

    listview1.smallicons=imagelist1

so i think this will help for those beginners on vb6 programming
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

Cant find Project or Library

Hello guys this time i will discuss it to you on how to solved this error CANT FIND 
PROJECT OR LIBRARY, this is error will usually encounter, if there are missing
REFERENCE on your project, to solved  it just go to  Project Tab>Reference>
then unchecked all the listed  Missing Reference.

on my case, i encounter this error when i reformatted my laptop and i  run my projects,
the error dialog box prompt says CANT FIND PROJECT OR LIBRARY, all the
built vb functions that i used will highlighted, like the   Right,left,date,time,chr etc. just 
because of a missing  reference of crystal reports, after i unchecked those reference 
my projects runs normally.
Note: this solution is based only on my experienced 
using a Visual  Basic 6.0,but hoped this will help or 
giving you a hint on how to solved your own problem

 
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 Filter the Special Characters in Vb6

This sample line of codes will show you on how to filter all
the special character on your keyboard that will inputted by
the user, this is very important to avoid the typo error, so we
want to trap it via this code

If KeyAscii >= 1 And KeyAscii <= 7 Or _

       KeyAscii >= 9 And KeyAscii <= 47 Or _

       KeyAscii >= 58 And KeyAscii <= 64 Or _

       KeyAscii >= 91 And KeyAscii <= 96 Or _

       KeyAscii >= 123 And KeyAscii <= 255 Then

            KeyAscii = 0

    End If

By determining the equivalent value of each character
you can browse your ASCII code,on the code given
i will not include the 65 to 90 because this range are holds
the value of A-Z and 48-57 that holds the range 0-9.
Hope this will help
Good Luck (^_^)
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 Table on SQL Server

Here the Following steps on how to create Table on your
SQL Server 2005

On your Database that you Created just click the cross
box to view it on a hierarchical form shown on  the image
below, by creating database just follow this link
How to Create a Database on SQL Server 2005,
then on the Tables just simply right-click  and press
New Table


























After pressing New Tables this will prompt to you or also
known as the Design View, Insert your Column Name,
and Specified the Data Types,and Allowing Nulls if you
want to not Duplicate the Value of the data or the value of
ID_Num to avoid Data Redundancy just unchecked the
box,or you want to duplicate it just leave it with checked














Then Click Save and prompting the Choose Name Dialog
so choose your table name at this time i type Employees



















Then you can see your table under  Tables,just click the cross box
it will show the dbo.Employees,it will show also at the summary at the
right pane of object explorer
























or we can also create table via SQL Query by doing this
just press New Query Tab, then enter this following code

--this will create also the Employees table
CREATE TABLE Employees (

     ID_Num int NOT NULL,
     First_Name varchar (25),
     Last_Name varchar(50),
    Middle_Name varchar(50),

)


Good Luck (^_^)
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 Database on SQL Server

this is the basic steps on how to create your own database on
your SQL Server 2005

At the Object Explorer window just right-click the database
then click New Database like shown on the image below.
























After pressing the New Database this will prompt the
New DatabaseDialog window, at obviously your
database name

Database Name: (Type your Database Name)
Owner: (set default)
at this time let filled up with Payroll database
then press the OK button not the Add Button





















Then after the Payroll database will added on your server and
it will show also on the summary window show at the right



















by Creating a Table just Follow this link below
How to Create Table on SQL Server

Good Luck!!!!!
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 Calculate Date using Date Diff and Date Add Function

this code will show you on how to calculate the difference of  two dates like for example 1
0/10/2010 to 10/01/2010 to find the lapsed day we use a Date Diff function that is 
built in VB6 so the code will look like this:

Label1.Caption = DateDiff("d", #10/1/2010#, #10/10/2010#)

at this code i display the output on a label control did you notice that the Date Diff function i
s there,since i am looking for  day lapsed to 10/01/2010 to 10/10/2010 the output is 9 if you 
are looking for a month just simply change the letter "d" to letter  "m" for a month symbol
and of  course it is not complete if i did  not include for a year,so for the year calculation just
simply change  also the letter on a two double quote(" ") to a "yyyy" and you  got the answer......

for a Month:
DateDiff("m", #10/1/2010#, #10/10/2010#)

 for a Year:
DateDiff("yyyy", #10/1/2010#, #10/10/2010#)

For the Date Add function for example we have add 3 days on the current date so it will
done like this:

this will add 3 days on your current system date 
 DateAdd("d", 3, Now)

this will add 3 months on your current system date
for a Month:
DateAdd("m", 3, Now)

 this will add 3 years on your current system date for a Year:
DateAdd("yyyy", 3, Now)

 Hope this will help to you!!
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 Create a Stored Procedure in SQL Server

Hello guys this is the basic way on how to simply Create a Stored Procedure in Sql Server
2005 just follow the Steps that shown on the Image below























Click Database then























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

Nested IF

This is the basic Code for Nested IF Structure in vb6

Dim Adrian, Panoy As Integer

Adrian = Val(Text1.Text)'holds the value of text1
Panoy = Val(Text2.Text)'holds the value of text2

    If Adrian = 100 Then ' if  Adrian=100 then it will  to the next if

        If Panoy = 100 Then 'if Panoy=100 then msgbox Prompt

            MsgBox "You Got it"

        End If

    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

Do Loop Until

This the Basic code of Do Loop Until in Vb6

Private Sub Command1_Click()

Dim Adrian As Integer 'holds the Value of 1 to 10

    Adrian = 1'set the value to 1

    Do

        Print Adrian ' print the value

            Adrian = Adrian + 1 ' increment by 1 from original value

    Loop Until Adrian = 10 'end after Adrian=10
   
'this will print the numbers 1-9

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 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.