Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/09/2004, 14:39
Avatar de jocks
jocks
 
Fecha de Ingreso: marzo-2004
Mensajes: 174
Antigüedad: 20 años, 2 meses
Puntos: 0
Me parece q el problema esta en las variables DATE

Estuve viendo mi codigo y creo q el problema esta cuando en la parte de VALUES del INSERT empiezo a tomar valor por valor y cuando tomos las variables tipo DATE creo q hay errores , aqui esta :

Public Sub insertar_newCustomer(eEnv As Long, nNam As String, sStr As String, cCit As String, pPho As Long, _
cCel As Long, dDat As Date, dDeliv As Date, mMak As String, mMod As String, sSer As String, sSR As String, _
sEst As Currency, sPa As Date, sWarr As Integer, sBac As Date, sChar As Currency)

Set mCOMM = New ADODB.Command
With mCOMM
.ActiveConnection = mCon
.CommandType = adCmdText
.CommandText = "INSERT INTO CUSTOMER (Envoice,Name,Street,City,Phone,Cell,Date,Delivery ,Make,Model,Serial,ServiceR,Estimate,Paid,Warranty ,Back,Charge)" & _
" VALUES (" & eEnv & ",'" & nNam & "','" & sStr & "','" & cCit & "'," & pPho & "," & cCel & ",'" & Format(CStr(dDat), "dd/mm/yyyy") & "','" & Format(CStr(dDeliv), "dd/mm/yyyy") & "','" & mMak & "','" & mMod & "','" & sSer & "','" & sSR & "'," & sEst & ",'" & Format(CStr(sPa), "dd/mm/yyyy") & "'," & sWarr & ",'" & Format(CStr(sBac), "dd/mm/yyyy") & "'," & sChar & ")"
.Execute
End With
'"insert into.... values(....#" & format(cstr(mdate), "dd/mm/yyyy") &"# ....)"
End Sub

Es esta la forma correcta d atrapar una variable tipo DATE : sEst & ",'" & Format(CStr(sPa), "dd/mm/yyyy") & "'," & sWarr ???



__________________
JUST DO IT!!!
nunk hay una segunda oportunidad para una primera buena impresion...