[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.3

Insert on table After moving from one select box

Asked by RickyGtz in Active Server Pages (ASP), Web Languages/Standards, Adobe Dreamweaver

Tags: asp, multi-select lists

Hi, I have this form where a person can add players to a Given Team. Now I am confussed how to do the INSERT part. I am using dreamweaver and the default wizard doesnt seem to work . Currently I have and error :

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][SQL Native Client][SQL Server]The parameterized query '(@P1 text)INSERT INTO dbo.LeagueTeams (TeamName) VALUES (@P1)' expects the parameter '@P1', which was not supplied.

/Leagues/quickTeamAdd.asp, line 25
Many Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../Connections/sqlConn1.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
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
  If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd
 
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_sqlConn1_STRING
    MM_editCmd.CommandText = "INSERT INTO dbo.LeagueTeams (TeamName) VALUES (?)" 
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 50, Request.Form("_ctl0_ContentPlaceHolder_TeamName")) ' adLongVarChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
  End If
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("League") <> "") Then 
  Recordset1__MMColParam = Request.QueryString("League")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
 
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_sqlConn1_STRING
Recordset1_cmd.CommandText = "SELECT GolferID, LeagueID, FirstName, LastName FROM dbo.LeagueGolfers WHERE LeagueID = ?" 
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5, 1, -1, Recordset1__MMColParam) ' adDouble
 
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_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>Documento sin t&iacute;tulo</title>
<link href="../Template/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Estilo2 {font-size: 16px}
-->
</style>
<script type="text/javascript">
function list(){
	var optionList = document.getElementById('_ctl0_ContentPlaceHolder_TeamGolfers').options;
	var data = '';
	var len = optionList.length;  
	for(i=0; i<len; i++){
		data += optionList.item(i).value+',';
	}	
	document.getElementById('HiddenList').value = data			
}
 
 
 
 
 
function MoveOption(objSourceElement, objTargetElement){ 
 
	if(objSourceElement.value==''){
		alert('Please select an option to move');
		return false;	
	}
 
	var aryTempSourceOptions = new Array();        
	var x = 0;               
	//looping through source element to find selected options        
	for (var i = 0; i < objSourceElement.length; i++){            
		if (objSourceElement.options[i].selected){          	
			//need to move this option to target element                
			var intTargetLen = objTargetElement.length++;                
			objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;                
			objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;            
		}else{                
			//storing options that stay to recreate select element                
			var objTempValues = new Object();                
			objTempValues.text = objSourceElement.options[i].text;                
			objTempValues.value = objSourceElement.options[i].value;                
			aryTempSourceOptions[x] = objTempValues;               
			x++;           
		}       
	}              
	//resetting length of source        
	objSourceElement.length = aryTempSourceOptions.length;       
	//looping through temp array to recreate source select element      
	for (var i = 0; i < aryTempSourceOptions.length; i++){            
		objSourceElement.options[i].text = aryTempSourceOptions[i].text;           
		objSourceElement.options[i].value = aryTempSourceOptions[i].value;           
		objSourceElement.options[i].selected = false;        
	}    
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
</script>
</head>
 
<body>
<div id="content2">
  <p> </p>
  <p> </p>
  <p><br />
  </p>
<div id="Div1"><strong><strong></strong><strong></strong><strong></strong><strong></strong></strong>
        <div>
          <p><span class="Estilo2" id="_ctl0_ContentPlaceHolder_TeamTitle">Quick Team   Add</span></p>
          <p>&nbsp;</p>
          <form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
            <div id="content">
              <div id="Div2">
                <div>
                  <table id="_ctl0_ContentPlaceHolder_TeamTable" cellspacing="0" cellpadding="4" width="100%" border="0">
                    <tbody>
                      <tr>
                        <td colspan="3"></td>
                      </tr>
                      <tr>
                        <td colspan="3">Team Name<span id="_ctl0_ContentPlaceHolder_TeamNameValidator" title="Team Name is required." controltovalidate="_ctl0_ContentPlaceHolder_TeamName" errormessage="Team Name is required." initialvalue="" isvalid="true" display="Dynamic"> (Required)</span>
                            <input id="_ctl0_ContentPlaceHolder_TeamName" tabindex="5" maxlength="20" name="_ctl0:ContentPlaceHolder:TeamName" />
                          (Maximum of 20   characters)</td>
                      </tr>
                      <tr>
                        <td colspan="3"></td>
                      </tr>
                      <tr>
                        <td colspan="3">Add/Remove golfers for this team.</td>
                      </tr>
                      <tr>
                        <td width="25%" align="middle" style="width: 12%"><span id="_ctl0_ContentPlaceHolder_OnTheTeamLabel"><strong>On   the Team</strong></span> </td>
                        <td width="16%" align="middle" valign="center" style="width: 7%"></td>
                        <td align="middle" width="59%"><div align="left"><span id="_ctl0_ContentPlaceHolder_AvailableGolfersLabel"><strong>Available Golfers</strong></span> </div></td>
                      </tr>
                      <tr>
                        <td valign="top" style="width: 12%"><select id="_ctl0_ContentPlaceHolder_TeamGolfers" multiple="multiple" size="10" name="_ctl0:ContentPlaceHolder:TeamGolfers" style="width: 133px">
                          </select>
                        </td>
                        <td valign="center" align="middle" style="width: 7%"><input id="_ctl0_ContentPlaceHolder_AddToTeam" type="submit" value="&lt;-- Add to Team" name="_ctl0:ContentPlaceHolder:AddToTeam" onclick="MoveOption(document.getElementById('_ctl0_ContentPlaceHolder_AvailableGolfers'), document.getElementById('_ctl0_ContentPlaceHolder_TeamGolfers'))"/>
                            <br />
                            <br />
                            <input id="_ctl0_ContentPlaceHolder_RemoveFromTeam" type="submit" value="Remove from Team --&gt;" name="_ctl0:ContentPlaceHolder:RemoveFromTeam" onclick="MoveOption(document.getElementById('_ctl0_ContentPlaceHolder_TeamGolfers'), document.getElementById('_ctl0_ContentPlaceHolder_AvailableGolfers'))"/>
                        </td>
                        <td valign="top"><div align="left">
                            <select id="_ctl0_ContentPlaceHolder_AvailableGolfers" multiple="multiple" size="10" name="_ctl0:ContentPlaceHolder:AvailableGolfers">
                              <%
While (NOT Recordset1.EOF)
%>
                              <option value="<%=(Recordset1.Fields.Item("FirstName").Value)%><%=(Recordset1.Fields.Item("LastName").Value)%>"><%=(Recordset1.Fields.Item("FirstName").Value)%>,<%=(Recordset1.Fields.Item("LastName").Value)%></option>
                              <%
  Recordset1.MoveNext()
Wend
If (Recordset1.CursorType > 0) Then
  Recordset1.MoveFirst
Else
  Recordset1.Requery
End If
%>
                            </select>
                        </div></td>
                      </tr>
                      <tr>
                        <td colspan="3"><hr />
                        </td>
                      </tr>
                      <tr>
                        <td align="right" colspan="3"><div align="left">
                            <input name="Save" type="submit" id="_ctl0_ContentPlaceHolder_SaveAndClose" tabindex="50" onclick="list();" value="Save and Close" language="javascript" />
                            <input language="javascript" id="_ctl0_ContentPlaceHolder_Cancel" tabindex="55" type="submit" value="Close" name="Close" />
                            <input type="hidden" name="hiddenList" id="hiddenList" />
                        </div></td>
                      </tr>
                    </tbody>
                  </table>
                </div>
                <strong><strong></strong><strong></strong><strong></strong><strong></strong></strong></div>
            </div>
                    
            <input type="hidden" name="MM_insert" value="form1" />
          </form>
          <p>&nbsp;</p>
          <p> </p>
          <p> </p>
        </div>
<div></div>
      </div>
</div>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
[+][-]02/13/09 08:49 AM, ID: 23634519Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02/13/09 09:26 AM, ID: 23634982Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/13/09 10:42 PM, ID: 23639546Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/14/09 11:24 AM, ID: 23641920Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/14/09 12:06 PM, ID: 23642053Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/14/09 12:43 PM, ID: 23642168Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/14/09 01:12 PM, ID: 23642272Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/14/09 04:31 PM, ID: 23642917Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02/14/09 05:12 PM, ID: 23643020Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/14/09 09:49 PM, ID: 23643757Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/14/09 09:52 PM, ID: 23643762Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/14/09 10:44 PM, ID: 23643844Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/14/09 11:15 PM, ID: 23643893Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02/14/09 11:23 PM, ID: 23643907Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/15/09 01:07 AM, ID: 23644125Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/15/09 09:24 AM, ID: 23645634Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/15/09 10:03 AM, ID: 23645789Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/15/09 01:44 PM, ID: 23646580Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/09 12:51 AM, ID: 23647822Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/09 07:08 AM, ID: 23650357Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/16/09 07:19 AM, ID: 23650480Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/09 07:36 AM, ID: 23650674Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/16/09 07:44 AM, ID: 23650757Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/09 07:45 AM, ID: 23650765Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/09 08:12 AM, ID: 23651053Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/16/09 08:51 AM, ID: 23651422Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/09 09:09 AM, ID: 23651584Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/16/09 09:42 AM, ID: 23651937Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 12:30 AM, ID: 23657213Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/17/09 10:36 AM, ID: 23662684Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 10:39 AM, ID: 23662722Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/17/09 10:45 AM, ID: 23662787Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 10:48 AM, ID: 23662818Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/17/09 10:49 AM, ID: 23662830Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 10:51 AM, ID: 23662842Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 10:58 AM, ID: 23662907Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/17/09 01:17 PM, ID: 23664304Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 01:17 PM, ID: 23664313Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/18/09 12:55 AM, ID: 23668097Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/18/09 01:10 AM, ID: 23668209Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Active Server Pages (ASP), Web Languages/Standards, Adobe Dreamweaver
Tags: asp, multi-select lists
Sign Up Now!
Solution Provided By: Rouchie
Participating Experts: 3
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625