AddNew 函数 VBA 是否类似于 Insert into 子句 c#?
VBA
Set RsTrt = New ADODB.Recordset
RsTrt.Open "Select * from TblSysRecordTrt ORDER BY trtName,Trtdate DESC", aaDbConnect(), adOpenStatic, adLockOptimistic
Function AddTrt(StrName As String, strdesc As String, DtTrt As Date, StrUser As String) As Boolean
On Error GoTo ErrAdd
With RsTrt
.AddNew
.Fields("trtName") = StrName
.Fields("trtDesc") = strdesc
.Fields("TrtDate") = DtTrt
.Fields("TrtUser") = aaUser()
.Update
End With
AddTrt = True
FinAdd:
Exit Function
ErrAdd:
AddTrt = False
Resume FinAdd
End Function
C#
public static bool AddTrt(string StrName, string strdesc,DateTime DtTrt , string StrUser)
{
}