como crear una base de datos con sql del mismo visual basic 2005 utilizando label. Alguien me podria mandar los pasos a seguir es urgente
este es el codigo
Public Class Form1
Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
Dim lectura As Integer
Dim entrada1 As Byte
Dim entrada2 As Byte
Dim entrada3 As Byte
Dim caja1 As Integer = 0
Dim caja2 As Integer = 0
Dim caja3 As Integer = 0
Dim Total As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer2.Enabled = True
'Timer1.Interval = Texto1.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
Timer2.Enabled = False
Timer1.Interval = Me.TrackBar1.Value
PortOut(&H378, 0)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PortOut(&H378, 0)
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PortOut(&H378, 0)
Suma = 1
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
End Sub
Private Sub Texto1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Texto1.TextChanged
Timer1.Interval = Texto1.Text
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Select Case Suma
Case "1"
Texto1.Visible = True
Texto2.Visible = False
Texto3.Visible = False
Texto4.Visible = False
PortOut(&H378, 3)
Case "2"
Texto1.Visible = False
Texto2.Visible = True
Texto3.Visible = False
Texto4.Visible = False
PortOut(&H378, 6)
Case "3"
Texto1.Visible = False
Texto2.Visible = False
Texto3.Visible = True
Texto4.Visible = False
PortOut(&H378, 12)
Case "4"
Texto1.Visible = False
Texto2.Visible = False
Texto3.Visible = False
Texto4.Visible = True
PortOut(&H378, 9)
End Select
If Option1.Checked Then
Suma = Suma + 1
If Suma = 5 Then
Suma = 1
End If
Else
Suma = Suma - 1
If Suma = 0 Then
Suma = 4
End If
End If
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
Timer1.Interval = TrackBar1.Value + 1
End Sub
Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
lectura = PortIn(&H379)
'entrada1 = lectura And &H8 'Sensor abajo
'entrada2 = lectura And &H10 'Sensor medio
'entrada3 = lectura And &H20 'Sensor arriba
entrada1 = (lectura And 8) / 8
entrada2 = (lectura And 16) / 16
entrada3 = (lectura And 32) / 32
If entrada3 <> 0 And entrada2 <> 0 And entrada1 <> 0 Then
Label1.Visible = True
caja1 += 1
Else
Label1.Visible = False
End If
If entrada3 <> 0 And entrada2 <> 0 And entrada1 = 0 Then
Label2.Visible = True
caja2 += 1
'If entrada2 = caja2 Then caja2 = caja2 + 1
Else
Label2.Visible = False
End If
If entrada3 <> 0 And entrada2 = 0 And entrada1 = 0 Then
Label3.Visible = True
caja3 += 1
'If entrada3 = caja3 Then caja3 = caja3 + 1
Else
Label3.Visible = False
End If
Label4.Text = "Numero de cajas tamaño1 es: " & caja1
Label5.Text = "Numero de cajas tamaño2 es: " & caja2
Label6.Text = "Numero de cajas tamaño3 es: " & caja3
'Label7.Text = "Total cajas" & (Str(caja1) + (caja2) + Str(caja3))
Label7.Text = "Total de cajas:" & (Str(caja1 + caja2 + caja3))
End Sub
End Class