SunQuest
 
       MySQL
  Home arrow MySQL arrow Page 2 - 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  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
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 / 67
    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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    MySQL and BLOBs - Connection String


    (Page 2 of 6 )

    Ok, now that we have configured MySQL and VB, we can move on to writing the client app. First, let's look at the connection string. The connection string is what determines how VB will connect to the server, it specifies the ODBC driver (MyODBC), the address of the server, the username and password used to connect, and the database name. In addition, the specific options used to connect are also specified. Following is the connection string I use for my application. 

     "DRIVER={MySQL ODBC 3.51 Driver};" _
                & "SERVER=127.0.0.1;" _
                & "DATABASE=test;" _
                & "UID=testuser;" _
                & "PWD=12345;" _
                & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384


    I populate the UID and PWD sections using values from my login prompt, and then store the completed connection string in a global variable stored in a module. The remainder is static and is part of a pre-built string. A quick note on the option values; the options specified include the following:

    1 - Client Can't handle the real column width being returned.

    2 - Have MySQL return found rows value.

    8 - Allow Big Values: We want the server to send out the BLOB values to our VB client (large packets), so this option must be set.

    32 - Toggle Dynamic cursor support.

    2048 - Enable The MySQL Compressed Protocol.

    16384 - Convert LongLong to Int: This just helps makes sure that large numeric results get properly interpreted.

    The 1, 2, and 32 options are taken from the ADO code sample on the MySQL website, found here.

    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-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway