• WSsteve_skelton13

    WSsteve_skelton13

    @wssteve_skelton13

    Viewing 15 replies - 826 through 840 (of 895 total)
    Author
    Replies
    • in reply to: Bubble-sort on a single Recordset row #673069

      I’m trying to get to this approach, actually but it’s going in baby steps. I’m having trouble just being able to walk thru the fields in the 1row recordset – I keep EOF/BOF True errors all the time, even if I test for EOF and explicitly call RecordSet.MoveFirst. I can grab the data using code like this:


      If Not Result.EOF then

      Response.Write “

      ” & _

      i=0
      for each fldF in Result.Fields
      Item = fldF.Name

      ItemLength = len(Item)
      ItemLengthTrim = ItemLength – 11
      ItemName = Left(Item, ItemLengthTrim)

      j = i mod 3
      if j = 0 then
      response.write “


      else
      response.write “


      end if
      i = i + 1

      next
      response.write “

      ” & _

      Referring Agencies

      ” & ItemName & ” ” & fldF.Value & “ ” & ItemName & ” ” & fldF.Value & “


      response.write “



      end if

      But when I try to load the array using very similar code I only get the first field and then BOF – EOF error. Here’s the array loading code:


      Query = “SELECT * from SumReferringAgencies;”
      Set Result = DataConnection.Execute(Query)

      If Not Result.EOF then
      Result.MoveFirst
      end if

      Dim Referring(35)
      Dim ReferringName(35)

      Count = 1
      For Each fldF in Result.Fields
      Referring(Count) = fldF.Value
      Response.Write Referring(Count) & ““”
      ReferringName(Count) = fldF.Name
      Response.Write ReferringName(Count) & “
      “”
      Result.MoveNext
      Count = Count + 1
      next

      I don’t know what exactly is causing the problem but part of it has to do with using the correct method for calling the Field NAME or the Field VALUE. If I try Do While not Result.EOF the fldF.Name/Value variables don’t function at all. Here’s similar, working array-loading code for a SQL Server:

      Count = 0
      Do While Not Result.EOF
      Referring(Count) = Result.Fields(1)
      Referring_Name(Count) = Result.Fields(0)
      Result.MoveNext
      Count=Count+1
      LOOP

      The bold sections seem to be where you can reference the value or name of a recordset field in SQL Server. Perhaps there is a different method for Access?

    • I’m not terribly worried about getting Nulls back in as the db will only be accessed from a web form — and every time a new record is created (via INSERT) 0’s will be put in all the appropriate fields. obviously, *I* could muck things up during development but once it’s in production db interaction will be limited to report generation and archiving out old data. Unless the form itself changes and data elements get changed or removed.

      I do find it a little odd that SUM doesn’t function if there are null values in fields. How can Null ever be counted in a sum? Also, the problem seems more persistent when field type is set to Numeric. I have some other fields that may or may not have null values but SUM seems to work with a number in a column and the field type set to text. It’s a little hard to test because you can’t tell by looking if a cell is Null or simply blank.

    • the table was also changed to make the data number type with default to 0 so all new data will not be null. “” I suppose.

    • thanks for the reply. yes, that seems to be the problem. i went to the source table and added zeros and now the second sum query works. huh! pesky nulls.

    • in reply to: A little form validation #671307

      i don’t think that’ll work, simply because radio buttons are like checkboxes: unless they are checked, no value is passed and you can’t validate for them. I tried to do this using the following code: document.form.radio(20).checked != True and nothing happened. perhaps I am missing something here as in the right way to reference a form element in the DOM syntax.

      in this case, I don’t want to set a default. but, I thought this would be a problem and I told the person requesting this functionality that it might not be possible. i suppose this makes sense: like checkboxes, radio buttons represent optional data and you’d expect that sometimes a user wouldn’t need to select one. If I replace the data element with a drop-down box I have to set a default value anyway as drop-downs don’t permit a blank value as a default. so, I just put in a test line in the preview.asp page to notify the user that they have not indicated a Yes or No on the question. For my purposes, this also works.

      BTW, is there an issue using more than one javascript function for ONSUBMIT? I find that the validation code doesn’t fire if I put more than one ONSUBMIT parameter in the block.

    • in reply to: Compare Dates in ASP #671039

      thanks. CDate did the trick!

    • in reply to: Website Analyzer #670813

      there is also this excellent tool:

      http://bobby.watchfire.com/bobby/html/en/index.jsp%5B/url%5D

      for examining your site for disability compatibilities. for those of you working on a development webserver with no ‘real’ internet presence, they provide a java app that allows you to scan and evaluate local pages.

    • in reply to: Adding a .chm help file to Word #665358

      boy this is an old thread! i can’t even find the project i was working on that spawned the original inquiry and the whole issue is basically moribund for me. if memory serves, I didn’t like the nag screens and decided the added help file wasn’t going to be as helpful as i thought so just dropped the whole thing.

    • in reply to: Write HTML Table data db #663759

      worked perfectly! thanks. cheers

      don’t know why but i do enjoy this sort of thing. must have gotten dropped on my head when young… bash

    • in reply to: Lots of problems ASP – Access Insert Record code #663459

      I got this hint about using the code &H00000080 instead of a ADOVBS.INC derived named constant from this excellent article from an excellent resource:

      http://www.aspfaq.com/show.asp?id=2191%5B/url%5D

      Using the constant rather than rhe named argument adExecuteNoRecords means you don’t need to append the include file and that reduces overhead by some small amount. In my case, I am implementing a series of web-based forms and may have to do several reads/writes to a (yecch) ACCESS database, so I am concerned with making the code as lean as possible and keep overhead in page processing low. I don’t know if there’s much of a problem with the include file but, all things considered, if you don’t need a lot of named constants to maintain a page, I don’t see why you shouldn’t use the direct constant. You can always put in a comment line defining what the constant does. It’s a programming style issue, ultimately.

      I tend to agree with the preference to use the ADOVBS file rather than msoado15.dll in terms of how much control you have over the public webserver. in my case, I have no control over it and the people that do took 3 weeks to reinstall and configure CDONTS on the box after a serious crash. don’t want to rely on them to set up anything customizeable for my needs. So, DNS-less connections certainly, and ADOVBS.INC if necessary.

      Oh, and also: I was very happy to fun into the http://www.aspfaq.com[/url%5D site as the person running it does a great job in discussing ASP problems and solutions and, better still, hasn’t cluttered things up with buzzwordy ASP.NET articles that are useless for my needs. check it out!

    • in reply to: Lots of problems ASP – Access Insert Record code #662963

      I don’t use an include in this case as the db is specific to the task at hand, but I don’t think that’s much of an issue. I think the .asp page must be corrupted in some way. Here’s what I’ve done since last posting:

      Created a new page with just the connection information to open the target db, read and print a single field. It works. The original, bad, page, bombs using good connection strings. both the new good .asp and the old bad .asp pages are in the same folder. perhaps something in the rest of the coding is causing a problem, but i don’t see how as the .asp should process in order of the file itself.

      Well, now that I have a .asp page that actually finds, opens and reads from the db in the MDB folder, I will start porting in the rest of the code and keep testing.

      new information

      I found the offending code: DataConnection.execute(mySQL)

      I can open, read and print data from the mdb but when .asp tries to run the above code it fails with the usual errors. Obviously this isn’t working but not sure what to use to run the INSERT SQL string. any suggestions?

      PROGRESS

      ‘peers that I needed to set read/write permission to the Access file to get it to update. I am now inserting willy-nilly. On to fine-tuning an attempt to dynamically create valid SQL strings… The Dataconnection.execute is not offensive and, from another web page I got this:

      DataConnection.execute mySQL, , &H00000080 which works — the bit of coding at the end is a way to specify a record insert without having to declare DataConnection.AddNew & is supposed to be faster than relying on Command coding or the ADOVBS.INC file.

    • in reply to: Lots of problems ASP – Access Insert Record code #662943

      The suggested change on the DataConnection string makes no difference. There seems to be something wrong with the .asp page itself. I have other pages that use the DataConnection string with the ‘bad’ slash usage and I am getting smooth connections and reads from .mdb files in the same folder. Stranger still, if i copy the code connection block from a working .asp page into the one I am trying to cure, I get the same error message looking for the .mdb file in the path C:WINNTsystem32 — so .asp connect works perfectly in one folder on the web server and gives me errors in another folder. both folders are set in IIS to allow script address and are assigned as application nodes.

      What in the world is going on?? I checked page options and both Good .asp page and Bad .asp pages are exactly the same. .asp almost seems like it is trying to find a System DSN. Strange. I am stuck at this point and can’t test for successful INSERTS to a db that refuses to be found or, if you go ahead and put it where the system insists on looking for it, it can’t be opened.

      sigh… brickwall

      as to the other problem with some code working on one page but not on another: my bad! I forgot to embed the code in a loop so it wasn’t exactly the same and was working fine, in the sense of not doing anything at all. programming in the evening can be dangerous.

    • in reply to: auto-listing all Form elements #662145

      aha! makes sense. now i have to do a lot of clicking but c’est la vie.. or, as they say *these* days, c’est la guerre [may be mispelled there]

    • in reply to: auto-listing all Form elements #662142

      I could but it’d be boring. I have a table with various checkboxes such as:

      Private Organization

      Just generic checkbox, input boxs, drop-down boxes, etc. Furthermore, I have a dynamically-generated table on another page that writes a table base on the number of lines needed to input and the form elements are auto-named with .asp so I can’t rely on any hard-coding for that part at least. (actually the .asp code I discussed in the first post does find and list the items in the dynamic table, but there are no checkboxes in it…)

      The crux of the matter is this: the code

      <%
      For Each item In Request.Form
      Response.Write(item) & "
      Next
      %>

      Finds and lists the NAMES of drop-downs, text boxes and submit/reset buttons but NOT checkboxes. The html code for a textbox is:

      the html for a checkbox is:

      Private Organization

      Why my little asp loop skips the checkbox input type is the mystery. I’m thinking there’s some kind of keyword to make asp find checkboxes.

    • thanks – worked beautifully.

    Viewing 15 replies - 826 through 840 (of 895 total)