Author |
Topic |
texanman
Junior Member
United States
410 Posts |
Posted - 02 July 2008 : 08:20:12
|
quote: Originally posted by Carefree
I installed it, tested the cleaning file, works perfectly with my change. Here's my file in .txt format: greeting_cards_clean
Carefree, I used your copy and still same error. hmmm< |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 02 July 2008 : 08:27:59
|
I'm not sure what type is DateSent (guessing datetime), but the syntax used is valid just for Access. SQL Server doesn't use '*' in DELETE statements and dates aren't delimited by '#'.< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 July 2008 : 08:31:34
|
quote: Originally posted by ruirib
I'm not sure what type is DateSent (guessing datetime), but the syntax used is valid just for Access. SQL Server doesn't use '*' in DELETE statements and dates aren't delimited by '#'.
and it is the reason we do dates in the forum as a string not a date< |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 02 July 2008 : 09:12:06
|
rurib & HuwR: This is the date format in the code:
rev = (rmonth & "/" & rday & "/" &ryear ) strSQL = "DELETE FROM " & strTablePrefix & "GREETING_SENT WHERE SENTDATE< #" & rev & "#"
For SQ are you saying we take out those "#"'s? Thanks< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 July 2008 : 09:14:11
|
quote: Originally posted by texanman
rurib & HuwR: This is the date format in the code:
rev = (rmonth & "/" & rday & "/" &ryear ) strSQL = "DELETE FROM " & strTablePrefix & "GREETING_SENT WHERE SENTDATE< #" & rev & "#"
For SQ are you saying we take out those "#"'s? Thanks
yes, replace them with ', however you will need to ascertain whether your server wants the adte as mm/dd/yy or dd/mm/yy and adjust the rev = (rmonth & "/" & rday & "/" &ryear ) accordingly< |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 02 July 2008 : 09:25:56
|
Tried both date types and got the same error:
ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed. /greeting_cards_clean.asp, line 89 I changed the line as:
strSQL = "DELETE FROM " & strTablePrefix & "GREETING_SENT WHERE SENTDATE< '" & rev & "'" < |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 July 2008 : 09:32:59
|
an object closed error means you don't have an open connection, it has nothing to do with what the query is, have you deleted or commented any lines ?< |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 02 July 2008 : 09:58:01
|
Thanks HuwR, You are the man!! This is original code modified using your suggestion (works fine now in SQL):
quote: strSQL = "DELETE FROM " & strTablePrefix & "GREETING_SENT WHERE SENTDATE< '" & rev & "'" set rs = conn.execute (strsql)
And this is the code carefree suggested to solve the issue earlier:
quote: strSQL = "DELETE FROM " & strTablePrefix & "GREETING_SENT WHERE SENTDATE< #" & rev & "#" set rs = conn.execute(strSQL) if rs.EOF or rs.BOF then ' Not Found Response.Write "Deleted" end if rs.Close set rs = Nothing
Thanks again< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 July 2008 : 10:21:05
|
glad you have it working now (so far at least)< |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 02 July 2008 : 11:12:10
|
LOL @ so far . You got that right.
The issue brought up by leatherlips still needs fixing.
quote: It took out some of the error. Now it only says this: ADODB.Recordset error '800a0cc1' Item cannot be found in the collection corresponding to the requested name or ordinal. /forumtest/greeting_cards_docard.asp, line 188 Line 188 is: rs("mailserver") = strMailServer
< |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 02 July 2008 : 12:35:11
|
I found the problem. Delete lines 188-189, the fields he's trying to update do not exist in that table.< |
Edited by - Carefree on 02 July 2008 12:39:35 |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 02 July 2008 : 12:50:52
|
Genius!!!!!!!!!!!!!! Thanksssssssssss Now everything works fine for SQL< |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 02 July 2008 : 14:03:38
|
You're welcome.< |
|
|
Maxime
Average Member
France
521 Posts |
Posted - 04 July 2008 : 14:07:08
|
I applied all updates proposed here
Change the number of days before expiry of the card ADODB.Recordset error '800a0cc1'
Unable to find the object in the collection corresponding to the name or the reference asked ordinal.
/forum/greeting_cards_docard.asp, line 188
Removing card sent before the deadline expiry
ADODB.Recordset error '800a0e78'
This operation is not permitted if the subject is closed.
/forum/greeting_cards_clean.asp, line 88 < |
Cordially, Maxime
Taxation consists in so plucking the goose to get the most out of feathers with the least possible cries.(Jean-Baptiste Colbert)
|
Edited by - Maxime on 04 July 2008 14:10:24 |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 04 July 2008 : 16:11:11
|
quote: I found the problem. Delete lines 188-189, the fields he's trying to update do not exist in that table.
You have missed that one for the first error.
For the second error if you are using SQL replace lines 90-92 with:
strSQL = "DELETE FROM " & strTablePrefix & "GREETING_SENT WHERE SENTDATE< '" & rev & "'" set rs = conn.execute (strsql)< |
Edited by - texanman on 04 July 2008 16:17:11 |
|
|
Topic |
|