I have a table that I created on a SQL 2000 box. One of the fields has a
data type of Image. I wrote the code that gets a video file up to the
server but I'm having trouble getting it back out. Here is the code that I
am trying.
Public Sub DownloadVideo(VidName As String)
Dim DataFile As Integer
DataFile = 1
Set CNN1 = New ADODB.Connection
With CNN1
.ConnectionString = "DSN=VideoData"
.Mode = adModeReadWrite
.Open
End With
Set MyRS = New ADODB.Recordset
With MyRS
.ActiveConnection = CNN1
.LockType = adLockOptimistic
.Source = "Select * From Videos Where VideoName = '" & VidName & "'"
.CursorType = adOpenKeyset
.Open
End With
Open VideoSourceDir & VidName For Binary Access Write As DataFile
F1 = MyRS!Video.ActualSize
Chunks = F1 \ ChunkSize
Fragment = F1 Mod ChunkSize
Chunk() = MyRS!Video.GetChunk(Fragment)
Put DataFile, , Chunk()
ReDim Chunk(ChunkSize)
For I = 1 To Chunks
Chunk() = MyRS!Video.GetChunk(ChunkSize)
Put DataFile, , Chunk()
Next 'I
Close DataFile
MyRS.Close
CNN1.Close
End Sub
One of the videos that I am trying to get is 2.6 MB the other is 100MB.
When I try and pull the 100MB file I get the .ActualSize value of 7 and the
.DefinedSize is 2147483647. Right now I am on a 100mb network so I have the
chunk size set to 65536. It goes up with no problems with this chunk size.
Any solutions out there?
Tim Sapp