Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/06/2005, 12:25
Avatar de yiyocastro
yiyocastro
 
Fecha de Ingreso: octubre-2004
Ubicación: Maracaibo, Venezuela
Mensajes: 314
Antigüedad: 20 años, 7 meses
Puntos: 0
hola orharo es alirio desde venezuela.. mira te quería decir que te metieras con ASP.NEt es lo máximo, además ya dejé ASP, porque es muy viejo. Sinceramente te lo recomiendo. Puede ser que no te estás entendiendo muy bien con el formato de fechas. Devberías especificar más que tipo de BD es.. y te aconsejo que trates de que la instrucciones SQL no sean tan largas, trata de que nadamás se introduzcan datos y ya!. Intenta hacerlo todo con ASP..... Te voy a pasar un pequeño procedimiento que hice en ASP.NEt para mejor control con las SQL..

Public Function GetSQL(ByVal SQL As String, ByVal Param As String, ByVal Value As Object, ByVal Type As Types) As String
Select Case Type
Case Types.Cadena
Return Replace(SQL, Param, "'" + Value + "'")
Case Types.Fecha
Dim fechastring As String = "'" + Convert.ToDateTime(Value).Year.ToString + "-" + Convert.ToDateTime(Value).Month.ToString + "-" + Convert.ToDateTime(Value).Day.ToString + "'"
Return Replace(SQL, Param, fechastring)
Case Types.FechaHora
Dim fechahorastring As String = "'" + Convert.ToDateTime(Value).Year.ToString + "-" + Convert.ToDateTime(Value).Month.ToString + "-" + Convert.ToDateTime(Value).Day.ToString + " " + Convert.ToDateTime(Value).Hour.ToString + ":" + Convert.ToDateTime(Value).Minute.ToString + ":" + Convert.ToDateTime(Value).Second.ToString + "'"
Return Replace(SQL, Param, fechahorastring)
Case Types.Hora
Dim horastring As String = "'" + Convert.ToDateTime(Value).Hour.ToString + ":" + Convert.ToDateTime(Value).Minute.ToString + ":" + Convert.ToDateTime(Value).Second.ToString + "'"
Return Replace(SQL, Param, horastring)
Case Types.Numero
Return Replace(SQL, Param, Value)
End Select
End Function
************************************************** *************
Lo que hace es que introduces la Instruccion SQL, entonces buscas el parámetro y automaticamente lo reemplazas por el que quieras y automaticamente le diras al sistema de que manera lo harás Ej.

x="SELECT carro,moto FROM tipos WHERE carro=@carro and moto=@moto"
Entonces harás lo siguiente:

Puedes pasar la Variable X como ByRef o simplemente un Return

x=GetSQL(' LA CADENA COMPLETA ', ' nombre del elemento', 'valor', 'tipo')
x=GetSQL(x,"@carro","Chevrolet","Cadena") 'Automáticamente Reemplazará @carro por Chevrolet con las ' '.... Espero que te haya interesado.. Chao.
__________________
Nada es verdad, nada es mentira, todo esta en el cristal con que lo miras. :si: