Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Livecyce show only first record from DB

Avatar

Level 2

Hello,

 

I created ODBC connection for Acces Database (.accdb)

I have a form with multiple fields, ex : Product Name, Product No.,Category , etc , and i dont know why my form show only first record "Product Name".

 

Can you help me ?

Thanks

 

 

12 Replies

Avatar

Employee

You need to be a bit more precise with your descriptions. Is the problem that you only get the first field filled or only the first record of a multi-record table shows up? I quickly tested a sample and it filled all fields if the data binding is done properly between dataconnection and fields.

Avatar

Level 2
yes, the problem is that in livecycle it brings me data only in the first field (dropdown) and I would like it to bring me records from the database in the all fields.

Avatar

Employee

Your form should look somewhat like this here:

Kosta_Prokopiu1_0-1604911725866.png

Your Data View should show zhe ODBC connection with all the table fields available and they should all be bound (logo on the right). I am guessing that only your Product Name is bound? You can also see this in the Data Binding under the Binding tab on the right. Make sure they are all correctly bound.

Kosta_Prokopiu1_1-1604911976259.png

 

My working binding is "use name" instead of "$record.dataconnection..." . The problem appear when i change the database with other one identic. Choose Connection Proprietes , select the new ODBC user data source name, the query is correct... and when i open PDF file, it fills just first field...
Ok, why i want to replace the database .... I created a linked table in Acces, from an excel file, and when i modify values in excel, automatically updates in Access.. I use this solution for updating product lists in all pdfs in same time. .. The new database is a duplicate of first db (wich works fine)

Avatar

Employee
And I wonder why it does so with the first field Basically when you replace the data connection you loose the bindings. You can drag and drop the data cionnection fields on to your form-fields to get the binding right again. That should resolve it. Make sure that the little icons show with all your fields.
Yea, correct, but when replace de DB, binding still exist, because i dont delete the old connection, i just change the settings for existing connection and livecycle keep all fields binded with fields from DB

Avatar

Employee
Fair enough, but the "Use name" binding is definitely wrong and needs replacing to get the fields filled
Uhm, , for the moment my PDF`s are connected to a old access DB , and everytime when i want to upgrade product lists, i need to open Access and update manually to get the list updated in PDF`s. Do you have any ideea how i can automate that ? ... I the way i told you, with macro from excel who update automatically Access DB, all works fine, but for that i need to replace the DB connection in PDF . Is not a good ideea to re-bind all fields, because is a lot of them, and many PDF`s. Thanks

Avatar

Employee
ok, first the problem: at some point in time you have lost the data bindings in fields (or you never had them in the first place). These MUST BE recreated - "Use Name" WILL NOT give you the data. The alternative would be scripting. How do you query the access db at the moment? Implicit as part of the data connection? In that case you need data bindings. If you keep the name of the dataconnection the same and also the field structure in the data connection stays, the binding strings "$record...." should work . What does not work is when you create a second data connection with different name and different fieldnames. That it cannot bring together. And what I wonder too is why you need to rebuild the data cnnection? You would update the accdb file with new records and that should suffice. Am I missing something?

Avatar

Level 2

Now i have a connection to the Access DB(.mbd) and everything works good. All what i did is to click "Build" and replace the DSN from ODBC Data Source Administrator with other Access DB (.accdb) with same tabels and same query. But in PDF forms i get only first column from first Table from DataBase.

TehnologiaInformatiei_0-1604992243637.png

Since I receive information from the database it means that the connection was made correctly, what I don't understand is why it doesn't bring all the records from DB.

OK, first - a field in a record is not a record! A record would be more than one line with several fields being returned. I understood so far that you receive a record (a hit on your SQL) and then you only get the first field in the record put in your form-fields. That would be the case if the other fields are not bound correctly. Have you checked that? Show me your Data View expanded so that I can see your data-fields and if they are bound. Question: Is this query designed to return exactly ONE line or more than one lines of your table (Excel>Access)?