I simply drag and drop the table from the server explorer. Below is an
example of an update..
'
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE Events SET
Alkalinity = ?, Ammonia = ?, Calcium = ?, [Date Of Test] = ?, N" & _
"itrate = ?, Nitrite = ?, pH = ?, Phosphate = ?, [Salt Level] =
?, Temperature = " & _
"?, [Test Notes] = ? WHERE (EventID = ?) AND (Alkalinity = ? OR
? IS NULL AND Alk" & _
"alinity IS NULL) AND (Ammonia = ? OR ? IS NULL AND Ammonia IS
NULL) AND (Calcium" & _
" = ? OR ? IS NULL AND Calcium IS NULL) AND ([Date Of Test] = ?
OR ? IS NULL AND " & _
"[Date Of Test] IS NULL) AND (Nitrate = ? OR ? IS NULL AND
Nitrate IS NULL) AND (" & _
"Nitrite = ? OR ? IS NULL AND Nitrite IS NULL) AND (Phosphate =
? OR ? IS NULL AN" & _
"D Phosphate IS NULL) AND ([Salt Level] = ? OR ? IS NULL AND
[Salt Level] IS NULL" & _
") AND (Temperature = ? OR ? IS NULL AND Temperature IS NULL)
AND (pH = ? OR ? IS" & _
" NULL AND pH IS NULL)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Alkalinity",
System.Data.OleDb.OleDbType.Single, 0, "Alkalinity"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Ammonia",
System.Data.OleDb.OleDbType.Single, 0, "Ammonia"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Calcium",
System.Data.OleDb.OleDbType.Single, 0, "Calcium"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Date_Of_Test",
System.Data.OleDb.OleDbType.DBDate, 0, "Date Of Test"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Nitrate",
System.Data.OleDb.OleDbType.Single, 0, "Nitrate"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Nitrite",
System.Data.OleDb.OleDbType.Single, 0, "Nitrite"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("pH",
System.Data.OleDb.OleDbType.Single, 0, "pH"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Phosphate",
System.Data.OleDb.OleDbType.Single, 0, "Phosphate"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Salt_Level",
System.Data.OleDb.OleDbType.Single, 0, "Salt Level"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Temperature",
System.Data.OleDb.OleDbType.Single, 0, "Temperature"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Test_Notes",
System.Data.OleDb.OleDbType.VarWChar, 0, "Test Notes"))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_EventID",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "EventID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Alkalinity",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Alkalinity", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Alkalinity1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Alkalinity", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Ammonia",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Ammonia", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Ammonia1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Ammonia", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Calcium",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Calcium", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Calcium1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Calcium", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Date_Of_Test",
System.Data.OleDb.OleDbType.DBDate, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Date Of Test", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Date_Of_Test1",
System.Data.OleDb.OleDbType.DBDate, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Date Of Test", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Nitrate",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Nitrate", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Nitrate1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Nitrate", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Nitrite",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Nitrite", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Nitrite1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Nitrite", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Phosphate",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Phosphate", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Phosphate1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Phosphate", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Salt_Level",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Salt Level", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Salt_Level1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Salt Level", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Temperature",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Temperature", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Temperature1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Temperature", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_pH",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "pH", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_pH1",
System.Data.OleDb.OleDbType.Single, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "pH", System.Data.DataRowVersion.Original, Nothing))
-----Original Message-----
From: Sahil Malik [mailto:
[email protected]]
Posted At: Saturday, 11 December 2004 6:23 AM
Posted To: microsoft.public.dotnet.framework.adonet
Conversation: Is it me? Or don't data adapters and access work?
Subject: Re: Is it me? Or don't data adapters and access work?
Umm .. How exactly are you generating your commands? Command (don't use)
Builder?
- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik
Daren Hawes said:
I am having great troubles with Data Adapters, Access and Concurrency.
Does everyone have to modify the SQL statements to get tit to work?
I am only using a single Access DB per application, so I really do not
need to worry about concurrency.
Can I turn it off?
Thx