Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/07/2010, 14:39
Avatar de -rommel_
-rommel_
 
Fecha de Ingreso: junio-2008
Ubicación: Lima
Mensajes: 360
Antigüedad: 15 años, 11 meses
Puntos: 1
Respuesta: DTpicker, mysql y vb6 Obtener registros entre dos Fechas

Código vb:
Ver original
  1. Dim qwerty As Connection
  2.   Set qwerty = New Connection
  3.   qwerty.CursorLocation = adUseClient
  4.   qwerty.Open "PROVIDER=MSDASQL;dsn=biblioteca;uid=root;pwd=admin;database=biblioteca;"
  5.  
  6.   FechaInicial = convFecha(DTFechaInicial.Value)
  7.   FechaFinal = convFecha(DTFechaFinal.Value)
  8.  
  9.   strConsulta = "Select libro.Titulo as [Titulo de Libro], Prestamo.Fecha_Prestamo as [Fecha] from Libro, Prestamo where Prestamo.Id_Libro = Libro.Id_Libro and Prestamo-Fecha_Prestamo between " & FechaInicial & " and " & FechaFinal
  10.  
  11.   ' Crea un textBox para que guardes la consulta y visualices si te muestra correctamente la  
  12.  ' Consulta
  13.  me.TextBox1.text = strConsulta
  14.  
  15.   Set rcdSet4 = New Recordset
  16.   rcdSet4.Open strConsulta
  17.    
  18.   Set grdDataGrid4.DataSource = rcdSet4
  19.   mbDataChanged = False
intenta esto