⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 noname1.vbs

📁 自己做的一个商品销售信息管理的程序。 VB新手
💻 VBS
字号:
学院信息
Private sub form_load()
 me.height=6675
 me.width=8070
 me.move(frmmain.scalewidth-me.width)\2,(frmmain.scaleheight-me.height)\2
 adodc1.connectionstring=ascmdtable
 adodc1.recordsource="学院信息"
 adodc1.refresh
set datagrid1.datasource=adodc1.recordset
end sub
专业信息
private sub form_load()
me.height=3600
me.width=4725
me.move(frmmain.csalewidth-me.width)\2,(frmmain.scaleheight-me.height)\2
adodcZYXX.connectionstring=constr
asodcZYXX.commandtype=adcmdtable
adodcZYXX.recordsource="专业信息"
adodcZYXX.refresh
set dataGrid1.datasource=adodcZYXX.recordset
end sub
cmbXY列表框时间代码
private sub cmbXY_change
set cmbZY.rowsource=query("select * from 专业信息 where 学院="+cmbXY+"")
cmbZY.listfield="专业代码"
end sub
取消按钮
private sub cmdOK_click()
 if cmbXY.text<>""and cmbXQ.text<>""and cmbZY.text<>""then 
    frmKCAP.xybh=cmbXY.text
	frmKACP.xq=cmbXQ.text
	frmKACP.zy=cmbZY.text
	unload me
	frmKACP.show
end if
end sub 
窗体的Load事件

private sub form_load()
cmbXY.listfield="学院编号"
end sub
定义全局变量
public xybh as string,xq as string, zy as string
AdodcKCP 的Move_Complete事件
private sub adodcKCAP_movecomplete(byval as reason as adodb.eventreasonenum,byval perror as adodb.error,asstatus as adodb.eventstatusenum,byval precordset as adodb.recordset
 if not recordsetisempty(precordset) then
  txtkcbh=precordset!课程编号
  txtkcmc=precordset!课程名称
  txtxf=precordset!学分
  cmbxz=precordset!性质
  txtbz=precorset!备注
  end if
  end sub
  ”添加“按钮的单击事件
  private sub cmdadd_click()
  on error goto adderr
  callprocnorecordset"sp_addkc('"+xybh+"','"+xy+"','"+xq+"','"+txtkcbh"','"+txtkcmc"',"+txtxf+",'"+cmbxz+"','"+txtbz+"'
  adodckcap.refresh
  set datagrid1.datasource=adodckcap.recordset
  exit sub
  adderr:
  magbox err.description
  end sub
  '删除'按钮的单击事件
  private sub cmddelete_click()
  if recordsetisempty(adodckcap.recordset) then exit sub
  if msgbox("真的确定删除吗?",vbyesno)=vbyes then
   adodckcap.recordset.delete
   adodckcap.refresh
   set datagrid1.datasource=adodckcap.recordset
   end if
   end sub

   
   '修改'按钮的单击事件
   private sub cmdmodify_click()
   on error goto modierr
   callprocnorecordset "sp_addkc('"+xybh+"','"+xy+"','"+xq+"','"+txtkcbh"','"+txtkcmc"',"+txtxf+",'"+cmbxz+"','"+txtbz+"'
   adodckcap.refresh
   set datagrid1.datasource=adodckcap.recordset
   exit sub
   modierr:
   msgbox err.description
   end sub
   窗体Load事件
   private sub form_load()
   me.height=6885
   me.width=9200
   me.move(frmmain.scalewidth-me.width)\2,(frmmain.scaleheight-me.height)\2
   fram31.caption=getxymc(xybh)+""+getzymc(xybh,zy)+""+xq+""
   adodckcap.connectionstring=constr
   adodckcap.commandtype=adcmdtext
   adodckcap.recordsource="select 课程编号,课程名称,性质,学分,备注 from 课程安排 where 学院='"+xybh+"' and 学期='"+xq+"'"
   adodckcap.refresh
   set datagrid1.datasource=adodckcap.recordset
   end sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -