麻烦帮忙看看这个语句
Select Case Button.Key
Case "保存"
Dim conn As New ADODB.Connection
conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=database;Initial Catalog=Winnie;Data Source=192.168.18.195"
Dim rs As New Recordset
rs.Open "select max(masterid) as masterid from whovertimedetail", conn
masterid = "Over" & Mid(rs.Fields("masterid").Value, 5, 6 - Len(Right(rs.Fields("masterid").Value, 6) + 1)) & Right(rs.Fields("masterid").Value, 6) + 1
rs.Close
billdate = Format(DTPAddOverBilldate.Value, "yyyy-mm-dd")
starttime = DTPAddOverTimeStart.Value
endtime = DTPAddOverTimeEnd.Value
overtype = CobAddOverTypeSelect.Text
timecount = TxtAddOverTimeCount.Text
attender = CobAddOverEmpnameSelect.Text
operator = FrmLogin.LoginName
operatetime = Now
checker = CobAddOverCheckerSelect.Text
remark = TxtAddOverTimeRemark.Text
Sql = "insert into whovertimedetail values('" & masterid & "','" & billdate & "','" & starttime & "','" & endtime & "','" & overtype & "','" & timecount & "','" & attender & "','" & operator & "','" & operatetime & "','" & checker & "'," & "null,null,null,null,null,null,'" & remark & "')"
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=database;Initial Catalog=winnie;Data Source=192.168.18.195"
Adodc1.RecordSource = Sql
Adodc1.Refresh
End Select