Cascading DDListboxes - InfoPath Dev
in

InfoPath Dev

Cascading DDListboxes

Last post 01-25-2008 02:41 PM by adamrharding. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-22-2008 10:32 AM

    • foobar
    • Not Ranked
    • Joined on 01-22-2008
    • Posts 2

    Cascading DDListboxes

    Firstly I apologize if this has already been brought up - and if it has I would appreciate a link to said topic :)

    My scenario:

    I have a SQL database, containing 1 sizable table (550+ rows)  with 5 columns. I have no problem adding this to a form and so on - and can implement what I want to achieve using multiple data connections (and manually editing the SQL). But this solution isn't very flexible if new rows with different data are added to the database.

    What I want to achieve is when an item is selected from a drop-down listbox, a subsequent drop-down listbox is made visible to the user that filters the data from the database to fit to parameters set by the first drop-down listbox, and so on propagating to the subsequent list boxes.

    eg.

    //during initialization of the form 

    sql_query as string; //global var
    sql_query = "SELECT col_name FROM tbl_name WHERE col1 = 'item'"

    dropdown_list_changedevent(.....)

    {

    dim col_name as string; //holds what the column name is, will be different for each changedevent

    col_name = "col1" 

    buildquery(e.NewValue,  col_name)

    //do something to make the query run

    }

    function buildquery( NewValue as XmlEventArgs, col_name as string) 

    {

    sql_query += " AND " & col_name & " = '" & NewValue.ToString

    } 

     

    It may also be worth mentioning this would be for use as a form from SharePoint, and therefore would have the reduced functionality associated with the browser-only forms.

    Is such functionality possible or would I have to resort to using my previous solution?

    Regards
     

  • 01-22-2008 01:44 PM In reply to

    Hey there. Welcome to the forum.

    You are trying to create a dynamic query, which I have seen done with a hack but I am not sure it could work in a browser based form.

    I have a better solution for you...Web Services.

    Check out the Database Accelerator Package of Web Services.Qdabra Database Accelerator Suite Version 2.1 - Developer

    With it, you can create dynamic SQL queries which is what you are after.  Being able to actually query secondary data sources is a must with large tables as you have found.  DBXL also includes the ability to submit data back to SQL via webservices.

    It can all work with Browser Based forms and there are webparts and other add-ons available.

    If you would like a demonstration let me know.

    Filed under:
  • 01-23-2008 01:35 AM In reply to

    • foobar
    • Not Ranked
    • Joined on 01-22-2008
    • Posts 2
    Thanks Clayfox, Just downloaded it so will spend the morning playing around with it. Regards
  • 01-25-2008 02:41 PM In reply to

    Foobar, Hi

    Could you not just write a web service as a straight link to your datasource, that would do the job perfectly well.

    The DBXL tool is great and can be used for so much more.

    Cheers
     

    Adam Harding
    Wales
    UK
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.