Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Viewing images stored by Visual FoxPro
Message
From
01/05/2003 12:47:25
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00781312
Message ID:
00783737
Views:
22
Hi Nadya,

Here is the ASP code I use to extract the photos from the database, as far as the VFP code the original APPEND GENERAL line is the only relevant VFP code.

Option Explicit

Dim id, strSQL
id = Session("Suniq")
'connection to db
Dim conn, cmd, rs
Set conn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
conn.Open "dsn", "userid", "password"
cmd.ActiveConnection = conn
'sql query
strSQL = "SELECT stuphoto FROM stuphoto WHERE suniq=" & id
cmd.CommandText = strSQL
cmd.CommandType = adCmdText

Set rs = cmd.Execute
'write the photo back to calling page
Response.ContentType = "image/bmp"
Response.BinaryWrite rs("stuphoto")
'clean up
rs.Close
conn.Close
Set conn = Nothing
Set rs = Nothing
Set cmd = Nothing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform