Connect and query a large SQL database - InfoPath Dev
in

InfoPath Dev

Connect and query a large SQL database

Last post 02-26-2008 10:12 PM by saudak. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-25-2008 09:54 PM

    Connect and query a large SQL database

    Hi,
    I can connect to an SQL table that has a million records,
    its just ID, NAME
    I want to do is, I enter the ID I get the exact name.
    How do I write it using 2 textboxes,
    one for the ID and the other should have the name automatically show up,

    what I did>>

    in a new blank from, Tool>>Data connection, Add>>Recieve data>>Database(SQL or access)>>Select Database, selected the  odc file created for the table. >>Finish

    I add 2 TextBoxes

    For one I created a rule, set condition to field1=ID then - action1: query data connection, action2: Set field's value field2 to @FIRST_NAME (from the data connection)

    This does not work it shows the>>

    "The following DataObject either cannot be created or cannot be initialized: PERSON
    The query cannot be run for the following DataObject: PERSON
    InfoPath cannot run the specified query.
    [0x8007000E][Microsoft OLEDB Persistence Provider] Not enough storage is available to complete this operation.
    "

    I tried the same thing with the pubs database, at least it shows up but the  query does not work , ie. Even if I enter any ID it shows up the first record as name.

    Where am I wrong?
    Help plz

  • 02-25-2008 11:01 PM In reply to

    Re: Connect and query a large SQL database

    You need to use a filter.

    So when you set field two you want to select the field from your data connection but use the filter button in the lower left and add the filter

    where ID = IDfield in your form. This then will grab the person you want not just the first one.

     If you have a million records you are going to want to use a query and not try and load a million records into your form, which it will do by default.

    A database form built from scratch might work or you should look at adding web services to your data base so you can dynamically query all you want.

    That is what I use.  If you would like a demonstration let me know.

    Filed under:
  • 02-26-2008 06:13 AM In reply to

    Re: Connect and query a large SQL database

    Listen to Motörhead cos they play Rock'n Roll :)
  • 02-26-2008 10:12 PM In reply to

    Re: Connect and query a large SQL database

    Thanx guys ,

    I would love to use the trick given by nukkumatti but Im a little novice in infopath to comply understand it.

    I would be glad if you gave me a tutorial to use a webservice  (I mean install in the AD) and small little function to connect to infopath and return values.

    Thanx again. 

    oh.... And some tutorials on filters please!

     

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