
13/06/2006, 13:55
|
| | Fecha de Ingreso: febrero-2006
Mensajes: 37
Antigüedad: 19 años, 2 meses Puntos: 0 | |
Crea un DSN de sql que se conecte a tu base
luego en tu form pon un DATA Control
Conectalo con :
ControlData.DatabaseName="PROVIDER=MSDASQL;dsn=Nom breDSN;uid=;pwd=;"
ControlData.Refresh
con eso tienes acceso a todas tus tablas , tengan el nombre que sea
Ademas de que si el servidor sql no esta activo te manda un error que puedes manejar facilmente.
Accede a tus datos asi :
ControlData.RecordSource = "select dato1,dato2,dato3 from 01-clientes where dato1 = 1 and dato2 = " & Chr$(39) & Text1 & Chr$(39)
ControlData.Refresh
Para seleccionar fechas haz arreglos con dos DTPICKER que el usuario selecciona :
sfecha = ""
Dfecha = Mid$(DTP1.Value, 7, 4) & "-" & Mid$(DTP1.Value, 4, 2) & "-" & Mid$(DTP1.Value, 1, 2) & " 00:00:00.000"
afecha = Mid$(DTP2.Value, 7, 4) & "-" & Mid$(DTP2.Value, 4, 2) & "-" & Mid$(DTP2.Value, 1, 2) & " 00:00:00.000"
sfecha = "Between {ts '" & Dfecha & "'} and {ts '" & afecha & "'}"
ControlData.RecordSource = "select dato1,dato2,dato3 from 00-servicios where dato1 = 1.00 and fechaentrega " & sfecha & " order by dato2, fechaentrega asc"
ControlData.Refresh
Espero te sirva la idea
__________________ Jerico |