469,150 Members | 1,951 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,150 developers. It's quick & easy.

photo in vb

82
hi all,
i have stored photo's path in my sql2000 and now in vb i have created a picture box. i want to retrieve the photo in this.
here is my sample code.
(assuming at present my database contains only one record)
dim con as new adodb.connection
dim rs as new adodb.recordset
con.connectionstring= "-----"
rs.open "select * from foto",con,2,3
command_click()
picture1= loadpicture('rs(0)')

the error says cannot find file "C:\....." whatever path i gave in my db.
cd u ppl help me solve this.
Dec 11 '06 #1
5 1163
Killer42
8,435 Expert 8TB
hi all,
i have stored photo's path in my sql2000 and now in vb i have created a picture box. i want to retrieve the photo in this.
here is my sample code.
(assuming at present my database contains only one record)
dim con as new adodb.connection
dim rs as new adodb.recordset
con.connectionstring= "-----"
rs.open "select * from foto",con,2,3
command_click()
picture1= loadpicture('rs(0)')

the error says cannot find file "C:\....." whatever path i gave in my db.
cd u ppl help me solve this.
This might sound silly, but have you checked that the path is correct? The error sounds fairly straightforward.

Another possibility, I suppose, is that it's not a supported image type for the picturebox.
Dec 11 '06 #2
sashi
1,754 Expert 1GB
hi all,
i have stored photo's path in my sql2000 and now in vb i have created a picture box. i want to retrieve the photo in this.
here is my sample code.
(assuming at present my database contains only one record)
dim con as new adodb.connection
dim rs as new adodb.recordset
con.connectionstring= "-----"
rs.open "select * from foto",con,2,3
command_click()
picture1= loadpicture('rs(0)')

the error says cannot find file "C:\....." whatever path i gave in my db.
cd u ppl help me solve this.
Hi there,

What's the format of those pictures? Make sure you are pointing at the correct physical path to be able to view pictures with the LoadPicture function, hope it helps. Good luck & Take care.
Dec 12 '06 #3
aaryan
82
Hi there,

What's the format of those pictures? Make sure you are pointing at the correct physical path to be able to view pictures with the LoadPicture function, hope it helps. Good luck & Take care.
hi all,
the image is in jpeg format. so there should be no doubt whether the picture box supports it or not. i checked the path too. it was correct. by the way is my syntax in making the picture display is correct, namely ....loadpicture('rs(0))?
Dec 14 '06 #4
Killer42
8,435 Expert 8TB
the image is in jpeg format. so there should be no doubt whether the picture box supports it or not. i checked the path too. it was correct. by the way is my syntax in making the picture display is correct, namely ....loadpicture('rs(0))?
Ah! Good point. The syntax is wrong. You are trying to load a picture called "rs(0)", which most likely doesn't exist. Try losing the quotes.
Dec 14 '06 #5
sashi
1,754 Expert 1GB
Ah! Good point. The syntax is wrong. You are trying to load a picture called "rs(0)", which most likely doesn't exist. Try losing the quotes.
Hi Killer,

I hope the case is solved as of this thread :) Take care buddy.
Dec 15 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Nick | last post: by
5 posts views Thread by Philip D Heady | last post: by
2 posts views Thread by Eric McDaniel | last post: by
2 posts views Thread by Tony WONG | last post: by
13 posts views Thread by Viken Karaguesian | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.