Tema: Ado Y Sql
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/06/2005, 16:46
gavafra
 
Fecha de Ingreso: abril-2005
Mensajes: 65
Antigüedad: 20 años
Puntos: 0
Ado Y Sql

Hola, los vuelvo a molestar ahora con los siguiente.

tengo 2 adodc en un form el adodc1 enlazado a la tabla de access "ESTADOS"
y el otro adodc enlazado a la tabla "MUNICIPIOS". Los dos me despliegan los datos que contienen las tablas , cada adodc esta ligado a un datacombo (hasta aqui va bien).

Ahora lo que necesito es que al elegir un ESTADO del datacombo1(adodc1) el
datacombo2 (adodc2) me despliegue los MUNICIPIOS de ese ESTADO.

Tengo un codigo asi :

Private Sub Text23_Change()

Set RS = New Recordset
Set SQL = New Command
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"
SQL.ActiveConnection = CONEXION

Adodc1.RecordSource = SQL.CommandText = "select MUNICIPIO from MUNICIPIOS where (ESTADO LIKE " & Text23.Text & ") ORDER BY ESTADO)"


Set RS = SQL.Execute



End Sub

Pero me marca un error en tiempo de ejecucion :

"Command text was not set for the command object"

Que estoy haciendo mal?