SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 4th, 2002, 07:04 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
JPG data from a OLE object in Access 2000

<i><b>Originally posted by : Help if only I could affor a real DB ) (peter_crabb@ntlworld.com)</b></i><br />:0)<br /><br />I have managed to extrude the binary data a picture field, but this does not just include the stored jpg. The binary data is wrapped as a OLE Object. (dam)<br /><br />Any suggestions on getting the jpg data only.<br /><br />Pete<br /><br />Some code below<br /><br />//imports and stuff<br />void Page_Load()<br />{<br /> string strConnection "Provider=Microsoft.Jet.OleDb.4.0;";<br />strConnection += @"Data Source= " + Server.MapPath("..\db\images.mdb");<br /><br />string strSQL = "SELECT PicKey, Picture FROM Images WHERE PicKey=1";<br /><br />OleDbConnection objConnection = new OleDbConnection(strConnection);<br />OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);<br />OleDbDataReader objDataReader = null;<br /><br />try<br />{<br />objConnection.Open();<br />objDataReader = objCommand.ExecuteReader();<br /><br />while(objDataReader.Read())<br />{<br />con_close.Text = "the data type = ": //objDataReader.GetDataTypeName(0);<br />Response.BinaryWrite((byte[]) objDataReader["Picture"] );<br />}<br /><br />objDataReader.Close();<br />objConnection.Close();<br />}<br />catch (Exception e)<br />{<br />//TO DO: Suggest the a black small image with exeption is generated<br />}<br />}<br /></script><br /><html><br /><body><br /><h4><br />Reading data from the connection<br /></h4><br /><asp:label id="con_close" runat="server" /><br /><br><br /></body><br /></html><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > JPG data from a OLE object in Access 2000


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway