How to Attach and Detach Database on SQL Server

This is a simple way on how to Attach and Detach Database on your SQL Server,
to work with it just follow this few step's:

here where to Detach your Database, just right-click on your database then click
Task, and hit Detach and your done 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

Cannot Insert Duplicate Key in Object 'dbo.BO'

















Are you encounter this kind of error?, if you, you are in the right place at the right time, this
error says Violation of Primary key, obviously the problem is on my database, that
also indicated on the error dialog, 'dbo.BO' is my database name on my SQL Server,
so the main problem is when i'm trying to INSERT a duplicate value on a TABLE which

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 Call Sql Server Stored Procedure in VB6

Hello Guys, At this time i will show to you on how to execute or call a stored procedure of
SQL Sever, here we go>>>>>>>>>>

Make sure that your Database Connection and Command, like shown at code below



Public MrCmd As ADODB.Command 'just put it on amodule
Public Conn As ADODB.Connection

i declare MrCmd as my ADODB.Command and Conn As ADODB.Connection as
Public for me to access or use it every-time i want, so you can write it like this

Set MrCmd = New ADODB.Command ' you must set MrCmd  as New 
                                                               ADODB.Command
MrCmd.ActiveConnection = Conn          ' this were your connection is being set
MrCmd.CommandType = adCmdStoredProc 'since we are dealing with stored procedure
                                                                 'let set the command type = adCmdStoredProc

MrCmd.CommandText = "Get_Products" ' this is your Stored Procedure

MrCmd.Execute 'execute your stored procedure
MrCmd.ActiveConnection = Nothing 'set your connection  close

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

Syntax Error or Access Violation( Run-time error '-2147217900 (80040e14)')

If you are getting trouble on this kind of error prompting
 Run-time error '-2147217900 (80040e14)' Syntax Error or Access Violation like
shown at the image below:

                                Figure 1.0













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 Convert MS Access Database to SQL Server Database

Hello guys at this time i will show to you on how to convert your MS Access Database to
SQL Server Database, to do this, just follow those few steps below.








on your MS Access database, go to Database Tools, go to Move Data tab, then click
SQL Server

















then the Up-sizing wizard will prompt, allowing you to use an option, at this time since
i am not using Existing Database, so i select Create new Database, then Click Next
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

How to Connect Crystal Reports 8.5 to VB6 via DSN Connection

This is my sample tutorial on how you to connect your Crystal Reports on your Visual
Basic 6.0, this version of Crystal Reports is 8.5, so here we go.............


Just follow those few steps:

1.) Project >Add Crystal Reports 8.5




















 2.)  if you can't see Crystal Reports on the Project Tab, just Click Components>
       Designers, then Check the Box, for you to add Crystal Reports on your Project





















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 In VB 2010

Hello guys this is my sample database manipulation, using the 3 basic transaction, the
INSERT, UPDATE and DELETE like shown at the image below.









INSERT:

Dim rs As New OleDb.OleDbCommand("Insert INTO Info(F_Name,M_O
,SSS,Phic,Pagibig,Tax,Net_Inc) VALUES ('" &
StrConv(TextBox2.Text, VbStrConv.Uppercase) & "','" & (TextBox3.Text) & "','" &
 (TextBox4.Text) & "','" & (TextBox5.Text) & "','" & (TextBox6.Text) & "','" &
 (TextBox7.Text) & "','" & (TextBox8.Text) & "')", con)

UPDATE:

Dim rs As New OleDb.OleDbCommand("Update  Info Set F_Name='" & StrConv
(TextBox2.Text, VbStrConv.Uppercase) &  "',M_O='" & (TextBox3.Text) & "',
SSS='" & (TextBox4.Text) & "',Phic='" & (TextBox5.Text) & "',Pagibig='" & 
(TextBox6.Text) & "',Tax='" & (TextBox7.Text) & "',Net_Inc='" & (TextBox8.Text) 
& "'  WHERE ID_Num =" & id & "", con)

DELETE:

Dim rs As New OleDb.OleDbCommand("DELETE FROM Info WHERE
ID_Num = " & id & "", con)



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

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

Sales And Inventory System













This is a sample process of Sales and Inventory system that monitor the process of one
Department store,all those process in this program is a basic process of one Department
Store,if you want this system just download it Below:

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

Data Type Mismatch in Function Object

"Data Type Mismatch in Function Object " Solved After i encounter this error message i
found that my Data Type on my database is mismatch, because i want to display a Currency
type on a data report of my project which is a current data type is varchar(50) so obviously
Data Type Mismatch so i found my own solution by changing the Data Type to Float, for me
to display a sum of my database field on my data report through the used of a RptFunction.
So its better to declare a corresponding Data Type for your Data Field inside of Database to
Avoid this type of error.

Hope this will be Help!!
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

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

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