P
Paul Mason
Hi folks,
The following function generates the error "Operation must use an updateable
query". There is no identifiable or meaningful error code.
This system is using OLEDB to connect to an Access database. I've tried
applying the insert statement directly to the Access database and it works
fine.
I'm not sure whether this is because the connection isn't allowing updates
or whether there's something odd about the insert statement.
Cheers...P
Public Function AddMatchReport(ByVal lngTeamMatchID As Long, ByVal
lngMemberID As Long, ByVal strReport As String) As Boolean
Dim cm As OleDb.OleDbCommand
Dim adp As OleDb.OleDbDataAdapter
Dim ds As Data.DataSet
Dim rw As DataRow
Dim strRet As String
If Me.Connection.State = ConnectionState.Closed Then
Me.Connection.Open()
End If
cm = New OleDb.OleDbCommand
cm.Connection = Me.Connection
cm.CommandText = "INSERT INTO tbTeamMatchReport (TeamMatchID, MemberID,
Report) " & _
"VALUES (" & lngTeamMatchID & ", " & lngMemberID & ", " & _
Chr(34) & strReport & Chr(34) & ")"
'cm.CommandType = CommandType.Text
If cm.ExecuteNonQuery() = -1 Then
Return True
Else
Return False
End If
End Function
The following function generates the error "Operation must use an updateable
query". There is no identifiable or meaningful error code.
This system is using OLEDB to connect to an Access database. I've tried
applying the insert statement directly to the Access database and it works
fine.
I'm not sure whether this is because the connection isn't allowing updates
or whether there's something odd about the insert statement.
Cheers...P
Public Function AddMatchReport(ByVal lngTeamMatchID As Long, ByVal
lngMemberID As Long, ByVal strReport As String) As Boolean
Dim cm As OleDb.OleDbCommand
Dim adp As OleDb.OleDbDataAdapter
Dim ds As Data.DataSet
Dim rw As DataRow
Dim strRet As String
If Me.Connection.State = ConnectionState.Closed Then
Me.Connection.Open()
End If
cm = New OleDb.OleDbCommand
cm.Connection = Me.Connection
cm.CommandText = "INSERT INTO tbTeamMatchReport (TeamMatchID, MemberID,
Report) " & _
"VALUES (" & lngTeamMatchID & ", " & lngMemberID & ", " & _
Chr(34) & strReport & Chr(34) & ")"
'cm.CommandType = CommandType.Text
If cm.ExecuteNonQuery() = -1 Then
Return True
Else
Return False
End If
End Function