This is a discussion on "Update Table" within the Classic ASP section. This forum, and the thread "Update Table are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Update Table
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Update Table
I have the worse time with date functions working. I'm using MSSQL2k and FP with ASP. What I need to do is take an existing date in the database and increment it by one year.
The Table values are: Field Name: Sponsored varchar 18 ('(convert(varchar(12),(getdate(),101 + 30),101))') This works with no problem. The script below should take the current or existing date and update it with a new one. What I get is "0" in the table. If I response.write <%key10%>, I get the correct info displayed on the page. Can someone look at the code that performs the AddDate function, and the update table function to see what it is I'm missing or have wrong. <meta http-equiv="Content-Language" content="en-us"> <% Set RS = Server.CreateObject("ADODB.Recordset") set myConn = Server.CreateObject("ADODB.Connection") tkey = key Dim HTTP_REFERRER Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "Cache-Control", "no-cache" If Not(IsObject(Session("OBIT"))) Then If Session("OBIT") = "" Then HTTP_REFERRER = Request.ServerVariables("URL") If Request.QueryString <> "" Then HTTP_REFERRER = HTTP_REFERRER & "?" & Request.QueryString Response.Redirect "login.asp?HTTP_REFERRER=" & Server.URLEncode(HTTP_REFERRER) End If End If %> <% 'get key key10 = DateAdd("yyyy", +1, Session("OBIT").Item("Sponsored")) Key = Session("OBIT").Item("ID") %> <% tkey = key10 skey = Key myConn.Open xDb_Conn_Str newSQL = "Update Obituary SET Sponsored = "&tkey&" WHERE ID ="&skey myConn.Execute(newSQL),,adexecutenorecords myConn.close set myConn = Nothing ' If Err <> 0 Then 'Response.Write "Error encountered: " & Err.Description 'Else 'response.redirect "SponsorGuestregisterthankyou.asp" 'End If %> <%=Key10%> </p> Thanks for assistance Ernest L. Kendricks |
|
|
![]() |
| Tags |
| update, table |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Am I using table-cell and table-row too much? | idl | Web Page Design | 15 | Sep 7th, 2006 12:55 |
| Need to align width of Float table with the table below | Vertabase | Web Page Design | 4 | Mar 8th, 2006 21:21 |
| MySQL UPDATE after use $uniqueID to find table row, etc | jswebdev | PHP Forum | 1 | Dec 6th, 2005 12:09 |