473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Retrieving an image from an access database

2
Hi everyone

For reasons best known to our IT department, my department is not allowed to use SQL. Instead we have to use Access. No problem there, except we have a need to store images into a database for security reasons. I have now spent over a day and a half trying to crack this. I know it is something to do with stripping the headers from the image held in the database. I did come across an example in c# on this site, but couldn’t convert that code into vb.net.

My current code behind page looks like this and produces gibberish

Option Strict Off
Imports System
Imports System.Web.UI

Imports System.Data
Imports System.Data.OleDb
Imports System.Configuration


Public Class PublicGuidelineList: Inherits Page

public strImage as string
Public strConnString as String = ConfigurationSettings.AppSettings("ConnectionStrin g")
public objConn as New OleDbConnection(strConnString)

Sub Page_Load(Src As Object, E As EventArgs)
If Not Page.IsPostBack

BindData()
End If
End sub

sub bindData()



strImage = "SELECT * FROM table1 "
objConn.open

' Create & execute OleDbCommand query to return records
dim ocd as OleDBCommand = New oleDbCommand(strImage, objConn)
dim myDataReader as oleDBdatareader

myDataReader=ocd.executereader()


myDataReader.read()

Response.binaryWrite(myDataReader.Item("signature" ))

objConn.close
end sub

end class

If anyone has a snippet, I would be grateful.
Jul 30 '07 #1
0 1023

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jari Dolberg | last post by:
Hi, I am looking for a solutions for the following problem, I need to access at database from within a website, from where I can retrive a specific document in the database and mailing it to...
1
by: Roman Kagan | last post by:
Hi everyone, I am successful in retrieving the image from the table (.TIF), however, the retrieved file does not work. It looks like an image file - extension, size and all, but the image is not...
0
by: alienize | last post by:
Does anyone know how i would retrieve stored images from my access database(I've stored them as OLE objects) and then bind the retrieved image to an Image Control? Also, How would i retrieve an...
6
by: Dean Slindee | last post by:
Does anybody have an actual example of retrieving an Image data type column from a SQL Server table using a dataset (not a datareader)? I would like to see the statements that would move the...
3
by: Dennis | last post by:
How can I save then retrieve an image from an access Database using VB.Net? -- Dennis in Houston
0
by: islay | last post by:
I'm trying to retrieve an image from an Access 97 database and printing it on a report. I'm using a 'System.Data.OleDb.OleDbConnection()' object to connect to the database, a...
0
by: miffer | last post by:
For reasons best known to our IT department, my department is not allowed to use SQL. Instead we have to use Access. No problem there, except we have a need to store images into a database for...
1
by: san123456789 | last post by:
Hi, Im using a MS SQL server to store images... Im creating a windows form application using C#. I need to store and retrieve images from the database. This is my code to store images: ...
2
by: shivapadma | last post by:
i have inserted the image into database using the following code String driverName = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/"; String dbName =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.