Source language: Translate to:

Insert into an image field...

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Insert into an image field...

Postby David de Argentina » Tue Jan 03, 2012 1:51 pm

Hi Dave,

I'm doing a complex program with this scenario:

There are a remote MySQL database as server

There are a local Access database as client

Both databases has the same table, "Users"

Users table has a field "Image" (Blob on MySQL, Ole Object on Access)

I'm performing a dbpExecSQL in order to get a Users Table recordset from the MySQL database.

Then, i check if each record exists on the Access Users Table.

If record does not exists, i insert this record.

Everything is ok, except when i do...

Code: Select all
dbpExecSQL "Local" "Insert into Users (... , ImageField, ...) Values (..., '[remote.Users.ImageField]'...)" ""

The image is not inserted. not error, but not image.

the another option:

Code: Select all
dbpAddRecord "Local" "Users"
...
Setvar "[Local.Users.Image]" "[Remote.Users.Image]"
...
dbpSaveEdits "Local" "Users"


works fine, but is too slow...

Any ideas ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby fieldhopper » Tue Jan 03, 2012 11:46 pm

Code: Select all
Code:
dbpExecSQL "Local" "Insert into Users (... , ImageField, ...) Values (..., '[remote.Users.ImageField]'...)" ""



May be you have to use :
insert into user as select * from other

That is another way to transport from one database to the other.
Regards fieldhopper

____________________________________________________
Es sind schon viele erfroren, aber noch keiner ist ermieft.
____________________________________________________
User avatar
fieldhopper
 
Posts: 121
Joined: Sun Mar 09, 2008 11:39 am
Location: Germany

Postby Neosoft Support » Wed Jan 04, 2012 11:46 am

dbpExecSQL won't work here. The variable associated with the blob field [remote.Users.ImageField] doesn't contain the actual image data, just the name of a temp file where the image data is stored. The dbpAddRecord + Setvar + dbpSaveEdits is slow because it's actually copying the image data between the two databases.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest