Hi
vb gurus
Am developing a program that loads members information from the sql db and then loads an image of application form of that member basing on the member's check no.
The image is being loaded from another software (document management software) using the API's of that software whereby the path of the image is returned by one the method and then the image is displayed on the picture box.
Loading of data from sql DB works fine but loading of the image does not work fine, a message 'OutOfMemoryException Exception was unhandle' appears when executing the object that is supposed to hold the image and the path of the image.
Some troubleshooting tips i get is to see if have enogh memory for internal purposes and to check if am creating an array of the correct size but i dont have one.
My machine has a memory of 1 gb of RAM and has enough free space left. How do i handle this out of memory exception. Below is the sample of the code that produces an error.
Private Sub LoadImage()
'Declare objects
Dim myKoVIS, myTemplate, myDocs
Dim myFile, myFiles
Dim myDoc
Dim ImagePath As String
myKoVIS = CreateObject("Kofile.KoVIS.KoVIS")
myKoVIS.Login("sysadmin", "sysadmin")
myTemplate = myKoVIS.RetrievalTemplates("NHIF Membership Info_RD")
myTemplate.Fields("CheckNo").Value1 = Trim(txtCheckNo.Text)
myTemplate.Maxhits = 1
myDocs = myTemplate.PerformRetrieval
If myDocs.count <> 0 Then 'OutOfMemory Exception appears
'here on the myDocs object
myDoc = myDocs(1)
myFiles = myDoc.Files
myFile = myFiles(1)
ImagePath = myFile.name
PictureBox1.ImageLocation = ImagePath
End If
End Sub
Please help!