Şimdi Ara

ÇOKLU KAYIT GÜNCELLEME NASIL YAPILMALIDIR

Bu Konudaki Kullanıcılar:
1 Misafir - 1 Masaüstü
5 sn
1
Cevap
0
Favori
697
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • arkadaşlar aşağıdaki güncelleme sayfamdaki listelenen verileri tek bir butona bastığımda hepsinin güncellenmesini yapmak istiyorum bunu nasıl yaparım yardımlarınızı bekliyorum.

    Teşekkürler

    --------------------------------------

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1254"%>
    <!--#include file="Connections/baglanti.asp" -->
    <%
    Dim MM_editAction
    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (Request.QueryString <> "") Then
    MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
    End If

    ' boolean to abort record edit
    Dim MM_abortEdit
    MM_abortEdit = false
    %>
    <%
    ' IIf implementation
    Function MM_IIf(condition, ifTrue, ifFalse)
    If condition = "" Then
    MM_IIf = ifFalse
    Else
    MM_IIf = ifTrue
    End If
    End Function
    %>
    <%
    If (CStr(Request("MM_update")) = "form1") Then
    If (Not MM_abortEdit) Then
    ' execute the update
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_baglanti_STRING
    MM_editCmd.CommandText = "UPDATE fiyat SET baslik = ?, fiyat = ? WHERE id = ?"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("baslik")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("fiyat")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 5, 1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"), null)) ' adDouble
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "guncelleme.asp"
    If (Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
    MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
    MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
    End If
    Response.Redirect(MM_editRedirectUrl)
    End If
    End If
    %>
    <%
    Dim fiyatlar1
    Dim fiyatlar1_cmd
    Dim fiyatlar1_numRows

    Set fiyatlar1_cmd = Server.CreateObject ("ADODB.Command")
    fiyatlar1_cmd.ActiveConnection = MM_baglanti_STRING
    fiyatlar1_cmd.CommandText = "SELECT * FROM fiyat"
    fiyatlar1_cmd.Prepared = true

    Set fiyatlar1 = fiyatlar1_cmd.Execute
    fiyatlar1_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = -1
    Repeat1__index = 0
    fiyatlar1_numRows = fiyatlar1_numRows + Repeat1__numRows
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
    <link href="css/yntcpnl.css" rel="stylesheet" type="text/css" />
    </head>

    <body>
    <form ACTION="<%=MM_editAction%>" METHOD="POST" id="form1" name="form1">
    <table width="600" border="1" cellspacing="0" cellpadding="0">
    <tr>
    <td height="30" align="center" valign="middle">BAŞLIKLAR</td>
    <td align="center" valign="middle">FİYATLAR</td>
    </tr>
    <%
    While ((Repeat1__numRows <> 0) AND (NOT fiyatlar1.EOF))
    %>
    <tr>
    <td height="25" align="center" valign="middle"><input name="baslik" type="text" id="baslik" value="<%=(fiyatlar1.Fields.Item("baslik").Value)%>" /></td>
    <td align="center" valign="middle"><input name="fiyat" type="text" id="fiyat" value="<%=(fiyatlar1.Fields.Item("fiyat").Value)%>" /></td>
    </tr>
    <tr>
    <td height="25" colspan="2" align="center" valign="middle"><input name="button" type="submit" id="button" value="GÜNCELLE" /></td>
    </tr>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    fiyatlar1.MoveNext()
    Wend
    %>
    </table>
    <input type="hidden" name="MM_update" value="form1" />
    <input type="hidden" name="MM_recordId" value="<%= fiyatlar1.Fields.Item("id").Value %>" />
    </form>
    </body>
    </html>
    <%
    fiyatlar1.Close()
    Set fiyatlar1 = Nothing
    %>







  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.