Selecting from Combobox with only one item

I'm populating Comboboxes based on selections from other
comboboxes. I pick up the selection with the 'change' trigger,
however when you select the top item or if there is only one item,
the change route doesn't work. So I tried to use the 'click' and
even the 'close' triggers instead, but they give me an errors when
I try to access the companion ArrayCollections which hold the IDs
for the items in the list (as commented in the code). Any ideas how
to get this to update with just one selection?
<!-- The first three comboboxes populate the next one in
the list in a 'drilldown' approach -->
<mx:ComboBox minWidth="130" maxWidth="130" id="selectSys"
dataProvider="{sysOps.lastResult.system.data}"
change="fillComboBox(selectSys, selectSub, 'subsystem',
subOps, sysIDs, 1)" rowCount="10" />
<mx:ComboBox minWidth="130" maxWidth="130" id="selectSub"
dataProvider="{subOps.lastResult.system.data}"
change="fillComboBox(selectSub, selectDev, 'devices',
devOps, subIDs, 2)"/>
<mx:HTTPService id="sysOps" useProxy="false" method="GET"
result="sysIDs = sysOps.lastResult.system.id as
ArrayCollection;"
fault="mx.core.Application.application.handleFault(event);"
url="
http://localhost:8080/TomCustodes/rocket"/>
<mx:HTTPService id="subOps" useProxy="false" method="GET"
result="subIDs = subOps.lastResult.system.id as
ArrayCollection;"
fault="mx.core.Application.application.handleFault(event);"
url="
http://localhost:8080/TomCustodes/rocket"/>
// fill destination combobox based on selection from src
combobox
public function fillComboBox(src:ComboBox, dest:ComboBox,
type:String,
serv:HTTPService, idArray:ArrayCollection, element:int) :
void {
// choose ID from the associated ID array with the same
selecetedIndex
// error occurs as the idArray ArrayCollection comes up as
null
var selectedID:String = idArray.getItemAt(src.selectedIndex)
as String;
var params:Object = {};
params[type] = type;
var arg:String = "arg";
var argList:Array = new Array();
if (element > 1) {
var ind:int = selectSys.selectedIndex;
var sysName:String = sysIDs.getItemAt(ind) as String;
argList.push(sysName);
if (element > 2) {
ind = selectSub.selectedIndex;
var subName:String = subIDs.getItemAt(ind) as String;
argList.push(subName);
argList.push(selectedID);
params[arg] = argList;
serv.send(params);
Thanks!

I think the way I would go about that is having a result
function for the HTTPServices and set your array collections how
you are. Then after they are set I would check to see if the length
== 1 and if it does then recall your fillComboBox method for the
next combo box since there isn't a way for the user to change the
combo box they might as well have the next one already filled out.
The other approach you could take is after you set your array
collection to your result add dummy items via
myAC.addItemAt({label:"Choose one"}, 0); This will ensure the user
always has an item to change to.

Similar Messages

  • Need programming help: Three Items selected, only one item displays.

    All the code is below.
    My client has a beach-wear website. It is VERY simple with three pages: Index, Order, and Invoice Page. If customers select the checkbox in front of three items, only one item is displayed on the invoice page. Why aren't all three displayed? I am new to programming:
    //INDEX PAGE:
    <title>Beachwear Title</title>
    <body bgcolor="#FFFFFF">
    <p> </p>
    <form name="form1" method="get" action="jserv/Search.jsp">
    <table width="52%" border="1">
    <tr>
    <td width="20%">Enter Color:</td>
    <td width="80%">
    <input type="text" name="txtColor" size="30" maxlength="20">
    </td>
    </tr>
    </table>
    <p>
    <input type="submit" name="Submit" value="Color">
    </p>
    </form>
    <p> </p>
    //SEARCH PAGE:
    <%@page language="java" import="java.sql.*"%>
    <%@ include file="../Connections/connBeachwear.jsp" %>
    <%
    String rsBeachwear__varColor = "%";
    if (request.getParameter ("txtColor") !=null) {rsBeachwear__varColor = (String)request.getParameter ("txtColor");}
    %>
    <%
    Driver DriverrsBeachwear = (Driver)Class.forName(MM_connBeachwear_DRIVER).newInstance();
    Connection ConnrsBeachwear = DriverManager.getConnection(MM_connBeachwear_STRING,MM_connBeachwear_USERNAME,MM_connBeachwear_PASSWORD);
    PreparedStatement StatementrsBeachwear = ConnrsBeachwear.prepareStatement("SELECT ID, Item, Color, Size FROM Beachwear WHERE Color LIKE '%" + rsBeachwear__varColor + "%';");
    ResultSet rsBeachwear = StatementrsBeachwear.executeQuery();
    boolean rsBeachwear_isEmpty = !rsBeachwear.next();
    boolean rsBeachwear_hasData = !rsBeachwear_isEmpty;
    Object rsBeachwear_data;
    int rsBeachwear_numRows = 0;
    %>
    <%
    int Repeat1__numRows = 10;
    int Repeat1__index = 0;
    rsBeachwear_numRows += Repeat1__numRows;
    %>
    <title>Beachwear Title</title>
    <body bgcolor="#FFFFFF">
    <p> </p>
    <p> 
    <form name="form2" method="post" action="Invoice.jsp">
    <table width="75%" border="1">
    <% while ((rsBeachwear_hasData)&&(Repeat1__numRows-- != 0)) { %>
    <tr>
    <td width="18%"><%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="20%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Item"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="21%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Color"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="5%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Size"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="16%">
    <input type="checkbox" name="valueCheckbox" value="<%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%>">
    </td>
    </tr>
    <%
    Repeat1__index++;
    rsBeachwear_hasData = rsBeachwear.next();
    %>
    </table>
    <p>
    <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
    rsBeachwear.close();
    ConnrsBeachwear.close();
    %>
    //INVOICE PAGE:
    <%@page language="java" import="java.sql.*"%>
    <%@ include file="../Connections/connBeachwear.jsp" %>
    <%
    String rsBeachwear__varCheckbox = "1";
    if (request.getParameter ("valueCheckbox") !=null) {rsBeachwear__varCheckbox = (String)request.getParameter ("valueCheckbox")   ;}
    %>
    <%
    Driver DriverrsBeachwear = (Driver)Class.forName(MM_connBeachwear_DRIVER).newInstance();
    Connection ConnrsBeachwear = DriverManager.getConnection(MM_connBeachwear_STRING,MM_connBeachwear_USERNAME,MM_connBeachwear_PASSWORD);
    PreparedStatement StatementrsBeachwear = ConnrsBeachwear.prepareStatement("SELECT ID, Item, Color, Size FROM Beachwear WHERE ID IN (" + rsBeachwear__varCheckbox + ")");
    ResultSet rsBeachwear = StatementrsBeachwear.executeQuery();
    boolean rsBeachwear_isEmpty = !rsBeachwear.next();
    boolean rsBeachwear_hasData = !rsBeachwear_isEmpty;
    Object rsBeachwear_data;
    int rsBeachwear_numRows = 0;
    %>
    <%
    int Repeat1__numRows = 10;
    int Repeat1__index = 0;
    rsBeachwear_numRows += Repeat1__numRows;
    %>
    <title>Beachwear Title</title>
    <body bgcolor="#FFFFFF">
    <p> </p>
    <p> 
    <p><br>
    INVOICE<br>
    <br>
    </p>
    <table width="75%" border="1">
    <% while ((rsBeachwear_hasData)&&(Repeat1__numRows-- != 0)) { %>
    <tr>
    <td width="18%"><%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="20%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Item"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="21%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Color"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    <td width="5%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Size"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <%
    Repeat1__index++;
    rsBeachwear_hasData = rsBeachwear.next();
    %>
    </table>
    <p>  </p>
    <%
    rsBeachwear.close();
    ConnrsBeachwear.close();
    %>

    Hi, Brad,
    I appreciate your help! I am a beginning Java student, so this code is more complex than what I can handle alone.
    A copy of the compilation error is at the very bottom of this message.
    I added " int chkValues[]; " to the beginning of your code, and then inserted the whole code snippet to the detail (Invoice) page as shown:
    <%@page language="java" import="java.sql.*"%>
    <%@ include file="../Connections/connBeachwear.jsp" %>
    <%
    String rsBeachwear__varCheckbox = "1";
    if (request.getParameter ("valueCheckbox") !=null) {rsBeachwear__varCheckbox = (String)request.getParameter ("valueCheckbox")   ;}
    %>
    <%
    Driver DriverrsBeachwear = (Driver)Class.forName(MM_connBeachwear_DRIVER).newInstance();
    Connection ConnrsBeachwear = DriverManager.getConnection(MM_connBeachwear_STRING,MM_connBeachwear_USERNAME,MM_connBeachwear_PASSWORD);
    int chkValues[];
    StringBuffer prepStr=new StringBuffer("SELECT ID, Item, Color, Size FROM Beachwear WHERE ID=");
    for(int x=0;x<chkValues.length;++x){
    prepStr.append( chkValues[x] );//using an x instead of an i
    if((x+1)<chkValues.length){//another iteration
    prepStr.append(" OR ID=");
    }//end if
    }//end for loop
    PreparedStatement StatementrsBeachwear = ConnrsBeachwear.preparedStatement(prepStr);
    ResultSet rsBeachwear = StatementrsBeachwear.executeQuery();
    boolean rsBeachwear_isEmpty = !rsBeachwear.next();
    boolean rsBeachwear_hasData = !rsBeachwear_isEmpty;
    Object rsBeachwear_data;
    int rsBeachwear_numRows = 0;
    %>
    <%
    int Repeat1__numRows = -1;
    int Repeat1__index = 0;
    rsBeachwear_numRows += Repeat1__numRows;
    %>
    <title>Beachwear Title</title>
    <body bgcolor="#FFFFFF">
    <p> </p>
    <p> 
    <form name="form1" method="post" action="">
    <p><br>
    INVOICE<br>
    <br>
    </p>
    <% while ((rsBeachwear_hasData)&&(Repeat1__numRows-- != 0)) { %>
    <table width="75%" border="1">
    <tr>
    <td width="13%">ID:</td>
    <td width="87%"><%=(((rsBeachwear_data = rsBeachwear.getObject("ID"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="13%">ITEM:</td>
    <td width="87%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Item"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="13%">COLOR:</td>
    <td width="87%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Color"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    <tr>
    <td width="13%">SIZE:</td>
    <td width="87%"><%=(((rsBeachwear_data = rsBeachwear.getObject("Size"))==null || rsBeachwear.wasNull())?"":rsBeachwear_data)%></td>
    </tr>
    </table>
    <%
    Repeat1__index++;
    rsBeachwear_hasData = rsBeachwear.next();
    %>
    <p>  </p>
    </form>
    <%
    rsBeachwear.close();
    ConnrsBeachwear.close();
    %>
    ERROR:
    500 Internal Server Error
    /jserv/Invoice.jsp:
    Compilation error occured:
    Found 1 errors in JSP file:
    C:\\Inetpub\\wwwroot\\Beachwear\\jserv\\Invoice.jsp:27: Error: No method named "preparedStatement" was found in type "java/sql/Connection".
    allaire.jrun.scripting.DefaultCFE:
    Errors reported by compiler:C:/Program Files/Allaire/JRun/servers/default/default-app/WEB-INF/jsp/jrun__jserv__Invoice2ejsp12.java:82:42:82:83: Error: No method named "preparedStatement" was found in type "java/sql/Connection".
         at allaire.jrun.scripting.JavaCompilerService.compile(../scripting/JavaCompilerService.java:96)

  • SQL query to retrieve families with only one generation from a family db

    Hi,
    I need to write an SQL query that would select families with only one generation ((which means a person - or a married couple - with kids) or (a person - or a married couple - with parents but no kids)) from a database containing families. The simplified db structure is:
    person:
    id - int, primary key
    siblings:
    id
    parent_id
    kid_id
    marriage
    id:
    husband_id
    wife_id
    Could anyone please help me? I dont really have any idea how to accomplish that...

    Hi,
    Welcome to the forum!
    Assuming that siblings (despite its name) contains only parent-child relationships, and that the parent_id could be either the mother or the father:
    WITH     got_tree     AS
         SELECT     CONNECT_BY_ROOT  s.parent_id     AS root_id
         ,     LEVEL                     AS lvl
         FROM          siblings     s
         LEFT OUTER JOIN     marriage     m     ON     s.parent_id     IN ( m.husband_id
                                                            , m.wife_id
         START WITH     parent_id     NOT IN     (  SELECT  kid_id
                                               FROM        siblings
         CONNECT BY     s.parent_id     IN ( PRIOR m.husband_id
                                , PRIOR m.wife_id
                                , PRIOR kid_id
    SELECT       root_id
    FROM       got_tree
    GROUP BY  root_id
    HAVING       MAX (lvl)     <= 2
    ;This will get a list of parents who may or may not have children, but who do not have either parents or grandchildren.
    To get their spouses and children (if any) you will have to join this result set to all the other tables. At that point, you can eliminate poeple who do not have ancestors themselves, but are married to people who have more than one generation of ancestors.
    The details of how to do that depend on the details of your tables. If you'd like help, then post a little sample data (CREATE TABLE and INSERT statements for all tables) and the results you want from that data.
    Edited by: Frank Kulash on Oct 14, 2009 4:05 PM
    I'd need sample data in order to test this, of course.

  • TableSelectMany selects only and only one item !!!

    this is my table source ...
    i select multiple items.but in back_bean code .set return only one item.
    <af:table value="#{bindings.GenfunctionsView1.collectionModel}"
    var="row" rows="#{bindings.GenfunctionsView1.rangeSize}"
    first="#{bindings.GenfunctionsView1.rangeStart}"
    emptyText="#{bindings.GenfunctionsView1.viewable ? 'No rows yet.' : 'Access Denied.'}"
    binding="#{backing_ManySelection.table1}" id="table1"
    banding="none">
    <af:column sortProperty="Id" sortable="false"
    headerText="#{bindings.GenfunctionsView1.labels.Id}"
    binding="#{backing_ManySelection.column1}" id="column1">
    <af:inputText value="#{row.Id}"
    required="#{bindings.GenfunctionsView1.attrDefs.Id.mandatory}"
    columns="#{bindings.GenfunctionsView1.attrHints.Id.displayWidth}"
    binding="#{backing_ManySelection.inputText1}"
    id="inputText1">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.GenfunctionsView1.formats.Id}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="Functionname" sortable="false"
    headerText="#{bindings.GenfunctionsView1.labels.Functionname}"
    binding="#{backing_ManySelection.column2}" id="column2">
    <af:inputText value="#{row.Functionname}" simple="true"
    required="#{bindings.GenfunctionsView1.attrDefs.Functionname.mandatory}"
    columns="#{bindings.GenfunctionsView1.attrHints.Functionname.displayWidth}"
    binding="#{backing_ManySelection.inputText2}"
    id="inputText2"/>
    </af:column>
    <af:column sortProperty="Functionformula" sortable="false"
    headerText="#{bindings.GenfunctionsView1.labels.Functionformula}"
    binding="#{backing_ManySelection.column3}" id="column3">
    <af:inputText value="#{row.Functionformula}" simple="true"
    required="#{bindings.GenfunctionsView1.attrDefs.Functionformula.mandatory}"
    columns="#{bindings.GenfunctionsView1.attrHints.Functionformula.displayWidth}"
    binding="#{backing_ManySelection.inputText3}"
    id="inputText3"/>
    </af:column>
    <f:facet name="selection">
    <af:tableSelectMany text="Select items and ..."
    binding="#{backing_ManySelection.tableSelectMany1}"
    id="tableSelectMany1" required="true">
    <af:commandButton text="commandButton 1"
    binding="#{backing_ManySelection.commandButton1}"
    id="commandButton1"
    action="#{backing_ManySelection.commandButton1_action}"
    immediate="true" partialSubmit="true"/>
    </af:tableSelectMany>
    </f:facet>
    </af:table>
    public String commandButton1_action() {
    // Add event code here...
    Set KeySet=null;
    KeySet=getTable1().getSelectionState().getKeySet();
    System.out.println("KeySet Rows="+KeySet.size());
    return null;
    plz help me!

    Hi,
    create a SelectionListener on the table to pint to the following method in a managed bean
    public void SelectionLister(SelectionEvent selectionEvent) {
    int selectedKeysSize = selectionEvent.getSelectedKeys().getSize();
    Frank

  • HT204088 How how can I synch my ipod + iphone music to my new computer? I get the same error  "my ipod or iphone is synched with another itunes library.An Ipod can be synched with only one itunes library at a time. What would I like to do Erase and Synch

    How can I synch my ipod & iphone music (purchased from itunes on my old laptop) to my new laptop? I keep getting the same message on my itunes on my new laptop: " The ipod/Iphone is synched with another itunes library. An ipod/iphone can be synched with only one itunes library at a time. What would you like to do - Erase and Synch or Transfer Purchases?" What do I do?
    A couple of other items:
    1) I am guessing Apple does not keep a history of all my music purchases? As I did not have my entire library backed-up anywhere, and relying on the music I have on my ipod and my iphone as my only source of itunes music....I have lost over 500 songs!!!
    2) I used to have an Apple account under another account name, and since have switched to a new account name. Is there anyway to find the history of purchases from my old Apple account name and transfer these over to my new account name and onto my new laptop?
    I hope someone can help, I am having a very difficult time trying to obtain answers. Angie

    The iphone/ipod is NOT a storage/backup device.  Not maintaining a backup copy is a big mistake.
    You can transfer itunes purchases from your iphone/ipod to your computer:
    Authorize your computer for all accounts and then click  File>Transfer Purchases

  • Nodes with Only One Lower-Level Node = Hide

    Hi everyone
    Have anyone present this situation:
    Iu2019ve a quey to report inventory aging. It has two hierarchies to show data. In Rows I have Major Markets and in Columns a date hierarchy to show aging Ex: from 0 to 8 months, 9+ and 13+. Of course here I have also value and volume.
    Query reports all values for all major markets fine. When I filter one major market, letu2019s say France also brings detailed figures but when I add any drill down in rows all values goes to cero (0).
    Te estrange is that if you swap drill down order with major markets or drill down by columns with the same characteristic figures come out again as usual.
    I know this sounds like a SAP note but I have not been able to find it either.
    Thanks a lot for your help, and of course points will be assignedu2026..
    Ps. Important, this happen when  option u201CNodes with Only One Lower-Level Node = Hideu201D (this is selected on purpose because there are some repeated nodes in major market hierarchy Ex. France u2013 France and if there is just one value under first node then means that only display of last one is necessary to avoid repeated values).

    Solution we found is to remove flag "Do not display leaves for inner-nodes in the query", directly on the hierarchy.
    Thanks

  • SQL Server 2012 Undetected Deadlock in a table with only one row

      We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
      This is our main database, so most of the applications access it.
      The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
      That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
      After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client
    applications start a new transaction, get the current number, increment it by one and commit the transaction.
      The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
      No client application was changed in this migration and this process was working very well for the last 10 years.
      The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
      It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
      I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
      Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?

    First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
    This is incorrect. 
    Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized.  Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
    serialize access to this table.  Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
    I converted the sample program to VB.NET:
    Public Class Form1
    Private mbCancel As Boolean = False
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim soConn As ADODB.Connection
    Dim soRst As ADODB.Recordset
    Dim sdData As Date
    Dim slValue As Long
    Dim slDelay As Long
    'create database vbtest
    'go
    ' CREATE TABLE [dbo].[ControlNumTest](
    ' [UltData] [datetime] NOT NULL,
    ' [UltNum] [int] NOT NULL,
    ' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    ' [UltData] Asc
    ' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
    ' ) ON [PRIMARY]
    mbCancel = False
    Do
    ' Configure the Connection object
    soConn = New ADODB.Connection
    With soConn
    .ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
    .IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
    .Mode = ADODB.ConnectModeEnum.adModeReadWrite
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .Open()
    End With
    ' Start a new transaction
    Call soConn.BeginTrans()
    ' Configure the RecordSet object
    soRst = New ADODB.Recordset
    With soRst
    .ActiveConnection = soConn
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
    .LockType = ADODB.LockTypeEnum.adLockPessimistic
    .Open("SELECT * FROM dbo.ControlNumTest")
    End With
    With soRst
    sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
    slValue = .Fields!UltNum.Value ' Read the last Number
    If sdData <> Date.Now.Date Then ' Date has changed?
    sdData = Date.Now.Date
    slValue = 1 ' Restart number
    End If
    .Fields!UltData.Value = sdData ' Update data
    .Fields!UltNum.Value = slValue + 1 ' Next number
    End With
    Call soRst.Update()
    Call soRst.Close()
    ' Ends the transaction
    Call soConn.CommitTrans()
    Call soConn.Close()
    soRst = Nothing
    soConn = Nothing
    txtUltNum.Text = slValue + 1 ' Display the last number
    Application.DoEvents()
    slDelay = Int(((Rnd * 250) + 100) / 100) * 100
    System.Threading.Thread.Sleep(slDelay)
    Loop While mbCancel = False
    If mbCancel = True Then
    Call MsgBox("The test was canceled")
    End If
    Exit Sub
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    mbCancel = True
    End Sub
    End Class
    And created the table
    CREATE TABLE [dbo].[ControlNumTest](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go insert into ControlNumTest values (cast(getdate()as date),1)
    Then ran 3 copies of the program and generated the deadlock:
    <deadlock>
    <victim-list>
    <victimProcess id="processf27b1498" />
    </victim-list>
    <process-list>
    <process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
    UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    (@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
    </process>
    <process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
    FETCH API_CURSOR0000000000000001 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    FETCH API_CURSOR0000000000000001 </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf6ac9498" mode="S" />
    <owner id="processf6ac9498" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="processf27b1498" mode="X" requestType="convert" />
    </waiter-list>
    </keylock>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="X" requestType="convert" />
    </owner-list>
    <waiter-list>
    <waiter id="processf6ac9498" mode="U" requestType="wait" />
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    It's the S lock that comes from the cursor read that's the villian here.  U locks are compatible with S locks, so one session gets a U lock and another gets an S lock.  But then the session with an S needs a U, and the session with a U needs an
    X.  Deadlock. 
    I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
    The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
    .Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
    So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction.  This resolves the deadlock, but requires a code change.
    I tried several things that didn't require a code, which did not resolve the deadlock;
    1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
    2) SERIALIZABLE isolation level
    3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
    Then I replaced the table with a view containing a lock hint:
    CREATE TABLE [dbo].[ControlNumTest_t](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go
    create view ControlNumTest as
    select * from ControlNumTest_t with (tablockx)
    Which, at least in my limited testing, resovlved the deadlock without any client code change.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Different Effective Date in One BOM with only ONE Change Number

    Hi gurus
    here is my complete question?
    Is it possible to realize this function that Different Effective Date in One BOM for different BOM items with only ONE Change Number?
    Thanks for your information/help in advance.

    Dear Zhao,
    Using One change number it's not possible to define a different valid from date for the BOM changes of a single material BOM.
    In case if the same change number is used for making different material's BOM component,then a different valid from date for
    each BOM can be defined,but at any given point not for each component/item level of the same BOM.
    Check and revert back.
    Regards
    Mangalraj.S

  • Select tables which have only one row....

    Hi Guys,
    Can you tell me if there is a way to fetch all the tables in the database with only one record?
    This is to filter out only the basic data tables in our application which consist of over 30,000 tables...
    Many Thanks...
    Napster

    if your object statistics are accurate then you can use:
    select * from dba_tables where num_rows = 1;Edited by: Martin Preiss on May 2, 2013 3:00 PM

  • Delivery group 000 consists of only one item

    Hi All,
    I've the following issue(s):
    Customer Master is set with "Complete delivery required by law" flag.
    Partial Delivery per item = B.
    Max. Partial deliveries = 1.
    However, when I create an SO for this customer: then in the SO, the complete delivery flag is not set.
    Also, i get the msg: "Delivery group 000 consists of only one item".
    I checked the item category in VOV7, no delivery grp flag set.
    Please help me with both issues.
    Regards,
    Raghu.

    Dear,
    For complete deliver select - C  (Only complete delivery allowed),in customer master,
    Then in sales order it will appear with tick mark, and when you creating delivery & if you change delivery quantity then system will popup dialog box, saying complete delivery required.
    Delivery group (items are delivered together)
    A combination of items that should be delivered together.
    Use
    The system uses delivery groups to check the availability of items that should be delivered together. The delivery date of the latest schedule line in the delivery group is taken as the general date for the whole group.
    Procedure
    During sales order processing, you can enter a number (up to three digits) that identifies a delivery group. The number is freely definable.
    Regards,
    kapil
    Edited by: Kapildev Farakte on Nov 18, 2009 11:33 AM

  • Need validation that ensures only one item has a value.

    Hello,
    I need a validation that ensures that only one item has a value. I want to allow a person entering information into a form to have the option to either select from a drop-down or enter something into a text box but not both.
    I have found some information about validation of this type but I'm not sure how to use it. Here is what I found:
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    This validation ensures that only one item (ITEM_1, ITEM_2) has a value.
    Example 5:
    Assume a function similar to the following exists:
    create or replace function sampleValidation (p_arg in varchar2) return boolean
    as
    begin
    if p_arg= '1' then
    return true;
    else
    return false;
    end if;
    end;
    A validation of type PL/SQL Expression could then reference this function returning a boolean using the following syntax:
    sampleValidation(v('MY_ITEM'))
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Please let me know how to implement this or give me another way to validate.
    Thanks
    Linda

    Linda,
    The best is to use a Validation of type PL/SQL Function Returning Error Text like this:
    BEGIN
       IF :p1_item_1 IS NULL AND :p1_item_2 IS NULL
       THEN
          RETURN 'One of the items must have a value.';
       ELSIF :p1_item_1 IS NOT NULL AND :p1_item_2 IS NOT NULL
       THEN
          RETURN 'Only one of the items must have a value.';
       END IF;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Importing m2t into iMovie with only one conversion

    Ok, so m2t files have been beaten to death in these forums, but I'm still puzzled. Here's my situation. I have a Canon HV20 and only replay the tape once to avoid wear and save time (really?). So I capture to m2ts. Fine. Now I'd like to be able to use these in iMovie with only one conversion. I can convert the stream to a framed (QT) format like AIC. But I'd like to do this just once. Meaning, when I convert clip.m2t to clip.mov I'd like to drag this to iMovie and have iMovie just "copy" an not import/convert. Can I convert to a format where I can just drag to the media folder in the given iMovie project?
    For those watching. My toolchain is
    1. rewind the tape
    2. capture with HDVsplit (win), DVHScap (mac), or whatever
    3. split/clip the m2t files with HDVsplit (win) or MPEGstremclip (mac/win), or HDVxDV (mac) and leave as m2t
    4. convert the m2t clips I want in my movie to QT+AIC
    5. import these QT+AIC .mov clips into iMovie
    6. edit
    I'd like to optimize 4 and 5. (And by the way, someone should port HDVsplit to mac.)
    Thanks,
    WL

    Matti Haveri wrote:
    MPEG Streamclip allows you to export as QuickTime with Apple Intermediate Codec (also QT Player can do this but I prefer MPEG Streamclip for these tasks). I think you should set the resolution to 1440x1080 because that's what iMovie uses internally for 1080i.
    I did a quick test and iMovie seems to accept such AIC-encoded .mov files directly to its Media folder. But run some tests through your complete workflow before trusting this will work!
    Ok this was helpful. If I take 1440x1080 QT/AIC output from MPEGstreamclip, I can efficiently copy the file in the project. Works like a charm and looks great in iMovie. (I can also now take the 1920x1080 QT/AIC output from streamclip and do the same; not sure what change there. I did a test on a 1:24 length mpeg-2 stream. The 1440x1080 with and without deinterlacing were 700MB and 600MB respectively, while the 1920x1080 is at 800MB. So it makes sense to do 1440x1080 since iMovie handles it fine.)
    In summary (hope this helps someone), here's what I do:
    0a. Macbook with iMovie HD
    0b. LaCie macos formated external drive drive (hfs+)
    0c. Canon HV20 filmed at 1080i (not sure what do with the 24p cinemode)
    1. use DVHScap (mac) to capture the stream from the HV20. This gives file.m2t, for example. This can be viewed with VLC, for example. (on windows use HDVsplit to capture). Copy the m2t file to the external drive.
    2. now use MPEGstreamclip to disect the m2t file. use the 'i' and 'o' to mark inputs and outputs and then "save as". Save this as file_clip.ts for example. The .ts is the same as an .m2t file, so save it as either.
    3. now you should have 1 or more file_clip.ts depending on how many times you do step 1 and 2.
    4. use MPEGstreamclip in batch mode to take the file_clip.ts or m2t files and "export to Quicktime". Select Apple Intermediate Codec as the type compression type. Yank the quality up to 100%. Select 1400x1080 (4:3) as the frame size and click "deinterlace video" (my opinion on the deinterlacing). Save the movie on the external drive as file_clip.mov.
    5. now start a new iMovie HD project and save the project to the external drive. Quit iMovie. open-apple-click on the myproject.iMovieProject to "show package contents". After this you can move your file_clip.mov files to the media directory under this package. A move is best since copy does an actual copy. Move just moves a pointer.
    6. start up iMovie and view the trash can when prompted ("Some stray files were found in the project...."). Now drag the trash files to the clips area in iMovie.
    7. now edit.
    This is a nice approach for a couple of reasons. The .m2t files are great storage formats. The conversion from mpeg-2 stream (m2t) to a framed format like QT+AIC (mov) is done +only once+. And the quality is maintained. Also, I can do this all to an external harddrive, which is nice since I'm limited on my macbook.
    I don't have HD gear. Currently I archive SD DV to tape and to big harddisks. In the future I would like to continue to archive HD content in its native compressed (non-AIC) form. Obviously this works via DVHScap, right?
    Yes. The m2t files are a great archival format. The 1:25 long clip above was only 275MB while the framed formats were 3 times that. The stream saves differences so it's a lot more efficient (but you don't have frames for editing). VLC is also quick as quick for viewing these. DVHScap never drops any packets (mpeg-2) when capture (for me at least). HDVsplit is also great, but only for windows. HDVxDX also worked like a charm.
    Well anyway, thanks for the chatter.
    Nate

  • How to connect many devices with only one FW800 port in iMac?

    Hi,
    I am upgrading to a new Intel iMac from a 2004 vintage Dual2.0GHz PowerMac. I currently have 8x d2 Quadra drives chained by FW800, and 2x Iomega drives connected vis FW400 hub which also connects HD cams.
    My questions is that with only one FW800 port in iMac, I think my devices connectivity is the following?
    (1) Get a FW 800 hub (I can only find 2 port ones at the Apple store and BestBuy)
    (2) Connect the d2 Quadras to one port of the FW800 hub
    (3) Get a FW 800 to FW 400 cable
    (4) Connect my 6 port FW400 hub to the 2nd port of the FW800 hub
    Thanks for reviewing this solution, and I would also appreciate other suggestions or hear about your experiences if you have a similar set-up.
    Will

    In addition to your listed considerations, you should consider the following.
    Many storage needs do not required FireWire 800 speed. For example, USB 2.0 works fine for your Time Machine backup drive. If you are just storing user data such as your iPhoto or iTunes media files, USB 2.0 is more than fast enough. So, as much as possible, if any of those external drives have USB 2.0 connections and the data storage does not need FireWire 800 speed, offload as much as possible to USB 2.0. I used to be a +FireWire snob+, but since getting an Intel iMac, I find that USB 2.0 works quite well for most data storage purposes.
    There are new hard drives that are power efficient and as large as 2TB. Consolidate your data storage needs onto a smaller number of very large drives, partitioned as needed. This will make your setup more reliable (smaller number drives), and save reduce power consumption. If any of your current externals are SATA, you can probably replace the existing drive with an extra large one.
    So, I think you setup should be, extra large FireWire 800 drive connected to the FireWire 800 port directly. Using a 9-pin to 6-pin cable, connect the FireWire 400 hub. Connect any non-storage FireWire 400 devices there. Do some data transfer testing to make sure having the 400 hub there on the chain does not cause the 800 connection to slow down.
    Connect other drives as needed using USB 2.0, existing or new. Retire the smaller of your external drives.

  • An iPhone can be synced with only one iTunes library at a time

    I recently bought a MacBook Pro, and I figured it would be pretty simple to move my iPhone to sync with iTunes on the Mac from iTunes on my pc, afterall it is the same program and both are designed for the iPhone.
    I have been successful in getting the Contacts and Calendar to sync, but the Music, Applications, Video and a few other things give me this message when I check the sync box:
    "The iPhone is synced with another iTunes library. Do you want to erase the iPhone and sync with this iTunes library? An iPhone can be synced with only one iTunes library at a time. Erasing and syncing replaces the contents of this iPhone with the contents of this iTunes library."
    Obviously, I don't want to erase everything. Actually, I don't care about Music, Videos, Podcasts or Ringtones as I don't have any, but I do care about Photos and Applications. Actually Photos I can reload too, but I don't want to loose the apps I have purchased with the iTunes App Store.
    I even tried going back to the PC and unchecking the Sync boxes on it, hoping this might disassociate it from the phone, but now even on that PC I get the same message.
    How do I disconnect phone from the old iTunes and be able to sync it to the new iTunes? This should be simple right?

    I made an appointment with a Mac Genius and I will say that while it was better than getting to talk to India on a poor quality phone call it was just about as helpful. Sure she was cute and friendly, but I left without my issue resolved and was surprised that I didn't even get a followup from anyone asking about my experience (hence my venting here)
    Anyway, I found a solution for my issue here: http://tinyfish.net/2008/07/18/how-to-sync-iphone-with-multiple-computers/
    This is a real solution to the issue, and has the benefit that I can do this to as many machines as I need and sync at any of them instead of just one. Hopefully, Apple doesn't delete my response since it truly is the answer to the problem and others might be looking for the same solution.

  • I got a new pc and I am getting this message: The ipod 'harms ipod' is synced with another itunes library  Do you want to erace this Ipod and synce with this itunes library?  An Ipod can only be synced with only one itunes library at a time.  Erasing and

    The ipod 'harms ipod' is synced with another itunes library.Do you want to erase this ipod and sync with this itunes library?  An ipod can be synced with only one itunes library at a time.  Erasing and syncing replace the contents of this ipod with the contents of this itunes library.
    I don't know what to do?  I should save my library before I replace the contents, but I don't know how to do that! HELP!!

    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

Maybe you are looking for

  • How to save a locked PDF unlocked?

    I used to save locked PDF files unlocked on my MacBook. In Preview: Before I'd opened the PDF file, I used the option: 'save as' Then I filled in the password and used the option: rename/rewrite file. The option 'save as' is no longer in Lion. Any su

  • I have disabled my ipod?? what do i do know??

    i have disabled my ipod how do i fix it, can't remember my pass word

  • Special charcter handling in Property key

    Hello, I want to load a property file with the usual way - using Properties - , but unfortunately the key names looks like this AA::Param_1. The :: causes problems for the getProperty method. I can not change the format of the parameter file. Is ther

  • Approver request gets to approver but not seen in approver work inbox AC10

    Hello Gurus, I have a problem that has been frustrating me for some two days now. I am trying to create a user request using the standard workflow in AC 10.0. I have the manager account setup and assigned to the user i am trying to create. The role i

  • FDM Import Format - field name list population

    I am working with an Import Format definition. How can I control the list of possible names that are displayed in the Field Name drop down list box? The lists currently displayed are different from Import Format Group to Import Format Group. Thank yo