hola amigos espero de verdad algun dia puedan ayudarme!!!!! ten go el siguiente programa que estado desarrollando dandome muchos golpes, soy nuevo en la programacion pero me encanta... el problema es que esto lo hice en casa el fin de semana y todo a las mil maravillas pero cuando lo llevo al trabajo me salata un erro que dice EL CONTROLADOR ODBC NO ADMITE LAS PROPIEDADES SOLICITADA he investigado mucho de verdad para dar con la solucion!!! ayuuuuuuuuuuda por favor ayuuuuuuuuda
Option Explicit
Private cnn As ADODB.Connection
Private WithEvents rst As ADODB.Recordset
Const val = 2
Private Sub Command1_Click()
Text2.Text = ""
List2.Enabled = False
List3.Refresh
List3.Enabled = False
List4.Refresh
List4.Enabled = False
End Sub
Private Sub Command2_Click()
Dim respuesta As Integer
respuesta = MsgBox("Ralmente desea salir", vbQuestion + vbYesNo + vbDefaultButton2, "Salir")
If respuesta = 6 Then
End
Else
Form1.Refresh
End If
End Sub
Private Sub Command3_Click()
Dim var As String
var = Text2.Text
Form2.Show
rst.AddNew
rst!Codigo = var
rst.Update
End Sub
Private Sub Command4_Click()
Dim Campo As Integer
Dim Item As ListItem
Dim i As Long
With ListView1
'Vista de reporte
.View = lvwReport
' Elimina los item y los encabezado de columna
.ListItems.Clear
.ColumnHeaders.Clear
End With
Me.MousePointer = vbHourglass
'Agrega los nombres campo junto con los encabezados de columna para el ListView
For Campo = 0 To rst.Fields.Count - 1
ListView1.ColumnHeaders.Add , , rst.Fields(Campo).Name
Next
' Recorre todos los registros del Recordset
While Not rst.EOF
'Agrega el Item
Set Item = ListView1.ListItems.Add(, , rst.Fields(0))
i = 1
'Agrega los SubItem al ListView mediante la variable ITEM
For Campo = 1 To rst.Fields.Count - 1
'si el dato no es de tipo Null lo agrega
If Not IsNull(rst.Fields(Campo)) Then
Item.SubItems(i) = rst.Fields(Campo)
End If
i = i + 1
Next
'Siguiente registro
rst.MoveNext
Wend
Me.MousePointer = vbDefault
Text1.Text = rst.RecordCount
End Sub
Private Sub Form_Load()
Const parche As String = "C:\documents and settings\administrador\mis documentos\transporte.mdb"
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
With cnn
.ConnectionString = " Driver=Microsoft Visual Foxpro Driver; cnn=;SourceType=DBF; SourceDB=c:\Temp"
.Open
End With
rst.Open "SELECT * FROM SCFINVT.DBF ORDER BY COD_INVT", cnn, adOpenKeyset, adLockOptimistic
End Sub
Private Sub List1_Click()
Dim indice As String
Dim cadena As String
indice = List1.Text
indice = Left(indice, val)
Select Case indice
Case Is = "01"
Text2.Text = indice
Case Is = "02"
Text2.Text = indice
End Select
List2.Enabled = True
End Sub
Private Sub List2_Click()
Dim vas As String
Dim i As Integer
Dim ceros As String
Dim indice2 As String
ceros = "0"
indice2 = List2.Text
indice2 = Left(indice2, val)
Select Case indice2
Case Is = "01"
Text2.Text = Text2.Text & indice2
End Select
For i = 1 To 30
vas = ceros & i
List3.AddItem vas
Next i
List3.Enabled = True
End Sub
Private Sub List3_Click()
Dim j As Integer
Dim variable1 As String
Dim variable As String
Dim i As Integer
Dim indice3 As String
Dim cero1 As String
cero1 = "0"
indice3 = List3.Text
Text2.Text = Text2.Text & indice3
List4.Enabled = True
For i = 1 To 30
variable = cero1 & i
List4.AddItem variable
If variable = "09" Then
For j = 1 To 21
variable = variable + 1
List4.AddItem variable
Next j
Exit For
End If
Next i
End Sub
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
End Sub