|
| |
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 12:41:54
quote:
Page 3 has the following statement... UPDATE DrvTable SET DrvPswd=('::iDrvPswd::'), DrvName=('::iDrvName::'), DrvBio=('::iDrvBio::'), DrvAward=(::iDrvAward::), DrvPic=('::iDrvPic::') WHERE ID=('::iID::') Fantastic. But there is only one thing.... Now that you have a numeric field to refer too, you have to change the way numeric fields are inturpretted. VERY EASY. WHERE ID= ::ID:: Text fields and Memos: '::xxxx::' Numerics: ::xxxx:: Like in: UPDATE DrvTable SET DrvPswd=('::iDrvPswd::'), DrvName= ('::iDrvName::'), DrvBio=('::iDrvBio::'), DrvAward= ('::iDrvAward::'), DrvPic=('::iDrvPic::') WHERE ID=(::iID::) Do you like brackets better? You can do it with or without. Make no difference. UPDATE DrvTable Set (DrvNum= ‘::DrvNum::’, DrvPswd= ‘::DrvPswd::’, DrvBio= ‘::DrvBio::’, DrvAward= ‘::DrvAward::’, DrvPic= ‘::DrvPic::’ WHERE (ID = ::iID::) Plus you were missing ' and ' around iDrvAward. In the future, you can keep your form field names the same as your database table fields if that is easier. ie: WHERE (ID = ::ID::) This applies to any db and tbl fields. AGAIN, this doesn't really matter. You can leave it the way it is. We're almost there!!!
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 17:21:33
Page two is pulling in the value for ID and transferring it to page 3 right? We need to see what is coming in to page 3. Place this (monitoring) ASP code on TOP of page 3 above the <html> tag: <% a = request.form ("DrvPswd") b= request.form ("DrvName") c= request.form ("DrvBio") d= request.form ("DrvAward") e= request.form ("DrvPic") f= request.form ("ID") response.write ("<BR>DrvPswd= " & a & "<BR>DrvName= " & b & "<BR>DrvBio= " & c & "<BR>DrvAward= " & d & "<BR>DrvPic= " & e & "<BR>ID =" & f) %> Now when you make it to page 3, you'll see the values that are being passed from page 2 to 3 on top of the page. Make sure each field is filled with something and that the info is correct. Are you testing live on your site, or are you testing locally? Maybe you better send me the error message again.
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 19:55:58
I put those lines of code into page 3 and everything looked like it should. All the information I entered was transfered to that page. The error message is... Database Results Wizard Error The operation failed. If this continues, please contact your server administrator. I am testing it on the live site.
< Message edited by D_Sutter -- 10/28/2003 7:56:28 PM >
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 21:41:49
Everything verifies fine.
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 21:46:45
Ahh.... You posted before I finished. Did you import the database in, or create it inside the FP environment?
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 21:47:52
Is page 3 saved as an ASP page with an extension of .asp?
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/28/2003 22:46:17
quote:
Database Results Wizard Error The operation failed. If this continues, please contact your server administrator. When you put the query in the Qizard Dialog Box, did it verify correctly?
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/29/2003 6:11:51
I imported the database in after creating it in Access (office XP). Page 3 is a ASP page. The query verifies fine. The only other thing that I can think of the help you find my problems is that I am in a sub-web. I have added all the database information to the main global.asa file (not in sub-web) and put my database in the main webs fpdb subdirectory. It obviously finds the database and information, but I wanted to let you know just in case there was something about it updating from there.
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 9:12:34
Two final questions... What does the query look like when you just want to add a record to the database? Can you retrieve the system date and put it into a form field? Thanks.
< Message edited by D_Sutter -- 10/30/2003 10:12:03 AM >
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 12:53:20
Question 1: Adding a Record: INSERT INTO DrvTable (DrvNum , DrvPswd, DrvBio, DrvAward, DrvPic) VALUES (‘::DrvNum::’, ‘::DrvPswd::’, ‘::DrvBio::’, ‘::DrvAward::’, ‘::DrvPic::’) Question 2: Date in form-field Sure. You would create another edit field in your form. You know how to do that right? Once you have the new field in your form - do this: 1): Double-click the new form field. 2): In the "Name" field give it a name: (ie: myDate). 3): In the "Initial Value" field place this: <%=Date()%> 4): Click OK. Now the date will appear in your form field. And it will also be POSTED to page 3 if you should ever need to save it for some reason.
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 12:55:52
One thing I forgot to mention: When naming fields in your forms or database (for date types) - do not name your field Date. It is a reserved word in MS-ACCESS. That's why I gave you the example name"myDate" above.
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 14:08:43
That does the trick... Is there anyway to make the date in MM/DD/YYYY format? Don
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 14:16:58
Do you mean something like this: Full Day and Date: <%=FormatDateTime(Date(), 1)%> Or just the 4-digit year?
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 14:18:48
I just want it to say... 10/30/2003 Don
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 14:34:45
Don - try this: <%=Month(Now)&"/"&Day(Now)&"/"&Year(Now) %>
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/30/2003 14:37:13
Works great! Thank you for all your help. Don
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 9:53:13
I did have another question... Are the codings that you are giving me just html? I was wondering where I could get some information on some of these things...like date and formating output. I am looking for a way to convert a number stored in my database (date in YYYYMMDD format) to display in a MM/DD/YYYY format.
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 12:47:59
I have all the dates going in as YYYYMMDD. I just wanted to display them as MM/DD/YYYY. Thank you for the links. Don
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 12:48:07
Maybe something like this: myDate = year(Now) & left("00",2-len(month(now))) & month(Now) & left("00",2-len(day(Now))) & day(dt) BUT..... This is assuming that ALL dates incoming are in UK format.
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 12:50:14
You want to DISPLAY them? In your DRW display page, or in the form? Where?
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 12:53:11
It reads the date out of the database in format YYYYMMDD. I just want it to be displayed in the DRW table as MM/DD/YYYY. Where would I put a statement "myDate = " at? Where in the .asp page?
< Message edited by D_Sutter -- 10/31/2003 12:54:06 PM >
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 13:07:35
Correction: The following code WILL take a yyyy/mm/dd format and convert it to a mm/dd/yyy format for you: With / forward slashes embedded: = mid (mtDate, 6, 2) & "/" & right (mtDate, 2) & "/" & left(mtDate, 4) Without / forward slashes embedded: = mid (mtDate, 6, 2) & right (mtDate, 2) & left(mtDate, 4) I just tested it. It works. Disregard the first code I gave you 2-posts back. This code will have to be placed in the DRW code by hand. Post your display code. Or you would have to go into your DRW code yourself, find the date display line and replace it with the code I just gave you. Just make sure to change "mtDate" in my code with the field from your database. If you can't figure it out, post the DRW display code.
< Message edited by Long Island Lune -- 10/31/2003 1:10:43 PM >
_____________________________
|
|
|
|
D_Sutter
Posts: 48 Joined: 10/4/2002 Status: offline
|
RE: Updating Access DB from .asp Form - 10/31/2003 14:20:06
Here is the DRW section... I have changed the field like you posted and all I get is "//" for the date. <% 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 NewsTable ORDER BY nwDate DESC" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="news" fp_iMaxRecords=10 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=False fp_sMenuChoice="nwDate" fp_sMenuValue="nwDate" fp_sColTypes="&nwID=3&nwDate=3&nwNews=203&nwNum=202&nwDrv1=202&nwDrv2=202&nwDrv3=202&nwDrv4=202&nwDrv5=202&nwDrv6=202&" fp_iDisplayCols=2 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <!--webbot bot="DatabaseRegionStart" endspan --><table BORDER="0"> <tr> <td valign="top"><font face="Lucida Sans" size="2"> <%=mid(nwDate, 6, 2) & "/" & right(nwDate, 2) & "/" & left(nwDate, 4)%></font></td> <td><font face="Lucida Sans" size="2"> <%=FP_FieldVal(fp_rs,"nwNews")%></font></td> </tr> </table> <hr> <!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"--> <!--webbot bot="DatabaseRegionEnd" endspan --></td>
|
|
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
|
|
|