chrisna
Posts: 15
|
Posted: 01/22/2010, 1:35 AM |
|
Dear All
I want to make a forum in my website, like codecharge sample forum
When user open a new thread page, I want that user get an avatar,
The picture for avatar set on users table in database. So user can not change it.
After make record using record builder, I insert image place for avatar called pic..
The code to give value to the pic is :
messages.pic.value = server.MapPath("portal\..\..") & CCDlookUp("picture", "memployee", "emp_id=" & DBconnection1.ToSQL(CCGetUserID(), ccstext), DBconnection1 )
And it doesn't work
Then I change pic from image to label, to know the value
From server.mappath the value is c:\inetpub\wwwroot\portal
From ccdlookup the value is \images\photos\me.jpg
After get the pic value, I change pic to image and put this value and add apostrophe
messages.pic.value = "c:\inetpub\wwwroot\portal\images\photos\me.jpg"
And it's work.
Please help me, how to add aposthrope in the code so i can load the picture as avatar
|
|
|
asoaresfil
Posts: 12
|
Posted: 01/22/2010, 1:43 AM |
|
May be you are converting emp_id to text.
Try ccsint instead of ccstext
_________________
Alcides Soares FIlho
c2b@clickstobricks.info
Clicks to Bricks
www.clickstobricks.info
|
|
|
chrisna
Posts: 15
|
Posted: 01/22/2010, 1:55 AM |
|
In my database emp_id is a text not number or autonumber
The ccdlookup and server.mappath function give a correct answer
The problem that I don't know is how to add aposthrope symbol so the answer
is put between two aposthrope.
thanks for the response
|
|
|
asoaresfil
Posts: 12
|
Posted: 01/22/2010, 2:20 AM |
|
I presume your db is ms sql.
In this case, any text value must be passed within apostrophes
='value'
In your case;
messages.pic.value = server.MapPath("portal\..\..") & CCDlookUp("picture", "memployee", "emp_id=" & "'" & DBconnection1.ToSQL(CCGetUserID(), ccstext), DBconnection1 ) & "'"
or
messages.pic.value = server.MapPath("portal\..\..") & CCDlookUp("picture", "memployee", "emp_id=" & chr(39) & DBconnection1.ToSQL(CCGetUserID(), ccstext), DBconnection1 ) & chr(39)
Try this.
{}
_________________
Alcides Soares FIlho
c2b@clickstobricks.info
Clicks to Bricks
www.clickstobricks.info
|
|
|
chrisna
Posts: 15
|
Posted: 01/22/2010, 11:12 PM |
|
Thanks, I can add double apostrophes to the value but still can not dipslay an image
Let me simply the question
I am using ms access db. I have a employee table with 3 fields,
emp_id - character
emp_nm - character
picture - character (describe the picture folder and the picture file name)
Then i make a table on a page, I add 1 label and 1 image control.
The value of label get from ccdlookup function
label1.Value = "" & CCDlookUp("emp_nm", "employee", "emp_id=" & DBconnection1.ToSQL(CCGetUserID(), ccstext), DBconnection1 )
This code work fine. The label display enployee name after user login.
So I give a same code, using CCDlookup for the image control but it doesn't work.
Please help me, how to display user images, after the user login, using ccdlookup.
Thank you in advance for your support and sorry for my bad english
|
|
|
|