Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract pictures from Paradox to file

Status
Not open for further replies.

LidiaB

IS-IT--Management
Dec 7, 2010
1
US
Hi,

I have Paradox 11 installed, and I'm trying to extract some pictures from a table. The pictures are graphic type. I'm very new at ObjectPAL so from the research that I made so far I came up with this code:


method run ( var eventInfo Event )
var
tc tcursor
img graphic
cnt number
endvar

cnt = 0
if tc.open("C:\\pathtoDB\\Images.db") then
scan tc :
cnt = cnt + 1
tc.fieldValue("ImageField",img)
img.writeToFile("C:\\pathtoimages\\IMAGE_" + String(cnt) + ".jpg")
endscan
tc.close()
endif
endmethod

But I get this error:
"You have tried to use an unassigned variable. A variable must be assigned a value before you can use it."

Any ideas of what could be wrong?
Any help is greatly appreciated.

Thanks,
Lidia
 
I've been working with an unassigned variable issue for something else and noticed a few posts by Bertil either on his site (I assume he's a guy) or the db community. Run a search for paradox unassigned variable to find them.


 
Hi Lidia,

I think I can see what might be causing the error but for me to test it out it please could you share the structure of the images.db table.

Once I know what the field names are in the table I should be able to come back to you within a day or so.

Regards

Bystander
 
I have a question: These pictures are in a table and you want to import them into Paradox? In that case, why not export them to paradox or access then query them into the new file? Or import them directly into a PDx file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top