可以的建个表,其中一个字段使用IMAGE类型存储EXE文件,通过DELPHI或PB之类的开发工具做个界面,EXE文件上传到SQL服务器上相当于往表中写入一条记录,需要时让每个客户端自动下载这个文件相当于从表中读取记录。

解决方案 »

  1.   

    '从字段中读取数据,并保存为文件
    Function FieldToFile(FileName As String, fdObject As ADODB.Field) As BooleanDim lChunkCount As Long
    Dim lChunkRemainder As Long
    Dim i As Long
    Dim j As LongOn Error GoTo errHandFieldToFile = False
    If fdObject.ActualSize = 0 Then Exit Function
    ReDim Chunk(CHUNK_SIZE)
    lChunkCount = fdObject.ActualSize \ CHUNK_SIZE '获得文件的块数
    lChunkRemainder = fdObject.ActualSize Mod CHUNK_SIZE '整块后余下的数据
    j = FreeFile(0)
    If Len(Dir(FileName)) Then Kill FileName
    Open FileName For Binary As j
    ReDim Chunk(fdObject.ActualSize)StatusBar1.Panels(1).Text = "正在下载文件"
    If lChunkRemainder > 0 Then
      ProgressBar1.Max = lChunkCount + 1
    Else
      ProgressBar1.Max = lChunkCount
    End If
    ProgressBar1.Value = 0
    ProgressBar1.Visible = TrueFor i = 1 To lChunkCount
       ReDim Buffer(CHUNK_SIZE)
       Chunk() = fdObject.GetChunk(CHUNK_SIZE) '取一块
       Put j, , Chunk() '将块写入临时文件
       ProgressBar1.Value = i
    NextIf lChunkRemainder > 0 Then
       ReDim Chunk(lChunkRemainder)
       Chunk() = fdObject.GetChunk(lChunkRemainder)
       '取余下的数据
       Put j, , Chunk() '将其写入临时文件
       ProgressBar1.Value = lChunkCount + 1
    End IfClose j
    If (FileLen(FileName)) > 0 Then FieldToFile = True
    StatusBar1.Panels(1).Text = ""
    ProgressBar1.Visible = False
    Exit Function
    errHand:
    StatusBar1.Panels(1).Text = ""
    ProgressBar1.Visible = False
    MsgBox Err.Description
    Close j
    FieldToFile = False
    End Function
      

  2.   

    对,用Image类型的字段就行了。谢谢