SimpleHuman
January 23rd, 2004, 08:13 AM
Hello folks,
I am struck with this secnario... lets see if any of my eCharchans has any clue to solve this issue.
I am having tiff images stored in visual foxpro 6.0 tables in memo fileds. I have to extract them and show them to user via ASP.NET pages.
I can extract the code using ADO in vb6 with this code:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.ConnectionString = "Provider=VFPOLEDB.1;" _
& "Data Source=" & path & ";Password="""";Collating Sequence=MACHINE"
cn.Open
rs.Open "select * from " & dbFile & " where seq_num='" & seq_num & "'", cn, adOpenStatic, adLockReadOnly
If rs.EOF <> True Then
getImage = rs!image1
Else
rs.Close
rs.Open "select * from " & dbFile & " where seq_num='" & seq_num & "'", _
cn, adOpenStatic, adLockReadOnly
If rs.EOF <> True Then
getImage = rs!image1
Else
getImage = vbNullString
End If
End If
rs.Close
cn.Close
and able to save it using this code:
Private Sub Save(filename As String, data() As Byte)
Dim fso As FileSystemObject
Dim ts As TextStream
Set fso = New FileSystemObject
Set ts = fso.CreateTextFile(filename, True)
ts.Write data
ts.Close
End Sub
....
Now, no matter what I try in ASP.NET its not working... can someone atleast give me a way to do this simple asp code!
Any help is much appreciated...
I am struck with this secnario... lets see if any of my eCharchans has any clue to solve this issue.
I am having tiff images stored in visual foxpro 6.0 tables in memo fileds. I have to extract them and show them to user via ASP.NET pages.
I can extract the code using ADO in vb6 with this code:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.ConnectionString = "Provider=VFPOLEDB.1;" _
& "Data Source=" & path & ";Password="""";Collating Sequence=MACHINE"
cn.Open
rs.Open "select * from " & dbFile & " where seq_num='" & seq_num & "'", cn, adOpenStatic, adLockReadOnly
If rs.EOF <> True Then
getImage = rs!image1
Else
rs.Close
rs.Open "select * from " & dbFile & " where seq_num='" & seq_num & "'", _
cn, adOpenStatic, adLockReadOnly
If rs.EOF <> True Then
getImage = rs!image1
Else
getImage = vbNullString
End If
End If
rs.Close
cn.Close
and able to save it using this code:
Private Sub Save(filename As String, data() As Byte)
Dim fso As FileSystemObject
Dim ts As TextStream
Set fso = New FileSystemObject
Set ts = fso.CreateTextFile(filename, True)
ts.Write data
ts.Close
End Sub
....
Now, no matter what I try in ASP.NET its not working... can someone atleast give me a way to do this simple asp code!
Any help is much appreciated...