主窗体的代码如下:
Private Sub Form_Load()
End Sub
Private Sub Menu_im_add_Click()
frm_im_add.Show
End Sub
Private Sub Menu_im_del_Click()
frm_im_del.Show
End Sub
Private Sub Menu_im_upd_Click()
frm_im_upd.Show
End Sub
Private Sub Menu_im_que_Click()
frm_im_que.Show
End Sub
Private Sub Menu_inf_add_Click()
frm_inf_add.Show
End Sub
Private Sub Menu_inf_del_Click()
frm_inf_del.Show
End Sub
Private Sub Menu_inf_upd_Click()
frm_inf_upd.Show
End Sub
Private Sub Menu_inf_que_Click()
frm_inf_que.Show
End Sub
Private Sub Menu_ex_add_Click()
frm_ex_add.Show
End Sub
Private Sub Menu_ex_del_Click()
frm_ex_del.Show
End Sub
Private Sub Menu_ex_upd_Click()
frm_ex_upd.Show
End Sub
Private Sub Menu_ex_que_Click()
frm_ex_que.Show
End Sub
Private Sub Menu_quit_Click()
Unload Me
End Sub
声明数据库的代码如下:'
保存执行SQL语句的字符串
Public SqlStmt As String
'服务器名称
Public ServerName As String
'读取表中列值的变量
Public ColVal As String
'保存药品入库信息
'Public Import As New Durg_import
'保存库存药品信息
'Public Information As New Drug_info
'保存药品出库信息
'Public Export As New Drug_export
Public objConn As New ADODB.Connection
Public objRS As New ADODB.Recordset
Public Sub OpenDB()
objConn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=药品管理系统;Data Source=YE-1DE908B5D56F"
objConn.Open
End Sub
Public Sub CloseDB()
objConn.Close
End Sub
添加药品库存信息的代码如下:
Private Sub Cmd_Add_Click()
Dim strSQL As String
OpenDB
strSQL = "Select * from Drug_info"
objRS.Open strSQL, objConn, adOpenDynamic, adLockOptimistic
objRS.AddNew
objRS.Fields(1).Value = Trim(Drug_name.Text)
'objRS.Fields(2).Value = Trim(Drug_type.Text)
objRS.Fields(3).Value = Trim(Import_price.Text)
objRS.Fields(4).Value = Trim(Export_price.Text)
'objRS.Fields(5).Value = Trim(Drug_num.Text)
objRS.Fields(6).Value = Trim(Import_time.Text)
objRS.Fields(7).Value = Trim(Prodcom.Text)
'objRS.Fields(8).Value = Trim(Prodplace.Text)
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页