# setting a view to a form

**URL:** <https://forum.servoy.com/t/setting-a-view-to-a-form/7578>\
**Category:** Classic Servoy\
**Created:** [May 29, 2007, 10:40am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578 "2007-05-29T10:40:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [May 29, 2007, 10:40am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/1 "2007-05-29T10:40:24Z")

</div>

I have created a view and it showed in the dataprovider dialog. When I set that to a form and go to the browse mode it throws the following error:

> Cannot work without primaryKey on table ‘test\_view’

Also in the data provider dialog when tried to set the primary key field “Sequence Type” to db identity it shows the following error:

> No primary key specified on table

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [May 29, 2007, 10:54am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/2 "2007-05-29T10:54:53Z")

</div>

Servoy just needs to know what column is the row identifier. When the table doesn’t have one defined as such in the database you can tell Servoy what should be used in the dataproviders (see row ident column).

Hope this helps.

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [May 29, 2007, 1:45pm UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/3 "2007-05-29T13:45:33Z")

</div>

Thanks Robert,

That worked. I had been silly to overlook this stuff.

Thanks!

---

<div class="post-metadata">

**Author:** ![miral135](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@miral135](https://forum.servoy.com/u/miral135)\
**Post date:** [April 15, 2008, 8:36am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/4 "2008-04-15T08:36:15Z")

</div>

Hi. I can’t find this “row indent” you mention.

I am trying to use a sql server view (not a table) as dataprovider for a form. The view contains the primary key from one table and is still primary key for the result set. The problem is that Servoy is returning this error com.servoy.j2db.persistence.RepositoryException: Cannot work without primaryKey on table ‘vw\_rep\_cntr’

How can I convince Servoy to accept this view? How can I set the primary key in the set as row identifier?

Thanks,  
Raluca

---

<div class="post-metadata">

**Author:** ![miral135](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@miral135](https://forum.servoy.com/u/miral135)\
**Post date:** [April 15, 2008, 8:36am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/5 "2008-04-15T08:36:17Z")

</div>

Hi. I can’t find this “row indent” you mention.

I am trying to use a sql server view (not a table) as dataprovider for a form. The view contains the primary key from one table and is still primary key for the result set. The problem is that Servoy is returning this error com.servoy.j2db.persistence.RepositoryException: Cannot work without primaryKey on table ‘vw\_rep\_cntr’

How can I convince Servoy to accept this view? How can I set the primary key in the set as row identifier?

Thanks,  
Raluca

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [April 15, 2008, 9:33am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/6 "2008-04-15T09:33:05Z")

</div>

Hi Raluca,

When you go into the Dataproviders window you can select your tables from the tree on the left. Then in the Columns tabpanel you see the columns defined in that selected table. When you click in the Row Ident column of the grid you see you get a popup menu where you can select Row\_Ident.  
That’s where you set any row ident for tables that have none.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![miral135](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@miral135](https://forum.servoy.com/u/miral135)\
**Post date:** [April 15, 2008, 9:35am UTC](https://forum.servoy.com/t/setting-a-view-to-a-form/7578/7 "2008-04-15T09:35:57Z")

</div>

It helped a lot Robert!  
Thank you!  
Raluca
