Rabu, 04 Februari 2009

MySQL and BLOBs - Connection String




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





source :http://www.devarticles.com

----------------------------------------------------


Trik Gambar Bergerak

Trik Gambar-dimouse

Trik hapus pwd mysql

Trik insertin to db

Trik jadi root dilinux

Trik jam-distatus-bar

Trik Koneksi-ke database

Trik Koneksi-msql-php

Trik lihat-database-mysql

Trik membahas-fungsi-else

Trik member-area