Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Viewing images stored by Visual FoxPro
Message
De
01/05/2003 12:47:25
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00781312
Message ID:
00783737
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform