asp & sql database - TechRepublic
Question
July 28, 2009 at 05:07 PM
dream_designer

asp & sql database

by dream_designer . Updated 16 years, 11 months ago

I am having issues. Maybe my code is wrong somewhere.. HELP..

<%id = Request("ad") Set objConn = Server.CreateObject ("ADODB.Connection") Set objRec = Server.CreateObject ("ADODB.Recordset") Set MyConn=server.createobject("ADODB.Connection") set filesys=CreateObject("Scripting.FileSystemObject") ' get the property id from file name set filesys=CreateObject("Scripting.FileSystemObject") Set MyFileObject=server.createobject("scripting.filesystemobject") vPath=request.servervariables("PATH_TRANSLATED") set vThisFile=MyFileObject.GetFile(vPath) key = left(vThisFile.Name,len(vThisFile.Name)-4) 'picPath="/blog_pro/images/" picPath="/blog_pro/images/" objConn.Open DSNConn MyConn.open DSNConn strSQL = "SELECT * from blog_pro WHERE author='" & id &"' and approved = 1 and removed IS NULL" Set objRec=objConn.Execute(strSQL) Set RS=MyConn.Execute(strSQL) objcount=0 %>

<% While Not objRec.EOF objcount=objcount+1 %>

This last part is where my issues are coming from but I thought if I posted the beginning too then you could maybe tell me if I am missing something up there as well.

My images will not appear – they show the correct author name, but then it is NAME%20%20.jpg

How do I fix this?

<%If filesys.FileExists(picPath & objRec("author") & ".jpg") Then%>_1.jpg” border=1><%Else%>
.jpg” width=85 height=85 border=0>
<%End If%>
This discussion is locked

All Comments