Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Implementare una query

  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2007
    Messaggi
    2

    implementare una query

    Salve,
    Ho un problrmino con una query
    il codice è questo:
    <%@ LANGUAGE=VBScript %>
    <% option explicit %>
    <%
    const ForAppending = 8
    '-------------------------------------
    dim strCognome, strNome, strluognasc , strprovnasc
    strCognome = Request.Form("Cognome")
    strNome = Request.Form("Nome")
    strluognasc = Request.Form("luognasc")
    strprovnasc = Request.Form("provnasc")
    '-------------------------------------
    dim strdatanasc , strcomres , strprovres , strindres , strcap , strtelcasa
    dim strcell, straltrrecap, strgiorilav, stradulrilav
    strdatanasc = Request.Form("datanasc")
    strcomres = Request.Form("comres")
    strprovres =Request.Form("provres")
    strindres = Request.Form("indres")
    strcap = Request.Form("cap")
    strtelcasa = Request.Form("telcasa")
    strcell = Request.Form("cell")
    straltrrecap = Request.Form("altrrecap")
    strgiorilav = Request.Form("giorilav")
    stradulrilav = Request.Form("adulrilav")

    ' -------------------------------------
    dim strtitstud , strconpressist , strdi , strcondpen , strdiritciv , strfigprof, strditta
    strtitstud = Request("titstud")
    strconpressist = Request("conpressist")
    strdi = Request("di")
    strcondpen = Request.Form("condpen")
    strdiritciv = Request.Form("diritciv")
    strfigprof = Request.Form("figprof")
    strditta = Request("ditta")
    ' -------------------------------------

    If strCognome = "" Or strNome = "" Or strluognasc = "" Or strprovnasc= "" Or strdatanasc = "" Or strcomres = "" Or strprovres = "" Or strindres = "" Or strtitstud= "" Or strcondpen= "" Or strdiritciv= "" Or strfigprof= "" Or strditta= "" Then


    Response.Write "DATI INCOMPLETI. RICONTROLLARE I DATI INSERITI."

    Else


    Dim Stringa_Connessione,Query
    Stringa_Connessione="Provider=Microsoft.Jet.OLEDB. 4.0;Data Source=C:/inetpub/wwwroot/progettolabor/Labor.mdb;Persist Security Info=False;"

    DIM Rec
    Set Rec =server.CreateObject("adoDB.Connection")
    Rec.ConnectionString = Stringa_Connessione
    Rec.Open

    Query="Insert Into generale (Cognome , Nome , luognasc , provnasc , datanasc ,"
    Query=Query & "comres , provres , indres , cap , telcasa ,"
    Query=Query & "cell , altrrecap, giorilav , adulrilav , titstud , conpressist , di , "
    Query=Query & "condpen , diritciv , figprof , ditta) Values (" & "'" & Replace(strCognome,"'","''") & "','" & Replace(strNome,"'","''") & "',"
    Query=Query & "'" & Replace(strluognasc,"'","''") & "','" & Replace(strprovnasc,"'","''") & "','" & Replace(strdatanasc,"'","''") & "',"
    Query=Query & "'" & Replace(strcomres,"'","''") & "','" & Replace(strprovres,"'","''") & "','" & Replace(strindres,"'","''") & "','" & Replace(strcap,"'","''") & "','" & Replace(strtelcasa,"'","''") & "',"
    Query=Query & "'" & Replace(strcell,"'","''") & "','" & Replace(straltrrecap,"'","''") & "','" & Replace(strgiorilav,"'","''") & "','" & Replace(stradulrilav,"'","''") & "','" & Replace(strtitstud,"'","''") & "','" & Replace(strconpressist,"'","''")
    Query=Query & "','" & Replace(strdi,"'","''") & "',"
    Query=Query & "'" & Replace(strcondpen,"'","''") & "','" & Replace(strdiritciv,"'","''") & "','" & Replace(strfigprof,"'","''") & "','" & Replace(strditta,"'","''") & "')"
    Query=Replace(Query,"'ON'",1)

    'response.write Query & "
    "




    Dim RS
    Set RS = Server.Createobject("adoDB.Recordset")


    RS=Rec.Execute(Query)


    End If

    C'è chi mi può aiutare a da tre giorni che sbatto la testa al muro ho evidenziato le stinghe che ho aggiunto
    grazie

  2. #2
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,472

    Moderazione

    Le domande su ASP sono affrontate nell'area relativa.

    Ho spostato la discussione.
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

  3. #3

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.