Lets see if you can figure this out....

R

Ron

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\kansasmultimedia\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
 
B

Bob Barrows

Ron said:
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

"cannot ... get it to work" is not helpful.

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
 
R

Randy Rahbar

IF DBARRAY(X)=RS("FIELD1") THEN

What if you try... IF cstr(DBARRAY(X)) = cstr(RS("FIELD1")) THEN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top