Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

error 13 AYUDA!!!!!!!!!!!!!!!!!

Estas en el tema de error 13 AYUDA!!!!!!!!!!!!!!!!! en el foro de Visual Basic clásico en Foros del Web. Por que demonios me sale este error "No coinciden los tipos" ya me harte !!! eh aqui mi codigo: a ver si ustedes encuentran el ...
  #1 (permalink)  
Antiguo 10/06/2005, 09:16
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
error 13 AYUDA!!!!!!!!!!!!!!!!!

Por que demonios me sale este error "No coinciden los tipos" ya me harte !!!
eh aqui mi codigo: a ver si ustedes encuentran el error.

Private Sub DataCombo2_Click(Area As Integer)
Text23.Text = DataCombo2.Text
Dim SQL As String
Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Rs.Open ("select Municipio, Clave0, Clave1, Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'"), Conexion, adOpenStatic, adLockBatchOptimistic, adCmdText
Adodc1.RecordSource = ("select Municipio, Clave0 ,Clave1 , Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Set Text23.DataSource = Adodc2.Recordset.Fields("ESTADO")
Set Text24.DataSource = Adodc2.Recordset.Fields("CLAVE")
Set Text25.DataSource = Adodc2.Recordset.Fields("CLAVE1")
Set DataCombo1.RowSource = Adodc1
DataCombo1.ListField = "Municipio"
Adodc1.Refresh
Rs.Close
Set Rs = Nothing
End Sub

Hago notar que los campos en la tabla de access son de tipo texto.
  #2 (permalink)  
Antiguo 10/06/2005, 10:24
Avatar de GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 20 años, 4 meses
Puntos: 53
talvez sean los tipos de al base de datos, o bien tu datacombo esta generando te unos problemas, porque no lo lo estas seteando.. es decir..

echale un ojo a esta declaración de un data combo y me decis..

http://www.forosdelweb.com/showpost....8&postcount=69

nos vemos..
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila
  #3 (permalink)  
Antiguo 10/06/2005, 11:34
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
Gracias Geo, Ya Lo Intente Con Tu Codigo Pero Me Sigue Dando El Mismo Error

"no Coinciden Los Tipos"

Seguire Buscando Informacion O Alguna Alma Caritativa Que Pueda Ayudarme Jejeje :-d
  #4 (permalink)  
Antiguo 10/06/2005, 11:37
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
GRACIAS GEOAVILA, YA SETEE EL DATACOMBO PERO NI ASI, SIGUE DANDO EL MISMO ERROR "NO COINCIDEN LOS TIPOS"

ESTE ES MI CODIGO

Private Sub DataCombo2_Click(Area As Integer)
Text23.Text = DataCombo2.Text
Dim SQL As String
Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Rs.Open ("select Municipio,Estado,Clave0,Clave1,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'"), Conexion, adOpenStatic, adLockBatchOptimistic, adCmdText
Adodc2.RecordSource = ("select ESTADO,CLAVE,CLAVE1 from ESTADOS")
Adodc1.RecordSource = ("select Municipio,Estado,Clave0 ,Clave1 ,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Set Text23.DataSource = Adodc2.Recordset.Fields("ESTADO")
Set Text24.DataSource = Adodc2.Recordset.Fields("CLAVE")
Set Text25.DataSource = Adodc2.Recordset.Fields("CLAVE1")
Set DataCombo2.RowSource = Adodc2
Set DataCombo2.DataSource = Adodc2
DataCombo2.BoundColumn = "ESTADO"
DataCombo2.ListField = "ESTADO"
DataCombo1.ListField = "Municipio"
Adodc1.Refresh
Adodc2.Refresh
Rs.Close
Set Rs = Nothing
End Sub

EN FIN SEGUIRE BUSCANDO LA SOLUCION Y/O ESPERANDO LA AYUDA DIVINA
JEJEJE
  #5 (permalink)  
Antiguo 10/06/2005, 15:11
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Cita:
Iniciado por gavafra
GRACIAS GEOAVILA, YA SETEE EL DATACOMBO PERO NI ASI, SIGUE DANDO EL MISMO ERROR "NO COINCIDEN LOS TIPOS"

ESTE ES MI CODIGO

Private Sub DataCombo2_Click(Area As Integer)
Text23.Text = DataCombo2.Text
Dim SQL As String
Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Rs.Open ("select Municipio,Estado,Clave0,Clave1,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'"), Conexion, adOpenStatic, adLockBatchOptimistic, adCmdText
Adodc2.RecordSource = ("select ESTADO,CLAVE,CLAVE1 from ESTADOS")
Adodc1.RecordSource = ("select Municipio,Estado,Clave0 ,Clave1 ,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Set Text23.DataSource = Adodc2.Recordset.Fields("ESTADO")
Set Text24.DataSource = Adodc2.Recordset.Fields("CLAVE")
Set Text25.DataSource = Adodc2.Recordset.Fields("CLAVE1")
Set DataCombo2.RowSource = Adodc2
Set DataCombo2.DataSource = Adodc2
DataCombo2.BoundColumn = "ESTADO"
DataCombo2.ListField = "ESTADO"
DataCombo1.ListField = "Municipio"
Adodc1.Refresh
Adodc2.Refresh
Rs.Close
Set Rs = Nothing
End Sub

EN FIN SEGUIRE BUSCANDO LA SOLUCION Y/O ESPERANDO LA AYUDA DIVINA
JEJEJE
Dime en cual de las líneas te da el Error
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #6 (permalink)  
Antiguo 13/06/2005, 16:37
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
YA REVISE TODO DE NUEVO
LA CONSULTA ME DEVUELVE LOS MUNICIPIOS DE ACUERDO AL ESTADO QUE SELECCIONE, LOS TEXT ESTAN ENLAZADOS EN TIEMPO DE DISENO A CADA CAMPO DE CADA TABLA, LA CONEXION ESTA BIEN HECHA, NO ME DEVUELVE NINGUN ERROR PERO LOS TEXT NO ME MUESTRAN LA SELECCION QUE HAGO EN LOS DATACOMBO Y YO VOLVIENDOME CADA VEZ MAS TRAUMADO.

ESTE ES EL ULTIMO CODIGO QUE TENGO

Private Sub DataCombo2_Click(Area As Integer)

Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Adodc1.RecordSource = ("select Municipio,Clave0 ,Clave1 ,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Adodc1.Refresh

TODO FUNCIONA BIEN A EXCEPCION DE LAS CAJAS DE TEXTO

  #7 (permalink)  
Antiguo 13/06/2005, 16:47
Avatar de GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 20 años, 4 meses
Puntos: 53
sabes que borralas y volvelas a agregar talvez les agregaste alguna propiedad mala, eso se me ocurre asi al azar puesto que decis que da problemas al enlazarlos...


nos vemos..
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila
  #8 (permalink)  
Antiguo 13/06/2005, 17:33
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
GRACIAS GEOAVILA, YA BORRE LOS TEXTBOX Y LOS VOLVI A PONER CON SUS RESPECTIVOS DATASOURCE Y DATAFIELD Y SIGUE SIN PASAR NADA NO ME ACTUALIZA LOS DATOS DE ACUERDO A LA SELECCION HECHA.

  #9 (permalink)  
Antiguo 13/06/2005, 17:53
Avatar de GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 20 años, 4 meses
Puntos: 53
bueno nada mas que prueba y error me dia a la tarea aplicar tu codigo auna mini app. y me dicuenta a casi a simple vista que no habia puesto mucha atencion a la manera que declarbas la conexion con los textos.

para conectar un texto lo haces de esta manera

Código:
Set Text23.DataSource = Adodc2
Text23.DataField = "ESTADO"
nos vemos espero te sirva..
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila
  #10 (permalink)  
Antiguo 14/06/2005, 08:41
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
GRACIAS GEO , HE PUESTO COMO ME DICES PERO ME DA EL SIG ERROR Y ME SACA DE VB6. NO ME MARCA NINGUN ERROR EN EL CODIGO SOLO ME SACA DEL PROGRAMA.

Private Sub DataCombo2_Click(Area As Integer)

Dim SQL As String
Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Adodc1.RecordSource = ("select Municipio,Clave0 ,Clave1 ,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Adodc1.Refresh
Set Text23.DataSource = Adodc2
Text23.DataField = "ESTADO"
Set Text24.DataSource = Adodc2
Text24.DataField = "CLAVE"
Set Text25.DataSource = Adodc2
Text25.DataField = "CLAVE1"

End Sub

VB6.EXE HAS GENERATED ERRORS AND WILL BE CLOSED BY WINDOWS
YOU WILL NEED TO RESTART THE PROGRAM

AN ERROR LOG IS BEEN CREATED

ALGUN TIP???
  #11 (permalink)  
Antiguo 14/06/2005, 08:51
 
Fecha de Ingreso: abril-2005
Mensajes: 137
Antigüedad: 19 años
Puntos: 0
Cita:
Iniciado por gavafra
GRACIAS GEOAVILA, YA SETEE EL DATACOMBO PERO NI ASI, SIGUE DANDO EL MISMO ERROR "NO COINCIDEN LOS TIPOS"

ESTE ES MI CODIGO

Private Sub DataCombo2_Click(Area As Integer)
Text23.Text = DataCombo2.Text
Dim SQL As String
Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Rs.Open ("select Municipio,Estado,Clave0,Clave1,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'"), Conexion, adOpenStatic, adLockBatchOptimistic, adCmdText
Adodc2.RecordSource = ("select ESTADO,CLAVE,CLAVE1 from ESTADOS")
Adodc1.RecordSource = ("select Municipio,Estado,Clave0 ,Clave1 ,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Set Text23.DataSource = Adodc2.Recordset.Fields("ESTADO")
Set Text24.DataSource = Adodc2.Recordset.Fields("CLAVE")
Set Text25.DataSource = Adodc2.Recordset.Fields("CLAVE1")
Set DataCombo2.RowSource = Adodc2
Set DataCombo2.DataSource = Adodc2
DataCombo2.BoundColumn = "ESTADO"
DataCombo2.ListField = "ESTADO"
DataCombo1.ListField = "Municipio"
Adodc1.Refresh
Adodc2.Refresh
Rs.Close
Set Rs = Nothing
End Sub

EN FIN SEGUIRE BUSCANDO LA SOLUCION Y/O ESPERANDO LA AYUDA DIVINA
JEJEJE

Set Text23.DataSource = Adodc2
Set Text23.DataField = "ESTADO"
Set Text24.DataSource = Adodc2
Set Text24.DataField = "CLAVE"
Set Text25.DataSource = Adodc2
Set Text25.DataField = "CLAVE1"

podria funcionar no?
  #12 (permalink)  
Antiguo 14/06/2005, 08:58
 
Fecha de Ingreso: abril-2005
Mensajes: 137
Antigüedad: 19 años
Puntos: 0
Cita:
Iniciado por gavafra
GRACIAS GEO , HE PUESTO COMO ME DICES PERO ME DA EL SIG ERROR Y ME SACA DE VB6. NO ME MARCA NINGUN ERROR EN EL CODIGO SOLO ME SACA DEL PROGRAMA.

Private Sub DataCombo2_Click(Area As Integer)

Dim SQL As String
Dim Rs As Recordset
Dim Conexion As Connection
Set Rs = New Recordset
Set Conexion = New Connection

Conexion.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Japan Airlines\My Documents\ESTADOS_Y_MUNICIPIOS.mdb;Persist Security Info=False"
Rs.ActiveConnection = Conexion
Adodc1.RecordSource = ("select Municipio,Clave0 ,Clave1 ,Clave2 from MUNICIPIOS where Estado like '" & DataCombo2.Text & "'")
Adodc1.Refresh
Set Text23.DataSource = Adodc2
Text23.DataField = "ESTADO"
Set Text24.DataSource = Adodc2
Text24.DataField = "CLAVE"
Set Text25.DataSource = Adodc2
Text25.DataField = "CLAVE1"

End Sub

VB6.EXE HAS GENERATED ERRORS AND WILL BE CLOSED BY WINDOWS
YOU WILL NEED TO RESTART THE PROGRAM

AN ERROR LOG IS BEEN CREATED

ALGUN TIP???

ups creo que no vi este mensaje
aca no estas asignando ningún RecordSource al Adodc2 y tampoco estas haciendo un refresh, de todas formsa fijate que es lo que dice el log de error que hizo VB. quisaz ahi te de una pista de loq ue esta pasando no?
  #13 (permalink)  
Antiguo 14/06/2005, 09:23
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 19 años
Puntos: 0
GRACIAS MARCOCHO, ME SIGUE SACANDO DEL PROGRAMA Y ME MARCA EL ERROR SIG:

VB6.EXE HAS GENERATED ERRORS AND WILL BE CLOSED BY WINDOWS
YOU WILL NEED TO RESTART THE PROGRAM

AN ERROR LOG IS BEEN CREATED

ESTOY A PUNTO DE MANDAR AL DIABLO TODO !!!
  #14 (permalink)  
Antiguo 14/06/2005, 14:56
 
Fecha de Ingreso: abril-2005
Mensajes: 137
Antigüedad: 19 años
Puntos: 0
Cita:
Iniciado por gavafra
GRACIAS MARCOCHO, ME SIGUE SACANDO DEL PROGRAMA Y ME MARCA EL ERROR SIG:

VB6.EXE HAS GENERATED ERRORS AND WILL BE CLOSED BY WINDOWS
YOU WILL NEED TO RESTART THE PROGRAM

AN ERROR LOG IS BEEN CREATED

ESTOY A PUNTO DE MANDAR AL DIABLO TODO !!!
por qué no intentas una de estas dos cosas...
crea un nuevo proyecto y copia todo tu codigo y componenetes en el nuevo proyecto
si no funciona trata instalando de nuevo todo el Visual Basic o el Visual Studio
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:03.