CONECCION VBASIC 6.0 CON ACCES
Publicado por Alcides Suavil (1 intervención) el 08/07/2013 16:20:35
HOLA AMIGOS
Relalice una coneecion con este ejemplo y me funcion perfectaemten pero al realizar otro modulo para conectar otro proyecto me da un error " Error de Compilacion" Nose a definido el tipo definido [por el usuario Public rs as New Recorset
Public cn as New Connection
Public Cn As New Connection
Public rs As New Recordset
Public Rstemp As New Recordset
Public CodBus As String
Public Sub Conectar()
Cn.Provider = "Microsoft.Jet.Oledb.4.0"
Cn.Open (App.Path + "\base\vac_jer.mdb")
End Sub
Public Sub llenarcombo(c As ComboBox, t As String, col As Integer)
If Rstemp.State = 1 Then Rstemp.Close
Dim Sql$
Sql = "select * from " + t
Rstemp.Open Sql, Cn, adOpenStatic, adLockOptimistic
Do While Not Rstemp.EOF
c.AddItem Rstemp(col)
Rstemp.MoveNext
Loop
Rstemp.Close
End Sub
Public Sub limpiar(f As Form)
Dim c As Control
For Each c In f
If (TypeOf c Is TextBox) Or (TypeOf c Is ComboBox) Then c.Text = ""
If TypeOf c Is OptionButton Then c.Value = False
Next
End Sub
Relalice una coneecion con este ejemplo y me funcion perfectaemten pero al realizar otro modulo para conectar otro proyecto me da un error " Error de Compilacion" Nose a definido el tipo definido [por el usuario Public rs as New Recorset
Public cn as New Connection
Public Cn As New Connection
Public rs As New Recordset
Public Rstemp As New Recordset
Public CodBus As String
Public Sub Conectar()
Cn.Provider = "Microsoft.Jet.Oledb.4.0"
Cn.Open (App.Path + "\base\vac_jer.mdb")
End Sub
Public Sub llenarcombo(c As ComboBox, t As String, col As Integer)
If Rstemp.State = 1 Then Rstemp.Close
Dim Sql$
Sql = "select * from " + t
Rstemp.Open Sql, Cn, adOpenStatic, adLockOptimistic
Do While Not Rstemp.EOF
c.AddItem Rstemp(col)
Rstemp.MoveNext
Loop
Rstemp.Close
End Sub
Public Sub limpiar(f As Form)
Dim c As Control
For Each c In f
If (TypeOf c Is TextBox) Or (TypeOf c Is ComboBox) Then c.Text = ""
If TypeOf c Is OptionButton Then c.Value = False
Next
End Sub
Valora esta pregunta


0