Halloween party ideas 2015


adOpenForwardOnly - this is the default cursor if no other is specified. This cursor allows only forward movement through a recordset

adOpenKeyset - this cursor supports forwards as well as backwards navigation. It also allows you to update a recordset and all changes will be reflected in other users recordsets. The cursor also supports bookmarking

adOpenDynamic - this cursor supports forward and backward navigation but bookmarks may not be supported (ie Access). Any changes made to data are immediately visible with no need to resynchronise the cursor with the database

adOpenStatic - this cursor uses a static copy of data from the database and therefore no changes to the data are visible and supports forward and backward navigation

The locktype parameter specifies which type of locking should be used on the cursor when editing data in a recordset

adLockReadOnly - default type used when no locktype is specified
adLockPessimistic - forces the database to lock the entire record when editing first starts
adLockOptimistic - locks records only after you call the UPDATE method of the recordset object
adLockBatchOptimistic - allows batch updating instead of updating each record individually


The Code

Private Sub Form_Load()
Dim a, b, c, det As Integer
Dim root1, root2 As Single
Dim numroot As Integer
End Sub

Private Sub new_Click()
' To set all values to zero
Coeff_a.Text = ""
Coeff_b.Text = ""
Coeff_c.Text = ""
Answers.Caption = ""
txt_root1.Visible = False
txt_root2.Visible = False
txt_root1.Text = ""
txt_root2.Text = ""
Lbl_and.Visible = False
Lbl_numroot.Caption = ""
End Sub

Private Sub Solve_Click()
a = Val(Coeff_a.Text)
b = Val(Coeff_b.Text)
c = Val(Coeff_c.Text)
'To compute the value of the determinant

det = (b ^ 2) - (4 * a * c)
If det > 0 Then
Lbl_numroot.Caption = 2
root1 = (-b + Sqr(det)) / (2 * a)
root2 = (-b - Sqr(det)) / (2 * a)
Answers.Caption = "The roots are "
Lbl_and.Visible = True
txt_root1.Visible = True
txt_root2.Visible = True
txt_root1.Text = Round(root1, 4)
txt_root2.Text = Round(root2, 4)

ElseIf det = 0 Then
root1 = (-b) / 2 * a
Lbl_numroot.Caption = 1
Answers.Caption = "The root is "
txt_root1.Visible = True
txt_root1.Text = root1
Else
Lbl_numroot.Caption = 0
Answers.Caption = "There is no root "
End If
End Sub


Visual Basic offers a rich assortment of built-in functions. The on-line help utility
will give you information on any or all of these functions and their use. Some
examples are:


Function                      Value Returned
Abs                              Absolute value of a number
Asc                              ASCII or ANSI code of a character
Chr                              Character corresponding to a given ASCII or ANSI code
Cos                              Cosine of an angle
Date                             Current date as a text string
Format                         Date or number converted to a text string
Left                              Selected left side of a text string
Len                              Number of characters in a text string
Mid                             Selected portion of a text string
Now                           Current time and date
Right                           Selected right end of a text string
Rnd                            Random number
Sin                             Sine of an angle
Sqr                            Square root of a number
Str                            Number converted to a text string
Time                         Current time as a text string
Timer                        Number of seconds elapsed since midnight
Val                            Numeric value of a given text string

ARITHETIC OPERATORS
 
Operator     Operation
^                   Exponentiation
* /                 Multiplication and division
\                    Integer division (truncates)
 %                 Mod Modulus
+ -                Addition and subutraction



CONCERTINATION

To concatentate two strings, use the & symbol or the + symbol: e.g
lblTime.Caption = "The current time is" & Format(Now, “hh:mm”)
txtSample.Text = "Hook this “ + “to this”


 COMPARISON OPERATORS

Operator        Comparison
>                     Greater than
<                     Less than
>=                   Greater than or equal to
<=                   Less than or equal to
=                     Equal to
<>                   Not equal to


LOGICAL OPERATORS

Operator          Operation
Not                   Logical not
And                  Logical and
Or                    Logical or
 
Powered by Blogger.