Visualizzazione dei risultati da 1 a 10 su 10
  1. #1

    problema data con anno 2010

    Salve
    ho bisogno di un piccolo aiuto.
    Ho un database dove ho una gestione di ricariche online solo che all arrivare dell anno nuovo al posto di inserirmi 2010 mi riporta al 2000
    di seguito posto la pagina dove conta gli anni..spero che qualcuno di voi che è più capace possa aiutarmi a risolvere il problema .

    grazie mille


    <%
    Session.LCID = 1040

    Dim conn, strDBPath, StrProvider
    set conn=server.createobject("ADODB.Connection")
    strDBPath = "/public/gestionale_server_db.mdb"
    StrProvider="Provider=Microsoft.Jet.OLEDB.4.0; Persist Security Info=False; Jet OLEDBatabase Password=administrator; Data Source=" & Server.MapPath(strDBPath)
    'StrProvider="Provider=Microsoft.Jet.OLEDB.4.0; Persist Security Info=False; Data Source=" & Server.MapPath(strDBPath)
    conn.open strProvider

    Sub EndConn()
    Conn.Close
    Set Conn = Nothing
    End Sub

    Sub EndRS(RS)
    RS.Close
    Set RS = Nothing
    End Sub

    Sub EndAll(RS)
    RS.Close
    Conn.Close
    Set RS = Nothing
    Set Conn = Nothing
    End Sub

    Function Data_Testo_Esteso(sData)
    If Not isDate(sData) = true Then sData = Now()
    sGiorno = Day(sData)
    sMese = Month(sData)
    sAnno = Year(sData)
    sOra = Hour(sData)
    sMinuti = Minute(sData)
    If Len(sAnno) = 4 then sAnno = Mid(sAnno, 3, 4)
    If Len(sGiorno) = 1 Then sGiorno = "0" & sGiorno
    If Len(sMese) = 1 Then sMese = "0" & sMese
    If Len(sOra) = 1 Then sOra = "0" & sOra
    If Len(sMinuti) = 1 Then sMinuti = "0" & sMinuti
    Data_Testo_Esteso = Clng(sAnno & sMese & sGiorno & sOra & sMinuti)
    End Function

    'le date devono venire dal database!!!
    Function ParteData(sTesto, sParte)
    If Len(sTesto) = 9 then s = 0 else s = 1
    Select Case UCase(sParte)
    Case "G": ParteData = (Mid(sTesto, 4+s, 2))
    Case "M": ParteData = (Mid(sTesto, 2+s, 2))
    Case "C": ParteData = (Mid(sTesto, 1+s, 1+s))
    If Len(ParteData) = 1 Then ParteData = "0" & ParteData
    Case "A": ParteData = (Mid(sTesto, 1+s, 1+s))
    If Len(ParteData) = 1 Then ParteData = "200" & ParteData else ParteData = "20" & ParteData
    Case "H": ParteData = CInt(Mid(sTesto, 6+s, 2))
    Case "N": ParteData = (Mid(sTesto, 8+s, 2))
    End Select
    End Function

    Function selectAnni(annocorrente)
    if annocorrente&""="" then annocorrente=Cint(YEAR(now()))

    'Da realizzare <OPTION value="04" >2004</OPTION>
    selectAnni=""
    for i=2004 TO annocorrente+7
    icut = Mid(i,3,len(i&""))
    selectAnni= selectAnni&"<OPTION value="""&icut&""">"&i&"</OPTION>"&vbcrlf
    next
    End Function
    %>
    _____________________
    www.teknowebstore.com
    Il tuo problema la nostra soluzione informatica!

  2. #2
    dov'è che te lo fa? nella Select degli anni? o dove?

  3. #3
    me lo fa quando inserisco l operazione
    ovvero se io inserisco un operazione lui deve darmi

    02/01/2010 invece mi porta a 02/01/2000
    _____________________
    www.teknowebstore.com
    Il tuo problema la nostra soluzione informatica!

  4. #4
    ok. nella pagina che hai postato ci sono 3 sub e 3 function. quale di queste invochi e ti dà l'errore?

  5. #5
    credo che provenda da questa parte qui

    'le date devono venire dal database!!!
    Function ParteData(sTesto, sParte)
    If Len(sTesto) = 9 then s = 0 else s = 1
    Select Case UCase(sParte)
    Case "G": ParteData = (Mid(sTesto, 4+s, 2))
    Case "M": ParteData = (Mid(sTesto, 2+s, 2))
    Case "C": ParteData = (Mid(sTesto, 1+s, 1+s))
    If Len(ParteData) = 1 Then ParteData = "0" & ParteData
    Case "A": ParteData = (Mid(sTesto, 1+s, 1+s))
    If Len(ParteData) = 1 Then ParteData = "200" & ParteData else ParteData = "20" & ParteData
    Case "H": ParteData = CInt(Mid(sTesto, 6+s, 2))
    Case "N": ParteData = (Mid(sTesto, 8+s, 2))
    End Select
    End Function
    _____________________
    www.teknowebstore.com
    Il tuo problema la nostra soluzione informatica!

  6. #6
    fa' vedere come la richiami

  7. #7
    per farti capire meglio ora ti do direttamente l indirizzo perchè non so come spiegarla meglio questa cosa

    http://teknowebstore.com/center_recharge/

    come user e password scrivo demo1

    una volta entrato clicca su ricarica

    e inserisci questi cambi obbligatori

    intestatario utenta
    numero
    conferma numero
    e poi clicca su invia

    una volta fatto ciò ti riporta alla prima pagina e in basso ti va vedere l operazione dove ti porta l anno 2000 .. .essendo una cosa che ho fatto molto tempo fa non mi ricordo molte cose sulla programmazione ..

    grazie per l aiuto che mi stai dando
    _____________________
    www.teknowebstore.com
    Il tuo problema la nostra soluzione informatica!

  8. #8
    mi serve il codice. da qualche parte la richiamerai la funzione, no?

  9. #9
    credo sia questo


    <%
    Function ValidateDate(FieldName , lngDay, lngMonth, lngYear)
    On Error Resume Next
    If StrComp(FieldName, "" , 1) <> 0 Then FieldName = " del campo " & FieldName
    If lngYear < 1 OR lngYear > 20 Then
    ValidateDate = "L'anno" & FieldName & " non è valido"
    elseIf lngDay > 31 OR lngDay < 1 Then
    ValidateDate = "Il giorno" & FieldName & " deve essere compreso tra 1 e 31!"
    elseif lngMonth > 12 OR lngMonth < 1 Then
    ValidateDate = "Il mese" & FieldName & " deve essere compreso tra 1 e 12!"
    elseif lngDay > 30 and _
    ( lngMonth = 4 or lngMonth = 6 or lngMonth = 9 or lngMonth = 11) Then
    ValidateDate = "Il mese" & FieldName & " non ha il 31-esimo giorno!"
    elseif lngDay > 29 and _
    ( lngYear mod 4 ) = 0 and _
    lngMonth = 2 then
    ValidateDate = "L'anno" & FieldName & " ha 29 giorni in febbraio!"
    elseif lngDay > 28 and _
    Not ( lngYear mod 4 ) = 0 and _
    lngMonth = 2 then
    ValidateDate = "Il mese (Febbraio)" & FieldName & " ha solo 28 giorni!"
    Else
    ValidateDate = ""
    End If
    If Err.number <> 0 Then
    ValidateDate = "Errore interno durante la validazione della data.
    Controllare la data inserita."
    Exit Function
    End If
    End Function

    Function ValidateORA(txtORA, ora, min)
    On Error Resume Next
    If StrComp(txtORA, "" , 1) <> 0 Then txtORA = " del campo " & txtORA
    If (Cbyte(Ora) > 24 OR Cbyte(Ora) < 0) Then
    ValidateORA = "<font color=#FF0000>L'ora</font>" & txtORA & " non è valida"
    elseIf (min<>"") Then
    If (Cbyte(min)>59 OR Cbyte(min)<0) then
    ValidateORA = "<font color=#FF0000>Minuti</font>" & txtORA & " non validi"
    end if
    end if
    If Err.number <> 0 Then
    ValidateORA = "Errore interno durante la validazione dell'orario.
    Controllare l'ora inserita."
    Exit Function
    End If
    End Function

    Sub scambia(a,b)
    dim c
    c = a
    a = b
    b = c
    End Sub

    Function decimali(v)
    strNUMlocale=Replace(v&"", "." , ",")
    intLUNGHEZZA = len(strNUMlocale)
    pos = InStr(strNUMlocale,",")
    action = (intLUNGHEZZA-pos)
    SELECT CASE action
    CASE intLUNGHEZZA
    decimali=strNUMlocale + ",00"
    CASE 0
    decimali=strNUMlocale + "00"
    CASE 1
    decimali=strNUMlocale + "0"
    CASE Else
    decimali=strNUMlocale
    END SELECT
    End Function
    %>
    _____________________
    www.teknowebstore.com
    Il tuo problema la nostra soluzione informatica!

  10. #10
    tekno, così non andiamo da nessuna parte. credo, forse, mi pare... stai per caso cercando di sistemare un applicativo fatto da altri?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.