Problem with "image" data type

Problem with "image" data type

Post by Tracer Ton » Thu, 21 Mar 2002 23:14:39


Hello

I have a type conversion problem. Or maybe it's a COM problem.
I want to copy a table from MS SQL Server over to a MS Access table.
Everything is going just fine, until I now encounter
a field in the SQLServer table with data type "image". I'm working in C++
and ADO, but answers from VB programmers are welcome.

I work like this:

AccessTable->AddNew();
GetADOField(AccessTable, "A1")->Value =
DoubleVal(GetADOField(SQLServerTable, "A1")); // This works fine
GetADOField(AccessTable, "Category")->Value =
LongVal(GetADOField(SQLServerTable, "Category")); // This works fine
.
.
AccessTable->Update();

But how to make it for the image? There must be more choices (other than
"LongVal", "DoubleVal"...) that applies to an image, but I can't find it
anywhere.
I saw the AppendChunk function, is this the way to go? In that case, how do
I use it?

In MS Access the corresponding data type for the "image" is "ActiveX data
object". I think it's correct.

Thankful for any help!

Best Regards / Per

 
 
 

Problem with "image" data type

Post by Tibor Karasz » Fri, 22 Mar 2002 01:07:53


Tracer,

Search MSDN, and you'll find code examples for how to use AppendChunk (you read/add the data in
chunks, in a loop). Or with MDAC 2.6, you can use a stream object, where you don't have to do
the loop yourself. Again, samples on MSDN.

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...


> Hello

> I have a type conversion problem. Or maybe it's a COM problem.
> I want to copy a table from MS SQL Server over to a MS Access table.
> Everything is going just fine, until I now encounter
> a field in the SQLServer table with data type "image". I'm working in C++
> and ADO, but answers from VB programmers are welcome.

> I work like this:

> AccessTable->AddNew();
> GetADOField(AccessTable, "A1")->Value =
> DoubleVal(GetADOField(SQLServerTable, "A1")); // This works fine
> GetADOField(AccessTable, "Category")->Value =
> LongVal(GetADOField(SQLServerTable, "Category")); // This works fine
> .
> .
> AccessTable->Update();

> But how to make it for the image? There must be more choices (other than
> "LongVal", "DoubleVal"...) that applies to an image, but I can't find it
> anywhere.
> I saw the AppendChunk function, is this the way to go? In that case, how do
> I use it?

> In MS Access the corresponding data type for the "image" is "ActiveX data
> object". I think it's correct.

> Thankful for any help!

> Best Regards / Per


 
 
 

1. Problem with "image" data type

Hello

I have a type conversion problem. Or maybe it's a COM problem.
I want to copy a table from MS SQL Server over to a MS Access table.
Everything is going just fine, until I now encounter
a field in the SQLServer table with data type "image". I'm working in C++
and ADO, but answers from VB programmers are welcome.

I work like this:

AccessTable->AddNew();
GetADOField(AccessTable, "A1")->Value =
DoubleVal(GetADOField(SQLServerTable, "A1")); // This works fine
GetADOField(AccessTable, "Category")->Value =
LongVal(GetADOField(SQLServerTable, "Category")); // This works fine
.
.
AccessTable->Update();

But how to make it for the image? There must be more choices (other than
"LongVal", "DoubleVal"...) that applies to an image, but I can't find it
anywhere.
I saw the AppendChunk function, is this the way to go? In that case, how do
I use it?

In MS Access the corresponding data type for the "image" is "ActiveX data
object". I think it's correct.

Thankful for any help!

Best Regards / Per

2. where is Sybase in Austin TX?

3. CRYSTAL REPORT WITH DBF

4. Type "Image" in SQl Server 7

5. thanks for reference suggestions

6. Comparing Columns of type "Image"

7. Developing Windows Apps

8. Getting "Image" Data into SQL Server

9. "Image Data"

10. insert images in a field "image"

11. max of ("...","...","..")

12. Who can deal "LONG" data type