Visual Basic6.0+SQL Server2000图片管理系统 第5页
5.3.1 新书订购管理
窗体界面设计如下:程序代码设计
新书添加代码如下:
Private Sub Command5_Click()
clear
Dim temp1
temp1 = Format(Now, "yyyymmdd")
Adodc2.RecordSource = "select * from newtb where 订单号 like '%" + temp1 + "%' order by 订单号"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveLast
Text1.Text = Val(Adodc2.Recordset.Fields("订单号")) + 1
Else
Text1.Text = temp1 + "0001"
End If
Adodc2.RecordSource = "select * from newtb where 是否验收=0 order by 订单号"
Adodc2.Refresh
DT1.SetFocus
End Sub
记录删除代码如下:
Private Sub Command4_Click()
If Adodc2.Recordset.EOF = False Then
c = MsgBox("您确认要删除该记录吗?", 17, "提示信息")
If c = vbOK Then
Adodc2.Recordset.Delete
Adodc2.Refresh
Else
End If
Else
MsgBox "当前数据库中已经没有可删除的记录", 64, "提示信息"
End If
End Sub
记录保存代码如下:
Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or Text10.Text = "" Or Text11.Text = "" Or Text12.Text = "" Then
MsgBox "输入的信息不能为空!", , "提示提示"
Else
Adodc2.RecordSource = "select * from newtb where 条码号='" & Text11.Text & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
MsgBox "此条码号已经存在!", , "信息提示"
Adodc2.RecordSource = "select * from newtb"
Adodc2.Refresh
Else
rs1.Open "select * from newtb where 订单号='" & Text1.Text & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
MsgBox "订单号已存在!", , "提示信息"
Else
Dim sql, temp As String
temp = "0"
sql = "insert into newtb values('" & Text1 & "','" & DT1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & DT2 & "','" & Text6 & "','" & Text7 & "'," & Text8.Text & ",'" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Text12 & "','" & Text13 & "','" & temp & "')"
cnn.Execute (sql)
MsgBox "数据保存成功!", 64, "提示信息"
Adodc2.Refresh
End If
rs1.Close
End If
End If
End Sub
5.3.2 读者借书管理
窗体界面设计如下:
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页