文件名称:饭店点菜系统vb
文件大小:9.52MB
文件格式:RAR
更新时间:2014-11-21 16:11:21
饭店点菜 visual basic
漂亮的界面,可执行的代码 菜谱管理: Dim cnn As New ADODB.Connection Dim rsImage As New ADODB.Recordset Dim Chunk() As Byte Dim lngLengh As Long Dim intChunks As Integer Dim intFragment As Integer Const ChunkSize = 1000 Const lngDataFile = 1 Dim sql As String Private Sub back_Click() End Sub Private Sub Command1_Click(Index As Integer) Set DataGrid1.DataSource = Nothing sql = "delete * from huncai where cname='" & (Text1(2).Text) & "'" cnn.Execute sql MsgBox ("成功删除信息") Adodc1.Recordset.Update Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 End Sub Private Sub Command2_Click() End End Sub Private Sub Command3_Click() If Text3.Text = "" Or Text4.Text = "" Then MsgBox ("请输入完整信息!") Else sql = "insert into huncai(sort,cname,price) values ('" & (Combo1.Text) & "' ,'" & (Text3.Text) & "' ,'" & Val(Text4.Text) & "')" If Trim(txtFilePath.Text) = "" Then MsgBox "未选择文件.!!", vbInformation + vbSystemModal, "保存出错" Exit Sub End If Open Trim(txtFilePath.Text) For Binary Access Read As lngDataFile lngLengh = LOF(lngDataFile) ' 文件大小 If lngLengh = 0 Then Close lngDataFile: Exit Sub intChunks = lngLengh \ ChunkSize intFragment = lngLengh Mod ChunkSize '新建记录 rsImage.AddNew ReDim Chunk(intFragment) Get lngDataFile, , Chunk() rsImage!picImage.AppendChunk Chunk() ReDim Chunk(ChunkSize) For i = 1 To intChunks Get lngDataFile, , Chunk() rsImage!picImage.AppendChunk Chunk() Next i rsImage.Update Close lngDataFile Call ShowPic cnn.Execute sql Adodc1.Refresh MsgBox ("添加成功!") End If End Sub Private Sub cmdBrowse_Click() On Error Resume Next With cmdlFilePath .Filter = "JPG Files|*.JPG|Bitmaps|*.BMP" .ShowOpen txtFilePath.Text = .FileName End With 'Picture1.Picture = LoadPicture(FileName) End Sub Public Sub ShowPic() On Error Resume Next Open "pictemp" For Binary Access Write As lngDataFile lngLengh = rsImage!picImage.ActualSize intChunks = lngLengh \ ChunkSize intFragment = lngLengh Mod ChunkSize ReDim Chunk(intFragment) Chunk() = rsImage!picImage.GetChunk(intFragment) Put lngDataFile, , Chunk() For i = 1 To intChunks ReDim Buffer(ChunkSize) Chunk() = rsImage!picImage.GetChunk(ChunkSize) '建立图片临时文件 Put lngDataFile, , Chunk() Next i Close lngDataFile FileName = "pictemp" Picture1.Picture = LoadPicture(FileName) End Sub Private Sub Command4_Click() Me.Hide Form7.Show End Sub Private Sub Command5_Click() Set DataGrid1.DataSource = Nothing Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 Set Text1(0).DataSource = Adodc1 Set Text1(2).DataSource = Adodc1 Set Text1(3).DataSource = Adodc1 End Sub Private Sub Form_Load() Text1(0).Text = "" Text1(2).Text = "" Text1(3).Text = "" rsImage.LockType = adLockOptimistic rsImage.CursorType = adOpenKeyset cnn.Provider = "Microsoft.Jet.OLEDB.4.0" sql = "F:\课程设计\数据库\菜谱.mdb" cnn.Open sql sql = "Select * From huncai" rsImage.Open sql, cnn If (rsImage.BOF = True) And (rsImage.EOF = True) Then Exit Sub End Sub
【文件预览】:
课程设计-vb
----程序设计()
--------picturetemp.tmp(1B)
--------Form5.frm(5KB)
--------Form3.frx(72KB)
--------Form10.frx(88KB)
--------Form7.frx(2.95MB)
--------Form6.frm(6KB)
--------Form4.frm(5KB)
--------Form4.frx(138KB)
--------Form5.frx(70KB)
--------Form1.frm(4KB)
--------工程1.vbp(1KB)
--------Form6.frx(178KB)
--------Form3.frm(17KB)
--------Form1.frx(91KB)
--------Form9.frm(10KB)
--------数据库()
--------MSSCCPRJ.SCC(190B)
--------Form8.frm(6KB)
--------Form2.frx(223KB)
--------Form7.frm(3KB)
--------组1.vbg(39B)
--------Form8.frx(88KB)
--------Form9.frx(87KB)
--------Form2.frm(22KB)
--------Form10.frm(3KB)
--------工程1.vbw(478B)
--------pictemp(1B)
--------图片()
----实验报告.docx(1.96MB)
----~$实验报告.docx(162B)