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

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