Text=yn.myrec.Fields("购买价格")
cdm.Combo2.Text=yn.myrec.Fields("影片类型")
cdm.Combo4.Text=yn.myrec.Fields("影片语言")
cdm.Combo3.Text=yn.myrec.Fields("影片格式")
cdm.txtinfo(7).Text=yn.myrec.Fields("总数")
cdm.txtinfo(5).Text=yn.myrec.Fields("出租价格")
Callyn.closedb
Callyn.opendb("select*from演员where影片编号='"&Me.txtinfo(0).Text&"'")
DoWhileNotyn.myrec.EOF
Me.lstinfo.AddItemyn.myrec.Fields("演员").Value
yn.myrec.MoveNext
Loop
Callyn.closedb
Callyn.opendb("select*from演员where影片编号='"&Me.txtinfo(0).Text&"'")
DoWhileNotyn.myrec.EOF
Me.Combo1.AddItemyn.myrec.Fields("演员").Value
yn.myrec.MoveNext
Loop
EndIf
Callyn.closedb
ElseIfMe.comsel(0).Text="导演"OrMe.comsel(0).Text="影片类型"OrMe.comsel(0).Text="影片格式"OrMe.comsel(0).Text="影片语言"Then
db="select*from影片资料where"&Me.comsel(0).Text&"='"&VBA.LCase(Me.txtselect(0).Text)&"'"
Callyn.opendb(db)
Ifyn.myrec.EOFThen
MsgBox"无此盘!!!",vbQuestion
Callyn.closedb
Else
Me.Frame1.Visible=False
Me.MSHFlexGrid1.Visible=True
SetMe.MSHFlexGrid1.DataSource=yn.myrec
Callyn.closedb
EndIf
Else
IfVBA.IsNumeric(Me.txtselect(0).Text)=TrueThen
db="select*from影片资料where"&Me.comsel(0).Text&"="&Me.txtselect(0).Text
Callyn.opendb(db)
Ifyn.myrec.EOFThen
MsgBox"无此盘!!!",vbQuestion
Callyn.closedb
Else
Me.Frame1.Visible=False
Me.MSHFlexGrid1.Visible=True
SetMe.MSHFlexGrid1.DataSource=yn.myrec
Callyn.closedb
EndIf
Else
MsgBox"请输入数字!!!",vbInformation
EndIf
EndIf
EndSub
PrivateSubtxtselect_KeyPress(IndexAsInteger,KeyAsciiAsInteger)
IfKeyAscii=13Then
Callsearch_Click(0)
EndIf
EndSub
2、main.frm
DimynAsNewyn
OptionExplicit
PrivateSubaboutmenu_Click()
load.ShowvbModal
EndSub
PrivateSubaddcd_Click()
msg="添加光盘"
cdm.ShowvbModal
EndSub
PrivateSubaddma_Click()
msg="添加管理员"
manger.ShowvbModal
EndSub
PrivateSubadduser_Click()
msg="添加新会员"
user.ShowvbModal
EndSub
PrivateSubbackup_Click()
DimbiAsBROWSEINFO'声明必要的变量
Dimrtn&,pidl&,path$,pos%,t%,SpecIn$,specout$
bi.hOwner=Me.hwnd'使对话框处于屏幕中心
bi.lpszTitle="请选择文件夹........"'设置标题文字
bi.ulFlags=BIF_RETURNONLYFSDIRS'返回文件夹的类型
pidl&=SHBrowseForFolder(bi)'显示对话框
path=Space(512)'设置字符数的最大值
t=SHGetPathFromIDList(ByValpidl&,ByValpath)'获得所选的路径
pos%=InStr(path$,Chr$(0))'从字符串中提取路径
SpecIn$=Left(path$,pos-1)
IfRight$(SpecIn,1)="\"Then
specout$=SpecIn$
Else
specout$=SpecIn$&"\"
EndIf
VBA.FileCopyApp.path&"\cd.mdb",specout$&"cd.mdb"
EndSub
PrivateSubdelema_Click()
msg="删除管理员"
manger.ShowvbModal
EndSub
PrivateSubdeleuser_Click()
msg="删除会员"
user.ShowvbModal
EndSub
PrivateSubdfer_Click()
EndSub
PrivateSubForm_Load()
IfApp.PrevInstance=TrueThen
End
EndIf
loadma.ShowvbModal
msg="销售光盘"
Me.Label1.Caption="销售光盘"
EndSub
PrivateSubForm_Resize()
IfMe.WindowState=1Then
Else
Me.Height=8130
Me.Width=11325
EndIf
EndSub
PrivateSubnvx_Click()
EndSub
PrivateSubgpcx_Click()
msg="光盘查询"
cdm.ShowvbModal
EndSub
PrivateSubLabel1_Click()
IfMe.txtselect(0).Text<>""Then
SelectCaseMe.Label1.Caption
CaseIs="销售光盘"
Callyn.opendb("select*from影片资料where影片名称='"&Me.txtselect(0).Text&"'")
yn.myrec.Fields("总数")=yn.myrec.Fields("总数")-1
Callyn.myrec.Update
Callyn.closedb
MsgBox"销售光盘成功!!!",vbInformation
CaseIs="出租光盘"
Callyn.opendb("select*from影片资料where影片名称='"&Me.txtselect(0).Text&"'")
yn.myrec.Fields("总数")=yn.myrec.Fields("总数")-1
Callyn.myrec.Update
Callyn.closedb
Callyn.opendb("select*from客户日志")
Callyn.myrec.AddNew
yn.myrec.Fields("客户姓名")=Me.txtselect(1).Text
yn.myrec.Fields("影片编号")=Me.txtinfo(0).Text
yn.myrec.Fields("借盘时期")=VBA.Date
Callyn.myrec.Update
MsgBox"出租光盘成功!!!",vbInformation
Callyn.closedb
CaseIs="归还光盘"
Callyn.opendb("select*from客户日志where客户姓名='"&Me.txtselect(1).Text&"'and影片编号='"&Me.txtinfo(0).Text&"'")
Ifyn.myrec.EOFThen
MsgBox"些用户没租盘或已还盘!!!",vbInformation
Callyn.closedb
Else
Callyn.myrec.Delete
Callyn.closedb
Callyn.opendb("select*from影片资料where影片名称='"&Me.txtselect(0).Text&"'")
yn.myrec.Fields("总数")=yn.myrec.Fields("总数")+1
Callyn.myrec.Update
Callyn.closedb
MsgBox"归还光盘成功!!!",vbInformation
EndIf
EndSelect
Else
ExitSub
EndIf
EndSub
PrivateSubmodicd_Click()
msg="修改光盘"
cdm.ShowvbModal
EndSub
PrivateSubmodima_Click()
msg="修改管理员"
manger.ShowvbModal
EndSub
PrivateSubmodiuser_Click()
msg="修改会员"
user.ShowvbModal
EndSub
PrivateSubpd_Click()'判断是否为会员
msg="查询会员"
user.ShowvbModal
EndSub
PrivateSubpd_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)'判断是否为会员
pd.ForeColor=&HFF0000
EndSub
PrivateSubquit_Click()
End
EndSub
PrivateSubsearch_Click(IndexAsInteger)
ResumeNext
Me.txtinfo(0).Text=""
Me.txtinfo(1).Text=""
Me.txtinfo(3).Text=""
Me.txtinfo(4).Text=""
Me.txtinfo(5).Text=""
Me.txtinfo(6).Text=""
Me.txtinfo(8).Text=""
Me.txtinfo(9).Text=""
Me.txtinfo(7).Text=""
Me.txtinfo(12).Text=""
Me.lstinfo.Clear
Callyn.opendb("select*from影片资料where影片名称='"&Me.txtselect(0).Text&"'")
Ifyn.myrec.EOFThen
MsgBox"没有此影片!!!",vbInformation
Callyn.closedb
Else
Me.txtinfo(0).Text=yn.myrec.Fields("影片编号")
Me.txtinfo(1).Text=yn.myrec.Fields("影片名称")
Me.txtinfo(3).Text=yn.myrec.Fields("导演")
Me.txtinfo(4).Text=yn.myrec.Fields("发行年度")
Me.txtinfo(5).Text=yn.myrec.Fields("时间长度")
Me.txtinfo(6).Text=yn.myrec.Fields("影片语言")
Me.txtinfo(8).Text=yn.myrec.Fields("影片类型")
Me.txtinfo(9).Text=yn.myrec.Fields("影片格式")
Me.txtinfo(7).Text=yn.myrec.Fields("影片介绍")
Me.txtinfo(12).Text=yn.myrec.Fields("总数")
Callyn.closedb
Callyn.opendb("select*from演员where影片编号='"&Me.tx
上一篇:
vb音像制品出租及销售管理系统(论文和程序)
下一篇:
陕西师范大学远程教育学院毕业论文