473,503 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OleDbDataAdapter.Update MSAccess Table

Don

Using: VS 2003, Access 2002, WinXP w\No service packs

I'm trying to add a record to an Access table via an OleDbDataAdapter
while keeping a little bit of my sanity. Neither is working.

Please see below and Please help.

Don

The line:
SnipsDA.Update(SnipsDS, "snips")

produces the ERROR:

"No value given for one or more required parameters."

I've copied the exact InsertCMD into Access and it works perfectly.

Here is the actual Access Table Columns:

NodeID, Autonumber
GUID_ID, Text(36)
ParentID, Text(36)
NodeText, Text(255)
NodeType. Integer
Here's the *^%! function:

Public Function AddSnip(ByVal ParentId As String, ByVal txt As
String, ByVal nodeType As Integer) As String

Dim t As DataTable = SnipsDS.Tables("snips")
Dim newRow As DataRow = t.NewRow()

newRow("GUID_ID") = GetGuid()
newRow("ParentId") = ParentId
newRow("NodeText") = txt
newRow("NodeType") = nodeType
If Not newRow Is Nothing Then
t.Rows.Add(newRow)
End If

snipConn = ConnectToAccess()
If Not snipConn.State = ConnectionState.Open Then Exit
Function

InsertCMD = New OleDbCommand("INSERT INTO T_Snippet(GUID_ID,
ParentID, NodeText, NodeType) VALUES (? , ? , ? , ?)", snipConn)

SnipsDA.InsertCommand = InsertCMD

Dim RecordsUpdated As Integer
If SnipsDS.HasChanges Then
Try
RecordsUpdated = SnipsDA.Update(SnipsDS, "snips")
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End If

Return newRow("GUID_ID")
End Function
Mar 26 '06 #1
0 923

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5056
by: Bennett Haselton | last post by:
Suppose I add a new row to a table in a dataset, and then I use an OleDbDataAdapter to add that new row to a SQL Server database using OleDbDataAdapter.Update(), as in the following code: ...
9
5262
by: joun | last post by:
Hi all, i'm using this code to insert records into an Access table from asp.net, using a stored procedure, called qry_InsertData: PARAMETERS Long, Long, Text(20), Long, DateTime; INSERT...
0
5797
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
1
4746
by: RML | last post by:
Hi everyone, I am using VB.NET 2003 and an OleDBDataAdapter to update an Access table's DateTime field. The field's format is set to "General Date" (ie: 11/24/2004 8:00:00 AM). The problem is...
5
3681
by: Al | last post by:
Hi, I need to update tables in access 97. The table names have spaces (not my choice). My update fails even though I use the OleDbCommandBuilder. Here is a code I am using myDataAdapter = New...
6
14865
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I...
6
1844
by: tom c | last post by:
I create 2 data OleDbDataAdapters, one with the wizard, and one in code. I know the adapter created in code is OK because I use it to fill a data table. However, when I try to use the same SQL...
2
2904
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source wizard,and made datagridview and bindingsource...
6
1669
by: baldrick | last post by:
Hello, I am trying to plonk the entire contents of a dBase file into an Access table. I have scanned the dBase fields and created an empty Access table with the same field formats. I have...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.