• 博客(0)
  • 资源 (1)

空空如也

饭店点菜系统vb

漂亮的界面,可执行的代码 菜谱管理: 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

2011-11-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除