Add new data to database - InfoPath Dev
in

InfoPath Dev

Add new data to database

Last post 11-23-2005 10:04 AM by Ben. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 11-17-2005 07:11 AM

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Add new data to database

    Hi,

    I have a question and didn't find anything about it in the forum. My Access database has three tables. One for the company, one for all the plants belonging to the company and on for all the projects belonging to the plant.
    Now I want the user to be able to store new data. At first there is a dropdownlist showing all the companys stored in the database. He has the option to select one or add another one in a new form. That works perfect.
    The same should be able for the plant. Whether the user selects one or add a new one in a new form. But how does it work to select a company in the dropdownlist and add a new plant to the database? Everytime I try to do that, InfoPath wants me to fill out the keyfields of the company and if it is already stored it shows the "no double values allowed in the keyfield"
    In the end the user should be able to select a company in the first dropdown or add one. He should be able to select a plant belonging to the company in the second dropdown or add one and after that he should be able to add a new project.
    Is there a posibility to solve the problem?
  • 11-18-2005 07:16 AM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Re: Add new data to database

    No solution?
  • 11-18-2005 07:29 AM In reply to

    Re: Add new data to database

    quote:
    Originally posted by Ben

    The same should be able for the plant. Whether the user selects one or add a new one in a new form. But how does it work to select a company in the dropdownlist and add a new plant to the database? Everytime I try to do that, InfoPath wants me to fill out the keyfields of the company and if it is already stored it shows the "no double values allowed in the keyfield"


    Please clarify the above. It's not very clear what your situation is.

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 11-18-2005 08:13 AM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Re: Add new data to database

    Okay just an example. I want to add a new project to my database. First I select a company from ddl 1. The company im searching for is already stored in the db and I select it in the ddl 1. Now I select one of the plants in ddl 2 belonging to the company. The Plant I'm looking for is also already stored in the db so I select it in ddl 2. After that I enter all the data for the new project and store it. That's how it should work.
    So I want InfoPath to add the relationship between the new project and the plant it belongs to and store the project in the project table.
    But I have no idea how to do that because InfoPath forces me to add also a company and a plant, even if both already exist.

    In the end it should work like a orderform which allows you to place a new order by entering your customer number instead of entering all your personal data. So many orders belong to one customer number.
    Hope its clear now.
  • 11-21-2005 08:31 AM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Re: Add new data to database

    Okay, adding a new company works perfect now but if I want to store a new plant InfoPath shows this error:

    [0x80004005][Microsoft Cursor Engine] Empty row cannot be inserted. Row must have at least one column value set.

    In my understanding that's because I didn't add the primary key information for the company. But I don't want to add a company. Access will create the relationship to a company and the new plant by itself. So what's wrong?
  • 11-21-2005 01:16 PM In reply to

    Re: Add new data to database

    Thanks for the extra information around your process. I think we can help you but we could also use a little more information of how you have your InfoPath form set up. For instance, if you have a submit button, what is it submitting to and how are you pushing data into your database. You may have to add some logic that will tell if you are going just a project insert versus a project and a plant insert.
    Jason
    http://www.k2distillery.com/
  • 11-21-2005 01:45 PM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Re: Add new data to database

    My InfoPath form is a simple one based on a Access database connection. The submit button is the one offered by InfoPath just submiting to a database. My main connection is based on the company tabel. It looks like the following:

    + company
    I------+ plant
    ______I------+ project
    ______I------+ contact

    It's the same relationship like my Access database uses. And that's probably my problem. If I store only the basement (the company) it works fine. Else it doesn't work.
    Is there anythink else you need to know? Thanks for the help.
  • 11-22-2005 05:22 AM In reply to

    Re: Add new data to database

    From what it sounds like when you insert a company there is no problems although when you insert a project nothing works. And according to an earlier post, if you just insert a project, Access should set up releationships to an existing plant and company.

    You may be trying to do too much with a single submit. I have you tried seperating the two. For example if the user does a company insert that is one button while if the user is trying to create a project that will be a different button.

    Someone else have insight.
    Jason
    http://www.k2distillery.com/
  • 11-22-2005 11:53 AM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Re: Add new data to database

    Jop, even tried different forms for storing a company, plant or project. But I think I have to change something with the submin buttons.
    Perhaps a little skript could help. I tried some but it didn't work, yet. Is there a possibility to store the data to a table by using skript? InfoPath offers me only the option to submit it to the main connection.
  • 11-22-2005 05:07 PM In reply to

    Re: Add new data to database

    Have you tried doing a submit to a webservice which can be a seconday data source? Review this lab -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_08.asp
    Jason
    http://www.k2distillery.com/
  • 11-23-2005 10:04 AM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33

    Re: Add new data to database

    Thanks for your help but I found another way. I just build three forms with the belonging table as main connection and link them with buttons to the main form. Not the best way I guess but it works. And being the only one familiar to InfoPath in my office gives me some nice privileges :D

    @Franck: Wie waers mal mit nem deutschen Forum? Will wieder in meiner Muttersprach sprechen, wenn ich zurueck in Deutschland bin...
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.