MySQL
  Home arrow MySQL arrow Page 3 - MySQL and BLOBs
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

MySQL and BLOBs
By: Mike Hillyer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 76
    2004-05-18

    Table of Contents:
  • MySQL and BLOBs
  • Connection String
  • Connection Object
  • Sending Data Into the BLOB Column
  • Retreiving Data
  • Update File - We're Done!

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    MySQL and BLOBs - Connection Object


    (Page 3 of 6 )

    Now that we have a connection string, we can connect to the database. First I will give a sample of how I connect.

    Dim conn As ADODB.Connection
    Set conn = New ADODB.Connection
    conn.ConnectionString = GloConnectionString
    conn.CursorLocation = adUseClient
    conn.Open

    In the first line we create an ADODB connection object in memory and in the second line we instantiate it. The alternative syntax to this is to type:

     Dim conn As New ADODB.Connection

    While I previously recommended the 'as New' syntax, I have since learned that it slows down your code since it must check if the object is instantiated every time a reference is made to the object.

    In the second line we set the Connection String of our Connection object to the global variable we specify in the login prompt. Conversely, you can always place the connection string here. In the third line we set the connection to use client-side cursors. I have found that this setting helps to prevent a lot of problems that can pop up while programming ADO with MySQL (for more details on cursorlocation, cursortype, and locktype, see http://www.vbmysql.com/articles/cursorsandlocks.html.) In the final line we open the connection object, which we will of course have to close when we are finished with conn.close.

    More MySQL Articles
    More By Mike Hillyer


       · "mystream.Write rs!file"should be:mystream.Write rs.Fields(0).Value
     

    MYSQL ARTICLES

    - MySQL and BLOBs
    - Two Lessons in ASP and MySQL
    - Lord Of The Strings Part 2
    - Lord Of The Strings Part 1
    - Importing Data into MySQL with Navicat
    - Building a Sustainable Web Site
    - Creating An Online Photo Album with PHP and ...
    - Creating An Online Photo Album with PHP and ...
    - PhpED 3.2 – More Features Than You Can Poke ...
    - Creating An Online Photo Album with PHP and ...
    - Creating An Online Photo Album with PHP and ...
    - Security and Sessions in PHP
    - Setup Your Personal Reminder System Using PHP
    - Create a IP-Country Database Using PERL and ...
    - Developing a Dynamic Document Search in PHP ...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT