ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 2nd, 2009, 04:59 AM
lstephan lstephan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 3 lstephan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 19 sec
Reputation Power: 0
VBScript - Database - Recordset - Empty asp update form field SQL ASP

Hello,

I ve got a problem on an update form (asp/SLQ SERVER).

I made it from dreamweaver and when i see this form on IE Browser, one update field stays empty but filled in database....
and i can display it before the form


If someone can help me?

Thanks

Reply With Quote
  #2  
Old November 2nd, 2009, 05:16 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,259 micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 4 Days 2 m 48 sec
Reputation Power: 2179
Hi and welcome to the forums.

Please post the relevant code.
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #3  
Old November 2nd, 2009, 07:12 AM
lstephan lstephan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 3 lstephan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 19 sec
Reputation Power: 0
The code asp page

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/sqlfncas.asp" -->
<!--#include file="../ScriptLibrary/dmxValidator.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
%>
<%
' Universal Form Validator ASP 1.5.1
dim dmxval1, DMX_validateAction
set dmxval1 = new dmxValidator
dmxval1.ScriptFolder = "../ScriptLibrary"
dmxval1.CSValidateOnChange = true
dmxval1.CSValidateOnSubmit = true
dmxval1.ReportType = 4
dmxval1.ErrorFont =  "Arial"
dmxval1.ErrorFontSize = 12
dmxval1.ErrorColor = "#ffffff"
dmxval1.ErrorBold = true
dmxval1.ErrorItalic = false
dmxval1.ErrorImage = ""
dmxval1.ErrorFixed = "Custom"
dmxval1.ErrorPadding = 4
dmxval1.BorderColor = "#FF0000"
dmxval1.CssErrorFile = "validatorError1"
dmxval1.ErrorPreset = "error_five.txt"
dmxval1.TooltipPosition = "top"
dmxval1.CssHintFile = "validatorHint1"
dmxval1.HintPreset = "blue.txt"
dmxval1.HintTooltipPosition = "top"
dmxval1.HintBorderColor = "#0099ff"
dmxval1.HintBorderStyle = "solid"
dmxval1.HintBgColor = "#003399"
dmxval1.HintTextColor = "#ffffff"
dmxval1.HintTextFont = "Arial"
dmxval1.HintTextSize = 12
dmxval1.HintTextBold = false
dmxval1.HintTextItalic = false
dmxval1.HintBoxWidth = 200
dmxval1.HintImage = ""
dmxval1.HintFixed = "Custom"
dmxval1.HintPadding = 4
dmxval1.UseCustomFocusClass = "fixed"
dmxval1.FocusBorderStyle = "solid"
dmxval1.FocusBorderSize = 1
dmxval1.FocusBorderColor = "#C3D9FF"
dmxval1.FocusBgColor = "#FFFFFF"
dmxval1.FocusTextColor = "#000000"
dmxval1.UseCustomValidClass = "fixed"
dmxval1.ValidBorderStyle = "solid"
dmxval1.ValidBorderSize = 1
dmxval1.ValidBorderColor = "#00FF00"
dmxval1.ValidBgColor = "#FFFFFF"
dmxval1.ValidTextColor = "#000000"
dmxval1.UseCustomInvalidClass = "fixed"
dmxval1.InvalidBorderStyle = "solid"
dmxval1.InvalidBorderSize = 2
dmxval1.InvalidBorderColor = "#FF0000"
dmxval1.InvalidBgColor = "#FFFFFF"
dmxval1.InvalidTextColor = "#000000"
dmxval1.AddRule "form1", "codepost", "numbercond", ",,", "true", "", "", "", ""
dmxval1.AddRule "form1", "emailresp", "emailcond", ",,", "true", "", "", "", ""
dmxval1.AddHint "form1", "nomusage", "Non usuel de l'établissement "
dmxval1.AddMask "form1", "codepost", "custom", "99999"
dmxval1.AddMask "form1", "telresp", "phone", "France"
dmxval1.Validate
%>
<%
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_sqlfncas_STRING
    MM_editCmd.CommandText = "UPDATE dbo.Etablissements SET nomusetablist = ?, adresseetablist = ?, codepostaletablis = ?, villeetablist = ?, nomresponsableenquete = ?, telrespenquete = ?, emailrespetablisst = ?, rce = ? WHERE idetablist = ?" 
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("nomusage")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 203, 1, 1073741823, Request.Form("adresse")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 5, 1, -1, MM_IIF(Request.Form("codepost"), Request.Form("codepost"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("ville")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 203, 1, 1073741823, Request.Form("nomresp")) ' adLongVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 50, Request.Form("telresp")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1, 50, Request.Form("emailresp")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 5, 1, -1, MM_IIF(Request.Form("rce"), 1, 0)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 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 = "majetab2.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 etab1__MMColParam
etab1__MMColParam = "1"
If (Session("idetablist") <> "") Then 
  etab1__MMColParam = Session("idetablist")
End If
%>
<%
Dim etab1
Dim etab1_cmd
Dim etab1_numRows

Set etab1_cmd = Server.CreateObject ("ADODB.Command")
etab1_cmd.ActiveConnection = MM_sqlfncas_STRING
etab1_cmd.CommandText = "SELECT idetablist, codepostaletablis, rce, nometablist, nomusetablist, emailrespetablisst, telrespenquete,villeetablist,adresseetablist, nomresponsableenquete FROM dbo.Etablissements WHERE idetablist = ?" 
etab1_cmd.Prepared = true
etab1_cmd.Parameters.Append etab1_cmd.CreateParameter("param1", 5, 1, -1, etab1__MMColParam) ' adDouble

Set etab1 = etab1_cmd.Execute
etab1_numRows = 0
%>
<!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=utf-8" />
<title>Document sans titre</title>
<link rel="stylesheet" href="../Styles/dmxValidator/validatorHint1.css" type="text/css" />
<link rel="stylesheet" href="../Styles/dmxValidator/validatorError1.css" type="text/css" />
<script src="../ScriptLibrary/jsvat.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery-latest.pack.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.inputHintBox.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.validate.min.js" type="text/javascript"></script>
<script src="../ScriptLibrary/dmx.jquery.validate.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.tooltip.min.js" type="text/javascript"></script>
<script src="../ScriptLibrary/jquery.hoverIntent.min.js" type="text/javascript"></script>
<% 
' dmxValidatorJSStart
dmxval1.GenerateJavascriptAndCss
' dmxValidatorJSEnd
%>
</head>

<body>
ADDRESS RETREIVE FROM SQL DATABASE<%=(etab1.Fields.Item("adresseetablist").Value)%><br />
AND EMPTY IN UPDATE FIELD ( default value address normaly)<br />
<br />
<br />
<%=(etab1.Fields.Item("villeetablist").Value)%><br />
<input name="hiddenField" type="hidden" id="hiddenField" value="<%=(etab1.Fields.Item("emailrespetablisst").Value)%>" />
<%=(etab1.Fields.Item("rce").Value)%><br />
<br />
<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
  <table width="100%" border="0">
    <tr>
      <td width="62%">Nom d'usage :</td>
      <td width="38%"><label>
        <input name="nomusage" type="text" id="nomusage" value="<%= dmxSetValue((etab1.Fields.Item("nomusetablist").Value), FormRequest("nomusage")) %>" />
      </label></td>
    </tr>
    <tr>
      <td class="dmxTooltipHint">Adresse postale :</td>
      <td><label>
        <textarea name="adresse" id="adresse"><%=(etab1.Fields.Item("adresseetablist").Value)%></textarea>
        HERE NO VALUE!
      </label></td>
    </tr>
    <tr>
      <td>Code postal :</td>
      <td><label>
        <input name="codepost" type="text" id="codepost" value="<%= dmxSetValue((etab1.Fields.Item("codepostaletablis").Value), FormRequest("codepost")) %>" />
      </label>
      <% dmxval1.GenerateError "form1","codepost","numbercond",",," %></td>
    </tr>
    <tr>
      <td>Ville :</td>
      <td><label>
        <input name="ville" type="text" id="ville" value="<%= dmxSetValue((etab1.Fields.Item("villeetablist").Value), FormRequest("ville")) %>" />
      </label></td>
    </tr>
    <tr>
      <td>Nom :</td>
      <td><label>
        <input name="nomresp" type="text" id="nomresp" value="<%= dmxSetValue((etab1.Fields.Item("nomresponsableenquete").Value), FormRequest("nomresp")) %>" />
      </label></td>
    </tr>
    <tr>
      <td>Téléphone :</td>
      <td><label>
        <input name="telresp" type="text" id="telresp" value="<%= dmxSetValue((etab1.Fields.Item("telrespenquete").Value), FormRequest("telresp")) %>" />
      </label></td>
    </tr>
    <tr>
      <td>Courriel :</td>
      <td><label>
        <input name="emailresp" type="text" id="emailresp" value="<%= dmxSetValue((etab1.Fields.Item("emailrespetablisst").Value), FormRequest("emailresp")) %>" size="40" />
      </label>
      <% dmxval1.GenerateError "form1","emailresp","emailcond",",," %></td>
    </tr>
    <tr>
      <td>Votre établissement est-il passé aux RCE ?</td>
      <td><label>
        <input <%If (CStr((etab1.Fields.Item("rce").Value)) = CStr("Vrai")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="rce" id="rce" />
        <input type="submit" name="button" id="button" value="Passer à l'étape suivante" />
      </label></td>
    </tr>
  </table>
  <input type="hidden" name="MM_update" value="form1" />
  <input type="hidden" name="MM_recordId" value="<%= etab1.Fields.Item("idetablist").Value %>" />
</form>
</body>
</html>
<%
etab1.Close()
Set etab1 = Nothing
%>

Reply With Quote
  #4  
Old November 2nd, 2009, 08:02 AM
lstephan lstephan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 3 lstephan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 19 sec
Reputation Power: 0
Solution found but with no real explication lol

Hi i added those line to my asp code when creating recordset:


etab1_cmd.ActiveConnection.CursorLocation = 3

And it's work. But would like to know why...

Thanks

Reply With Quote
  #5  
Old November 2nd, 2009, 09:46 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549753 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
Quote:
Originally Posted by lstephan
Hi i added those line to my asp code when creating recordset:


etab1_cmd.ActiveConnection.CursorLocation = 3

And it's work. But would like to know why...

Thanks
what is the field that stayed empty?
are you sure it's not browser cache issue?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > VBScript - Database - Recordset - Empty asp update form field SQL ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek