Ver Mensaje Individual
  #11 (permalink)  
Antiguo 02/08/2005, 02:14
oriopitufa
 
Fecha de Ingreso: julio-2005
Mensajes: 103
Antigüedad: 19 años, 7 meses
Puntos: 0
Esta es la nueva consulta:

...
Dim fetxa As Date
fetxa = New Date(2004, 7, 26)
Dim estado As String="Funcionando"
Dim st As String

st = "select Hora from Maquina where Fecha= ' " & fetxa & " ' and estado<> '" & estado & "' order by Hora asc"

comando = New OleDbCommand(st, objSQLConnect)
lee = comando.ExecuteReader()
lee.Read()
...
lee.Close()


El ERROR que aparece ahora es el siguiente:

No coinciden los tipos de datos en la expresión de criterios. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader()


Lo que ocurre, creo, es que el tipo de datos Date de Visual Basic .NET y el de Access no son compatibles, porque he probado a realizar una consulta que no necesita la fecha e iba bien!! Hay que definir algún tipo de capa de interoperabilidad para que funcione??

Gracias por tu ayuda