473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing large chunks of binary data to MySQL with ODBC

I'm having a lot of trouble writing large chunks of binary data (tests
are in the range of 16-512K, but we need support for large longblobs) to
MySQL using ODBC. Database is local on a W2K system, but I have to
support all modern Windows systems, and a variety of ODBC configurations.
(I'll be testing against multiple ODBC databases soon - but development
is against MySQL)

I've been able to adapt some example code that executes a statement
(SQLExecute) and uses SQLBindParamete r to mark the longblob field as
SQL_DATA_AT_EXE C. That works.

However I really need to use a result set (opened for update), and to
add new rows using SQLBulkOperatio n( hStmt, SQL_ADD)
This works for the normally bound fields, but fails if I bind a variable
using something like:

m_ValueSize_Ind icator = SQL_LEN_DATA_AT _EXEC(m_nSize);
rc = SQLBindCol( hStmt, m_nColNumber, m_CType, (unsigned
char*)(m_pNameD ata), m_sName.length( ), &m_ValueSize_In dicator );

where m_pNameData (and m_sName) both store the identifying name for the
"Need More Data". m_nColNumber is the column number (1). m_CType is the
C datatype constant.
The error I get is ODBC Error HY000, Native Error 4001
"[MySQL][ODBC 3.51 Driver][mysqld-4.1.10a-nt]General driver defined error"
Has anyone seen anything like this before? Any suggested solutions?

Does anyone have any sample code for using SQLBindCol and
SQLBulkOperatio n to write a new row of data to a result set that
includes a large binary field?

Thanks in advance,

Richard

--
Richard Marsden
Winwaed Software Technology, http://www.winwaed.com
http://www.mapping-tools.com for MapPoint tools and add-ins
Nov 23 '05 #1
0 1640

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1560
by: Beau E. Cox | last post by:
Hi - I have an application which is essentially 'read-only' - once the database is loaded it is only read from. So, I am trying to implement it with various indices and a table containg some large content in blob columns. I observe the max_allowed_packet setting and 'split' blobs too large among multiple rows. All is fine during testing....
12
3196
by: Jerry Weinstein | last post by:
Hi, I know about stored procedures and that they can speed up data entry via the SQL 'insert ' statement. However, one drawback to this method is that using the stored procedure still requires one to manually and individually enter each and every record to be inserted to the database before the procedure is executed. I want to circumvent...
0
771
by: Matt Weakly | last post by:
Greetings: My MySQL (4.1.0 alpha) server crashes while processing large queries from a web page (using ColdFusion 5.0): ODBC Error Code = S1000 (General error) Lost connection to MySQL server during query The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (178:2) to
1
5551
by: Guy Erez | last post by:
Hi, I'm running queries with MySql 4.0.17 that return thousands of records. Because I need to present them in GUI, I returieve the results in chunks using LIMIT, for example - get first 100, then the range 100-2000 and so on. The problem is as follows: in the first chunk, MySQL uses one strategy to fetch the results, and in the following...
2
4125
by: Sune | last post by:
Hi, Does anyone know a website with a guide on how to upload binary data to a MySQL database using ASP? I have a script that i spent a lot of hours on getting to work, but after i upgraded my MySQL server it doesn't work anymore :( I'm just getting an error from the odbc driver (upgraded from 2.5X odbc driver to 3.51X):
2
4847
by: twawsico | last post by:
I have a piece of code that needs to read the contents of a binary file (that I've created with another app) into an array of structures. The binary data in the file represents just a series of singles that correspond to those in my structure detailed below. So when I load the file, all that I know for certain is that there will be some...
2
4615
by: gauravkhanna | last post by:
Hi All I need some help for the below problem: Scenario We need to send large binary files (audio file of about 10 MB or so) from the client machine (.Net Windows based application, located outside the home network) to the Web Server and then retrieve the file back from the web server to the client.
16
7160
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain unchanged). How can I do that in Python? Claudio Grondi
3
5994
by: ist | last post by:
Hi, I am trying to get (and transfer over ASP.NET) some encrypted data from some MySQL fields. Since the data contains many unicode characters, I tried to get the data as a series of ASCII values, transfer those numeric values over ASP.NET. I had no problem doing this on my local computer, by getting the field with "cast(field as BINARY)"...
0
7532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7461
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.