473,378 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 SQLBindParameter to mark the longblob field as
SQL_DATA_AT_EXEC. That works.

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

m_ValueSize_Indicator = SQL_LEN_DATA_AT_EXEC(m_nSize);
rc = SQLBindCol( hStmt, m_nColNumber, m_CType, (unsigned
char*)(m_pNameData), m_sName.length(), &m_ValueSize_Indicator );

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
SQLBulkOperation 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 1627

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

Similar topics

2
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...
12
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...
0
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...
1
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,...
2
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...
2
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...
2
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...
16
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...
3
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.