An error occurred accessing a data source.

Hi,

I have seen many posts talking about this error but still i am facing the same issue. The process i have followed is:

1) created infopath form with receive data connection to SQL DB with plain username/pwd

2) placed the repaeating table of receive dataconnection, form has full trust

3) converted the dataconnection to udcx and stored it in data connection library of site collection

4) published the form for admin approval, and as i am the admin i have uploaded it and activated it

5) approved the dataconnection

6) i have modified the infoath settings to use SQL authen, data connection files , cross domain

 

But still i am getting this error:

An error occurred accessing a data source.

An entry has been added to the Windows event log of the server. Log ID:6932 Regards, Amarnath.
May 25th, 2010 7:48am

Browser form or client form?  Does the data connection work in Preview Mode?
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2010 7:50am

It works in preview and in client mode only in browser mode it giving this error
May 25th, 2010 7:55am

It works in preview and in client mode only in browser mode it giving
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2010 8:25am

Hi Clayton,

I forgot to mention the main thing sorry for that. coming to the issue:

Kerboes is activated in our farm and in event viewer i cant find any data related to this issue.

I have checked the event viewer of the server and also in 12\Logs folder also

May 25th, 2010 9:29am

Every time that error occurs, it gets logged...
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2010 9:40am

hi,

I have found below log:

DataAdapterException, Exception Message: The database returns an error. Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.)

 

but i am receiving data only here is my query:

SELECT [Service Request],[Task Order],COUNT(*) as TotalTestCases,SUM(CASE WHEN [Status] = 'Completed' THEN 1 ELSE 0 END) AS Completed,
      SUM(CASE WHEN [Status] = 'Blocked' THEN 1 ELSE 0 END) AS Blocked,SUM(CASE WHEN [Status] not in('Completed','Blocked') THEN 1 ELSE 0 END) AS InProgress FROM
      DashBoardView where SRStatus = 'Active' group by [Service Request],[Task Order] 

 

is my calculated columns is giving error? but when i run my wuery its giving correct output

May 25th, 2010 9:54am

I would recommend testing it with the simplest possible query or call instead of that complex query.  Just do a simple form with nothing in it except the DB connection that calls all rows or whatever other simple query you can think of.  The error you showed is obviously causing an issue, but I'm not sure why you're getting it if the query runs in SQL.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2010 10:13am

Hi Clayton,

My issue is resolved thanks for your suggestions, it helped me a lot.

what we are thinking is right its with SQL query, now i have moved the query as a view to my DB and dsiplaying the data. also i have noticed one more issue if the table column name contains space then infopath is giving alias name and if we use managed code in our infopath form then its giving error before displaying data "colmn contraint issue"

anyway thanks a lot for ur guidance

Regards,

Amar.

 

May 25th, 2010 1:45pm

Hi Amar,

I encountered the same error:

"DataAdapterException, Exception Message: The database returns an error. Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints"

This occurred in InfoPath after changing a text field in a record in a database that was used as a secondary data source. It turned out that the database specified a field length of NVARCHAR(MAX), but there must have been a 50 character limit on the InfoPath form. When the text length of the field was reduced to <=50 characters it all worked fine, >50 characters and it gives the (misleading) error above.

Hope this is of use

James

Free Windows Admin Tool Kit Click here and download it now
August 13th, 2013 2:33pm

would you explain to me more MR. clayton

and how solved

February 2nd, 2015 4:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics