Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Data Adapter Configuration Error

Status
Not open for further replies.

Utnapishtim

IS-IT--Management
Joined
Jan 29, 2004
Messages
6
Location
US
When a drag an SQL table (named "ReturnHeader") into the Form Design Window, I receive the following message

The wizard detected the following problems when configuring the data adapter "SqlDataAdapter1."

Details:
Generated SELECT Statement
Generated table mappings
Generated INSERT statement
Generated UPDATE Statement
Could not determine which columns uniquely identify the rows for "ReturnHeader".
Generated DELETE statement
Could not determine which columns uniquely identify the rows for "ReturnHeader".
 
You do not have a primary key in your table, or a candidate key. Therefore, you will be unable to run delete or update queries against that table. The same holds true even out of .Net.
 
I get the same thing and I do have a key on the table that I am selecting in a data form wizard.

Any thoughts?

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Lonnie,

Who knows. Maybe it is a bug which is not well known. My suggestion is to also try to create the whole thing in code. Then create an SqlCommandBuilder or OleDBCommandBuilder (whichever applies) and try to update some data. See if it fails there.
 
If the dataset that you generate contains field data from more than one table then you have to write your own update queries.
Lonnie if that's the problem, then you can trick the EDI into writing those queries for you provided you really only want to update the fields of just one table and are therefore willing to ignore changes to the other fields.
The way to do that is simply create another data adapter that only works on the one table. Let the EDI write the update queries and set the original da's update queries to the 2nd da update queries. If you're a purist you can copy and paste the 2nd da's queries into the original da so that you can delete the 2nd da altogether.
-Karl
 
I have the same problem,
But I have these fields (which none of them are linked to another table) where the one with the * is my primary key.

*Activity nvarchar 30 0
Lbs_h decimal 9 0
Created_by int 4 1
Create_date datetime 8 1
Last_Modified datetime 8 1
IsDeleted int 4 1

I also note that as soon as I try to configure a new SqlDataAdapter, it take off my connection string. Even if I do cancel at the end of my SqlDataAdapter configuration. I don't know why it does it. Also, it add always a new connectionstringX (which X is a number of the new connection) when I finish to configure my SqlDataAdapter.

Does somebody found a solution for this kind of problem?

Thanks in advance

 
Could that star being in the field name have anything to do with it.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
I found it.
I had changed my primary key. And for some reasons, vb didn't recognize it. So I redone my table from scratch. And now it's working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top