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

Ask a Question related to ASP, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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)...
    4. 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...
    5. 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...
  3. #2

    Default Re: Lets see if you can figure this out....

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


    Bob Barrows Guest

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139