Please Help, Access OLE Object Will Not Display

Results 1 to 2 of 2

Thread: Please Help, Access OLE Object Will Not Display

  1. #1
    Join Date
    Dec 1969

    Default Please Help, Access OLE Object Will Not Display

    Hello,<BR>I am using the following script to try and print out an image stored in a database. This script is from a tutorial on the net and the first image in the database can print out (ID=31) but the images I have added (ID=32 and ID=33) end up as broken images.<BR><BR>If anyone could help I would appreciate it greatly. Thanks.<BR><BR>The link to download the database is:<BR><BR><BR>The code is:<BR>&#060;%<BR> &#039; -- file.asp --<BR> &#039; Retrieves binary files from the database<BR> <BR> Response.Buffer = True<BR> <BR> &#039; ID of the file to retrieve<BR> Dim ID<BR> ID = Request("ID")<BR> <BR> If Len(ID) &#060; 1 Then<BR> ID = 7<BR> End If<BR> <BR> &#039; Connection String<BR> Dim connStr<BR> connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("FileDB.mdb")<BR> <BR> &#039; Recordset Object<BR> Dim rs<BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR> <BR> &#039; opening connection<BR> rs.Open "select [File Data],[Content Type] from Files where ID = " & ID, connStr, 2, 4<BR><BR> If Not rs.EOF Then<BR> Response.ContentType = rs("Content Type")<BR> Response.BinaryWrite rs("File Data")<BR> End If<BR> <BR> <BR> rs.Close<BR> Set rs = Nothing<BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How are you...

    retreiving multiple images.<BR><BR>It looks like you are passing one ID to this page and getting one corresponding image.<BR><BR>Also what are you achieving by setting the ID = 7 if there is no ID?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts