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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Dataset but not Database

Status
Not open for further replies.

richself

Technical User
Jun 27, 2005
37
US
For some reason my Table in my Access Databse is not updating although the dataset updates just fine. Am I missing something simple here? My first form updates another table within the database fine, but the second is not. I'm not getting any error message either.

 
Please show the code for the update that is failing.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
I've found the problem. For some reason the Update command in the adapter was a Select instead of an Update. I guess that would be the downside to the drag and drop commands instead of coding everything manually.
Which brings up the question. My adapter has all 4 commands, Delete Select Insert and Update, I'm only using 2. Does that waste resources? All the code I see around here seems to open connections and so on, in the code.
Example:

Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
Dim myConnection As New OleDbConnection(myConnString)
Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)
myConnection.Open()

Where I have none of that. It's all in the object I've dragged over to the form. The only thing in my code is adding a row and the actual
oledbCommand.Update(DataSet1, "Table")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top