|
| |
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
Ugh, any clue as to why this doesnt work? - 12/4/2003 14:00:00
I have no clue why this doesn work, maybe you gurus can help. when the code: <% ' ' ' ' declare all the variables DIM SQL, objRS, objConn, strConn, strID DIM strTo1, strFrom1, strDate1, strPickticketCtrlNo, strToteColor, strQTY, strPartNo, strLocation DIM strDescription, strNotes, strResolution, strSignature, strDateCompleted ' ' ' ' pull all the data from the previous page strID = Request.Form("ID") strTo1 = Replace(Request.Form("To1"), "'", "''") strFrom1 = Replace(Request.Form("From1"), "'", "''") strDate1 = Replace(Request.Form("Date1"), "'", "''") strPickticketCtrlNo = Replace(Request.Form("PickticketCtrlNo"), "'", "''") strToteColor = Replace(Request.Form("ToteColor"), "'", "''") strQTY = Replace(Request.Form("QTY"), "'", "''") strPartNo = Replace(Request.Form("PartNo"), "'", "''") strLocation = Replace(Request.Form("Location"), "'", "''") strDescription = Replace(Request.Form("Description"), "'", "''") strNotes = Replace(Request.Form("Notes"), "'", "''") strResolution = Replace(Request.Form("Resolution"), "'", "''") strSignature = Replace(Request.Form("Signature"), "'", "''") strDateCompleted = Replace(Request.Form("DateCompleted"), "'", "''") ' ' ' ' create sql statement SQL = "UPDATE ""details"" SET " SQL = SQL & "To1 = '" & strTo1 & "'" SQL = SQL & ", From1 = '" & strFrom1 & "'" SQL = SQL & ", Date1 = #" & strDate1 & "#" SQL = SQL & ", PickticketCtrlNo = '" & strPickticketCtrlNo & "'" SQL = SQL & ", ToteColor = '" & strToteColor & "'" SQL = SQL & ", QTY = '" & strQTY & "'" SQL = SQL & ", PartNo = '" & strPartNo & "'" SQL = SQL & ", Location = '" & strLocation & "'" SQL = SQL & ", Description = '" & strDescription & "'" ' ' ' ' ' if Notes has data then add Notes ' ' ' ' to the sql statement IF strNotes <> "" THEN SQL = SQL & ", Notes = '" & strNotes & "'" END IF ' ' ' ' ' if Resolution has data then add Resolution ' ' ' ' to the sql statement IF strResolution <> "" THEN SQL = SQL & ", Resoultion = '" & strResoultion & "'" END IF ' ' ' ' ' if Signature was checked then add Signature ' ' ' ' to the sql statement IF strSignature <> "" THEN SQL = SQL & ", Signature = '" & strSignature & "'" END IF ' ' ' ' if DateCompleted was checked then add DateCompleted ' ' ' ' to the sql statement IF strDateCompleted <> "" THEN SQL = SQL & ", DateCompleted = #" & strDateCompleted & "#" END IF ' ' ' ' finish the sql statement SQL = SQL & " WHERE ID = " & strID & "" ' ' ' ' creates a connection object Set objConn = Server.CreateObject("ADODB.Connection") ' ' ' ' identifies the database and tells the computer where to store the data strConn = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("../fpdb/whcomm.mdb") ' ' ' ' opens the database objConn.Open strConn ' ' ' ' creates the recordset Set objRS = Server.CreateObject("ADODB.Recordset") ' ' ' ' executes the sql statement Set objRS = objConn.Execute (SQL) ' ' ' ' clears the memory buffer Set objRS = Nothing Set objConn = Nothing %> runs i get the error message: Microsoft OLE DB Provider for ODBC Drivers error '80040e10' [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. /NewWarehouseCommunicator/functionpick2.asp, line 82 any suggestions?
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 14:02:05
If I leave the fields for Notes or Resolution blank it works, the data passes through and the Signature & Date Completed fields post fine. If I put any data in the Notes or Resolution fields I get the error message I just posted. I'm so confused. I didn't write any of this, the person before me wrote this end of this mess and I'm trying to sort out what went wrong. Kage
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 14:24:51
It goes through now, but the resolution and notes do not post. I think i'm going to try the gasoline and match trick next.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 14:59:06
quote:
IF strNotes <> "" THEN For Resolution and Notes you could try this: IF Len (strNotes) <> 0 THEN IF Len (strResolution) <> 0 THEN
_____________________________
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:14:06
what would Len change?
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:18:19
It's looking to see if there is a string length to the value in these fields, or if it's 0. If it's 0, then there is no value. Just another way of checking for NULL.
_____________________________
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:18:53
Also, is there a way to add sort functionality to results that are generated? Something I can change on the page that comes up?
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:23:48
Did Long Island Lune's suggestion resolve the first problem??? As for your other question, see my answer in this topic: http://www.frontpagewebmaster.com/m-167409/tm.htm
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:23:48
On the end of your SQL query, add "Order By" then the field you want to sort by, then ASC for ascending or DEC of desceding. Example: WHERE ID = strID Order By PartNo ASC Something that you can change on the page that comes up?
_____________________________
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:28:36
Long Island Lune's suggestion hasn't been applied yet, The sorting fix is what i'm searching into at this exact moment. If I change them to Len do i need to get rid of str?
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:43:21
quote:
If I change them to Len do i need to get rid of str? No. Len reads the lenght of strings. Don't change your field names.
_____________________________
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 15:51:25
I changed it to inculde Len in the line and it gave me: Microsoft VBScript compilation error '800a03f9' Expected 'Then' /NewWarehouseCommunicator/functionpick2.asp, line 45 IF Len strNotes <> "" THEN -------^ Adding the ( ) to it resulted in telling me I couldn't have a 0 length string in either of the boxes. Putting data into both boxes resulted in it going through but neither entires into either box posted to the database.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 16:10:13
quote:
IF Len strNotes <> "" THEN IF Len(strNotes) <> 0 THEN Don't forget the brackets...
_____________________________
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 17:30:54
I'll give that a shot here in a sec, LIL. Thanks for your help btw. Duane, I tried that column sort trick on a new drw and everytime i click on the links i get the page cannot be displayed, although while doing this I tried an idea on the getting only the current date to display. In the SQL statement I chaged a line that said: WHERE(Date1 = 'Date1" .. to WHERE(Date1 = Date() and it worked to use only today's date without searching. I'm wondering if adding that extra query parameter to the SQL changed the way the column sort worked or if I just messed a step up.
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 17:36:43
quote:
In the SQL statement I chaged a line that said: WHERE(Date1 = 'Date1" .. to WHERE(Date1 = Date() and it worked to use only today's date without searching. I'm wondering if adding that extra query parameter to the SQL changed the way the column sort worked or if I just messed a step up. Yep, that would do it. I was going on the assumption that you wanted today's date as the default choice, not simply the only choice. Changing the SQL is probably the best route for your needs. Post the code for the page so we can maybe figure out the problem with the sort column feature. I have to go get my kids from school so may not get back to this til tomorrow, but will try.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 17:46:00
LIL, That still didn't work, I had this same issue with the other half of this forms function and me and Duane managed to narrow down the problem with it, this one however, I'm unsure what's wrong. Thanks for all your help once again.
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 18:07:29
Here's the code <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Warehouse Communicator Sort</title> </head> <body> <table width="100%" border="1"> <thead> <tr> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=ID">ID</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=From#ID">From</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Date">Date</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=PickticketCtrlNo">PickticketCtrlNo</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=ToteColor">ToteColor</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Qty">Qty</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?Sortcolumn=PartNo">PartNo</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Location">Location</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Description">Description</a></b></td> </tr> </thead> <tbody> <!--#include file="../_fpclass/fpdblib.inc"--> <% if 0 then %> <SCRIPT Language="JavaScript"> document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>"); </SCRIPT> <% end if %> <% fp_sQry="SELECT * FROM details WHERE (Date1 = Date() AND Signature IS NULL) ORDER BY ::SortColumn:: ASC" fp_sDefault="SortColumn=ID" fp_sNoRecords="<tr><td colspan=9 align=left width=""100%"">No records returned.</td></tr>" fp_sDataConn="whcomm" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="ID" fp_sMenuValue="ID" fp_iDisplayCols=9 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file="../_fpclass/fpdbrgn1.inc"--> <tr> <td> <%=FP_FieldVal(fp_rs,"ID")%> </td> <td> <%=FP_FieldVal(fp_rs,"From1")%> </td> <td> <%=FP_FieldVal(fp_rs,"Date1")%> </td> <td> <%=FP_FieldVal(fp_rs,"PickticketCtrlNo")%> </td> <td> <%=FP_FieldVal(fp_rs,"ToteColor")%> </td> <td> <%=FP_FieldVal(fp_rs,"Qty")%> </td> <td> <%=FP_FieldVal(fp_rs,"PartNo")%> </td> <td> <%=FP_FieldVal(fp_rs,"Location")%> </td> <td> <%=FP_FieldVal(fp_rs,"Description")%> </td> </tr> <!--#include file="../_fpclass/fpdbrgn2.inc"--> </tbody> </table> </body> </html>
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 18:37:54
Before I spend too much time looking at your sort page, is it really named WaehouseCommDateSort.asp or is it WarehouseCommDateSort.asp? <td><b><a href="WaehouseCommDateSort.asp?SortColumn=ID">ID</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=From#ID">From</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Date">Date</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=PickticketCtrlNo">PickticketCtrlNo</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=ToteColor">ToteColor</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Qty">Qty</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?Sortcolumn=PartNo">PartNo</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Location">Location</a></b></td> <td><b><a href="WaehouseCommDateSort.asp?SortColumn=Description">Description</a></b></td>
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 18:44:41
My update queries still aren't working, which is why I started this thread, but I'm debating the actual necessity of them as it is. It would be nice to save the resolutions box but the notes just aren't necessary. If I search for the page using my custom search engine my predecessor built all this crap and left in the middle of it. Hence my frustration with it and annoyingly light grasp of it.
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/4/2003 19:11:35
In my novice mind, it looks like pretty sound code. Memo fields are sometimes a little more difficult to deal with. Hence the reason he was avoiding trying to update them if empty. Maybe Spooky will spot the error in the code, if there is one. Another thought is you could try replacing that page with one created using the DRW. You can use the DRW to update dbs. You would simply open a new page, insert a new db results region, but in step 2 or the wizard you need to select custom query. The SQL you would enter in step 2 would be this: UPDATE Details SET To1 = '::To1::, From1 = '::From1::', Date1 = #::Date::#, PickticketCtrlNo = '::strPickticketCtrlNo::', ToteColor = '::ToteColor::', QTY = ::strQTY::, PartNo = '::PartNo::', Location = '::Location::', Description = '::Description::', Notes = '::Notes::', Resoultion = '::Resoultion::' Signature = '::Signature::', DateCompleted = #::DateCompleted::# WHERE ID = ::ID:: You may want to try it, but it may error out on an empty memo field such as Notes. Let us know.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/5/2003 12:21:55
My drw page is updating the database. Do you remember the stuff I emailed you where I had this same problem on those three asp pages? This is that same form just a different aspect of it where we can search and update it.
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/5/2003 12:48:29
So do you still need the page or were you able to create a new one to accomplish the same task???
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Kage
Posts: 129 Joined: 11/20/2003 Status: offline
|
RE: Ugh, any clue as to why this doesnt work? - 12/5/2003 16:39:02
No the page you helped me iron out the bugs with works like a charm. This is another set of two to three pages using the same form and same variables but one page allows you to search, then it displays the results and then is supposed to submit an update, the page that updates is what i posted here.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|