Source language: Translate to:

Import & export records and images from MDB database

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Import & export records and images from MDB database

Postby smartmedia » Thu Apr 16, 2009 10:51 am

Hi..

I created a demo pub that shows how to import and export records and images from MDB database.
Export is working 100% but i am facing problems on import code.
If someone can help.

http://rapidshare.com/files/222049503/demo.rar
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Mon Apr 20, 2009 2:16 pm

I ran your pub and, you're right, the export works, but the import doesn't. To fix the problem, change the import button's script to:

FileOpenBox "ÅéóáãùãÞ åããñáöþí" "Áñ÷åßá CSV|*.csv" "[PubDir]" "[SelImportDir]" ""
If "[SelImportDir]" ">" ""
dbpImportFromCSV "Data" "Products" "[SelImportDir]" "Delimiter=,;ContainsFieldNames=Yes;MatchFieldNames=Yes"
ExtractFilePath "[SelImportDir]" "[FilePath]"
FileLen "[FilePath]Images\ListOfImages.txt" "[G3U9L0]"

dbpFirst "data" "products"
Loop "1" "[G3U9L0]" "[LoopPos]"
FileRead "[FilePath]Images\ListOfImages.txt" "[LoopPos]" "[ImageToBeInserted]"
dbpExecSQL "Data" "SELECT * FROM Products WHERE PhotoId='[ImageToBeInserted]';" "Data"
SetVar "[Data.Products.Photo]" "[FilePath]Images\[ImageToBeInserted].jpg"
dbpSaveEdits "Data" "Products"
dbpNext "data" "products"
endloop
endif

New lines are in bold.

Note: This script is hard coded for jpeg files, so if the user selects a different kind of image format it won't work.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
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 2 guests