from
Myblob
by Joerg Buchholz
Exchange blobs (binary large objects) with MySQL databases
|
| myblob_open (user, password, server, database)
|
function ado_connection = myblob_open (user, password, server, database)
%MYBLOB_OPEN Open the connection to a MySQL database
%
% ADO_CONNECTION = MYBLOB_OPEN (USER, PASSWORD, SERVER, DATABASE)
% opens the MySQL database defined by the strings
% USER, PASSWORD, SERVER, and DATABASE.
% The returned ADO_CONNECTION is the handle
% to the created ADODB connection object.
% It is used by all subsequent MYBLOB calls.
%
% Examples:
% myblob_demo
%
% See also: myblob_demo, myblob_command, myblob_from_db, myblob_to_db, myblob_close.
% Joerg J. Buchholz, Hochschule Bremen, buchholz@hs-bremen.de
%
% Version 1.0 (2006-01-07)
% Define connection string
connection_string = [ ...
'driver=MySQL ODBC 3.51 Driver; ' ...
'server=' server '; ' ...
'database=' database '; ' ...
'uid=' user '; ' ...
'pwd=' password '; ' ...
'option=16427'];
% Instantiate ADO connection object
ado_connection = actxserver ('ADODB.Connection');
% Communicate the connection string to the connection object
ado_connection.ConnectionString = connection_string;
% Use client-side cursors.
% This is necessary for MYBLOB_TO_DB
ado_connection.CursorLocation = 'adUseClient';
% Open the connection object
ado_connection.Open;
|
|
Contact us at files@mathworks.com