How to Load Agent Control in VB6

Hello Guys, at this time i will show to you on how to load a Agent Control in your own
program, loading this control is to make your program entertaining specially if you are
developing games or to warn the user in animated way, so try to use MS Agent Control,
to do this just go to Project tab>Components>Microsoft Agent Control 2.0, then after
adding the control on your tool box just drag it on your form and the basic code will look
like this and you will do the rest:

MYAgent.Characters.Load "Merlin", "Merlin.Acs"
Set MyCharacter = MYAgent.Characters("Merlin")
    MyCharacter.MoveTo 400, 400
    MyCharacter.Show
    MyCharacter.Play "Announce"
    MyCharacter.Speak "Your Message goes here"


the output will look like at the image shown below:















the Agent Name is Merlin, this character is the default Agent character on Vb6, but there
are some characters, named Robbie and Genie, you can download those  character at
Microsoft site

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 New User in SQL Server 2005

Are you getting bored about your Sql Server User Log-in?, at this time i will demonstrate to
you on how to add a new User Log-In on your Sql Server,by the way the default user log-in
on the Sql Server Authentication mode is "sa", so we want to do is try something new
so to do this, just follow those few steps below and those will saved your day:

1.) Go to Security tab, just look at the hierarchical folder at the Left side pane of your Sql 
Server 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

How to Display Data on MS FlexGrid

To do this,first you must add this control to your  form layout , just right click the tool box
pane, at the pop up menu just click components,and the Control  Dialog appear,then hunt
Microsoft FlexGrid Control (SP6),then mark check the box then hit the Apply button,finally
Microsoft FlexGrid Control (SP6) is on your tool box,just drag it on your form then lets do
the Action,

Tip: you can modify this control by simply right-click on it then
click properties,like shown on the image below


















the code will look like this:

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 '-21472117900(80040e14)'

" [Microsoft][OBDC SQL Server Driver][SQL Server] the normal parameter "@Status"
was not declared as an an OUTPUT parameter,but the actual parameter passed
in requested output "


This error will get you in trouble????????????????? at my own experience this error comes
out when i call a stored procedure on my SQL Server database and after compiling it this
error will appear saying those message,i double check my code then traced where  this error
came out,so my situation is i declare a  parameter on my stored procedure where does not 
declare its output parameter,the problem goes here,

i declare a parameter @Status on my stored procedure but the sad thing is i forgot the value
of this where  supposedly look like this,

MyCmd.Parameters.Append MyCmd.Create Parameter("SPLAppPos", adVarChar, 
adParamInput, 50,"Active")

so its better to declare all the parameters and declare their corresponding value to avoid
this kind of typo error

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

OLEDB EXCEPTION WAS UNHANDLED

Hello guys have a good day to all who is reading this article, go back in the problem " oledb 
exception was unhandled " i encounter this type of problem when i worked at the database
this little error will prompt to me,and i wonder why this error will come out,i double check
every single of my code then i found out the only problem is the  spelling of a column name
on my database instead of ID_Num i wrote only ID, after changing the code to the respective
syntax , the program works fine and saved my day.

Note: 
         Not only Mis-Spelled variable or column name on
         your database but also when you are typing the Reserved 
         words of Visual Basic 2010 will get you on trouble like this.

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 Connect MS Acess Database to VB 2010

Hello guys,at this time i will show to you on how to connect a MS Access Database on 
Visual  Basic 2010, make sure that your database is inside of the Debug Folder created by 
Visual Basic 2010,then the codes will look like this:

Public Class Form1

 Dim con As New OleDb.OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;
Data Source = |DataDirectory|\Panoy.mdb;")

End Class

first you must establish the connection and set the Provider, to Microsoft.Jet.OLEDB.4.0,
and the Data Source, this is your Database Path or Directory, 

Note: |DataDirectory|\Panoy.mdb; this is your database correct path coonection
,|DataDirectory| is the replacement of App.Path on VB 6.0;

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

Run-time error '3265'

" Item cannot be found in collection corresponding to  the requested name or ordinal "

Hello Guys,if  this error will came out when  youre running your program, the cause of this
problem is on your database or on your procedure on how you to fetch the data from the
database,here a sample procedure that makes error when fetching data from database:

        With Lv1
        .ListItems.Clear
            Do While Not rs.EOF
                Set Panoy = .ListItems.Add()
                    Panoy.SubItems(1) = rs!L_Name
                    Panoy.SubItems(2) = rs!FName
                    Panoy.SubItems(2) = rs!Course
                   rs.MoveNext
            Loop
        End With

and some cause of this is,if you mis-spelled the
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

"Msg 102, Level 15, State 1, Procedure Holidays, Line 19 Incorrect syntax near '@App_By'."























This Error come out when i wrote a simple stored procedure at my

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

Search Engine in VB6 (Smart Search)












I think this simple program will saved you on your work and get an idea about the smart
searching,this will saved your day,because of its nice searching effects,like what we experience
on  Google search engine;

Download sample of Smart Search

Hope you like it ^_^
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

Run-Time Error '3421'

"Application uses a value of the wrong type for the current operation"

This error will appear on your current environment specially if you are working Sql Server 
stored procedure and call it via VB6. To fixed this problem, you can double check the Data 
Type fields on your database and make it sure that you assign it on their respective data types
and also on your Stored Procedure, this is a sample,assigning on its corresponding Data Types













As you can see at the image above the data types on each field will exactly fit or accurate on
each column name, and make it sure your stored procedure will set on its corresponding data
types:

Hope this will Help ^_^
The Hardest thing to to is yo 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 Autogenerated ID Number

Hello guys,this is sample code on how you to generate a Auto-Generated ID Number or a
Primary Key, because many programmers like me are want the ID Number or Primary Key
become Dynamic, so we can do the basic solution like this:

In my case i put it on a Sub Procedure that i placed it on a Module,so the this is the Code:

Sub EmployeePosition_ID()
Set rs=New Adodb.Recordset
    If rs.State = adStateOpen Then rs.Close
        rs.Open "SELECT MAX (right(Position_ID,6)) _
            from EmployeePositions", Conn
        If rs.EOF <> True Then
           Employee_Positions.txtID.Text = "SPC"  + "-"
         + Right("000000" _
            & IIf(IsNull(rs.Fields(0)), 1, rs.Fields(0) + 1), 6)
        End If
End Sub

How does it Works??

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 -2147217900(8004e14)

[MICROSOFT][OBDC Sql Server Driver][Sql Server] procedure or function (Get_Emp)
expects parameter  '@empid',which was not supplied

I encounter this error when i call a stored  procedure from my SQL SERVER database,
the cause of this error is when i forgot to declare the parameters of my stored procedure
that supposedly declaring like this:

Mycmd.Parameters.Append _
Mycmd.CreateParameter("EmpID",Advarchar,AdparamInput, _
50,txtid.text)

Note: Get_Emp is my Stored Procedure Name

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 Add Day in Date in Vb6

Hello guys,this time i will show to you, the use of  DateAdd Function, this function will use
for adding day(s) to a given date, for example i want to add 5 days on this given date  
"2/7/2011",so obviously we want the answer become "2/12/2011", to get this answer,just
simply follow this code:

DateAdd("d", 5, "2/7/2011")

since i am dealing with day(s) to add, this will represent with "d" if you want to add a
month(s), just replace "d" with "m" so its simple as counting 123.......

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 Subtract Minutes in Vb6

Here is the basic way on how to subtract the minutes elapsed on the given time.

for example i have a time 12:00 PM and 1:00 PM so we can solved the elapsed time by
using  DateDiff function, so supposedly the answer is 60 mins. so enough words, the code
will look like this:

DateDiff("n", "12:00 PM", "1:00 PM")

the "n" there is represent the minutes value its similar on how to get the day elapsed that
represents by "d":

Note: if you doing this procedure you must place your subtrahend first or the lesser value,
otherwise you got a negative answer.

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 Add an Image on a List View Control

First you must add the component named Microsoft Windows Common Control(sp6), at
the  Project Tab>Component or just simply right click the tool box then the pop-up menu
will appear.















after adding the components just drag it on your form window then right click on the list view
control,then click properties,like shown on the image above.





















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.