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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pointers in SQL and using image control with those pointers

Status
Not open for further replies.

Trowser

IS-IT--Management
Dec 16, 2002
125
GB
Hello lads

I have a SQL 2000 server

I have lots of images in my program (resource file) but I want to move them out to make my exe smaller

Now the SQL server is on the Web and I also have web space on the web

so I have moved all my images to the webserver.

Now I want to use an Image control to show these icons but I am unable to do so

In the DB in the Icon column I have just normal test with the full adress in it
IE Type 2 lvl 5.jpg

Now I try to use the following

Set Image1.picture = loadpicture( Type 2 lvl 5.jpg)

No luck :(
so Tried

Image1.datasource= Rec!Icons

no luck either

am I not setting the pointer correctly in SQL or am I missing something in the image control

(help needed desperately 12hours to go)
 
Am I correct in understanding that you've stored the path to the file in the SQL Server DB and are trying to load the image after you query the DB? Are you sure the SQL query is returning the correct value?

Is the path stored in a TEXT column? There is no need for a text column VARCHAR should be large enough to hold the path. It can be up to 8000 characters. You probably only need about 200 at most to store the paths. Varchar will be much easier to use that TEXT columns. If you want to get the best answer for your question read faq183-874 and thread183-468158.
Terry L. Broadbent - DBA
SQL Server Page:
 
Well the column on the sql server is called Icons

It is set as nvarchar atm? (dunno what the diferance is)

the full path to a file is ( Type 2 lvl 5.jpg)

Dunno is the spaces make any differance but web browser fills them in like the following
(
as for pulling it as a Query I just pull the icon column along with the rest of the columns then use Rec!Icons to bind it to the image1.datasource

It does seem to return the path but the image icon dont like it
 
Your problem doesn't appear to be SQL Server. You should find an appropriate forum for your program and post the question there.

I'm not sure what you are using for the front-end but I would guess that a web front may not need to see the Http://www.EnBassistant.com/ portion of the path. You can often use the relative path for images. Have you tried storing just Icons/Comp Type 2 lvl 5.jpg in the DB? If you want to get the best answer for your question read faq183-874 and thread183-468158.
Terry L. Broadbent - DBA
SQL Server Page:
 
ok thanks broadbent at least that tells me the SQl aint the problem

As for the program it runs on users machines the Webserver is differant than the SQL server the Web server holds the images the SQL server holds the DB and the user holds the front end

User asks DB for info DB gives it program looks at data and is supposed to go to webserver to retirve parts of it that bit aint working
 
If the the images are stored on the web server then the relative path may work. However, I'm no expert in web programming and you really need to ask the questions in another forum. Search tek-tips for the fron-end tools you use. If you want to get the best answer for your question read faq183-874 and thread183-468158.
Terry L. Broadbent - DBA
SQL Server Page:
 
I did do first 12 pages I gave up after that :)

I will repost this in VB5-6 and the internet forumns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top