Ask a Question related to ASP, Design and Development.
-
Ron #1
Lets see if you can figure this out....
I am trying to take a field from a database and correspond that field to a
file in a folder. Here is the code I have so far. The files in the folder
have corresponding numbers but they also have letters and extentions I have
removed those now I just need to check each file with the field. I cannot
seem to get it to work. Here is the code
<%
Response.Buffer = True
Server.ScriptTimeout =500
set objFSO = CreateObject("Scripting.FileSystemObject")
'this is the folder you want to check change this to point to your folder
Set objFolder =
objFSO.GetFolder("Z:\webspace\kansas\kansasmultime dia\kansasmultimedia.com\w
ww\topekavow\housephotos\")
Set colFiles = objFolder.Files
dim dbarray()
dim rsarray()
Dim MyString, MyArray
dim dbcheck
For Each objFile in colFiles
filename=objfile.name
if right(filename,4)<>".jpg" then
else
MyString = filename
MyArray = Split(MyString, "-")
idnumber=Replace(myarray(0), "TOPEKA", "")
idnumber=Replace(idnumber, ".jpg", "")
idnumber=Replace(idnumber, "a", "")
idnumber=Replace(idnumber, "b", "")
idnumber=Replace(idnumber, "c", "")
idnumber=Replace(idnumber, "d", "")
idnumber=Replace(idnumber, "e", "")
idnumber=Replace(idnumber, "f", "")
idnumber=Replace(idnumber, "g", "")
idnumber=Replace(idnumber, "h", "")
idnumber=Replace(idnumber, "i", "")
idnumber=Replace(idnumber, "j", "")
idnumber=Replace(idnumber, "k", "")
idnumber=Replace(idnumber, "l", "")
idnumber=Replace(idnumber, "m", "")
idnumber=Replace(idnumber, "n", "")
idnumber=Replace(idnumber, "o", "")
idnumber=Replace(idnumber, "p", "")
idnumber=Replace(idnumber, "q", "")
idnumber=Replace(idnumber, "r", "")
idnumber=Replace(idnumber, "s", "")
idnumber=Replace(idnumber, "t", "")
idnumber=Replace(idnumber, "u", "")
idnumber=Replace(idnumber, "v", "")
idnumber=Replace(idnumber, "w", "")
idnumber=Replace(idnumber, "x", "")
idnumber=Replace(idnumber, "y", "")
idnumber=Replace(idnumber, "z", "")
dupcheck=dbcheck
dbcheck=idnumber
if dbcheck=dupcheck then
else
count=count+1
redim preserve dbarray(count)
dbarray(count)=dbcheck
end if
end if
next
%>
<%
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=Vowdsn"
set rs=server.createobject("adodb.recordset")
%>
<%
rssql="SELECT * FROM[ListingsResidential-Residential] where
field41<date()-14"
rs.open rssql,myconn
RESPONSE.WRITE "THESE ARE ALL RECORDS THAT ARE OLDER THAN 14 DAYS<BR><BR>"
%>
<TABLE border="1">
<TR><TD bgcolor="#c0c0c0"><h3>FIELD1</h1></TD></TR>
<%
do until rs.eof
%>
<tr><td><%
FOR X=0 TO COUNT
IF DBARRAY(X)=RS("FIELD1") THEN
ELSE
RESPONSE.WRITE RS("FIELD1") & " " & RS("FIELD41")
END IF
NEXT
%></td></tr>
<%
rs.movenext
loop
rs.close
%>
</TABLE>
<%
%>
Thanks Ron
Ron Guest
-
Acrobat lets me see through solid walls :-)
Folks, Since I joined Macdom I have a peculiar problem with Acrobat (and Preview). I wrote a lot of 3d PostScript stuff in my old SGI environment... -
LETS HELP EACH OTHER GET RICH QUICK!!!!PLEASE READ!!!!
I found this in a news group and decided to try it. A little while back, I was browsing through news groups, just like you are now and came... -
lets all bill macromedia for time wasted
Havn't been here for a while I've been learning illustrator, but know wnought to realise that it sucks for certain things, so (more fool me)... -
LETS COMPARE OPTICS
I have a canonet 28 that I was given on my 16th birthday. While I have used other cameras this has over the years been a personal favorite. Would... -
Can we co-ordinate.... lets take action..?!
Here's a thought.. everyone will need to do this... but if we all send in each of the bugs specific to each persons system/workflow..then they'll... -
Bob Barrows #2
Re: Lets see if you can figure this out....
Ron wrote:
"cannot ... get it to work" is not helpful.> I am trying to take a field from a database and correspond that field
> to a file in a folder. Here is the code I have so far. The files in
> the folder have corresponding numbers but they also have letters and
> extentions I have removed those now I just need to check each file
> with the field. I cannot seem to get it to work. Here is the code
What are the symptoms? I will not read your whole script hoping to deduce
what's going on. Tell me what the symptoms are so I can concentrate on the
relevant bits of your code.
Bob Barrows
Bob Barrows Guest
-
Randy Rahbar #3
Re: Lets see if you can figure this out....
> IF DBARRAY(X)=RS("FIELD1") THEN
What if you try... IF cstr(DBARRAY(X)) = cstr(RS("FIELD1")) THEN
Randy Rahbar Guest



Reply With Quote

