Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 12th, 2005, 09:19 PM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
The lovely DeleteRow

The table in this screenshot is created using ASP and the information comes from a database.

When you delete the information from the database program, it doesn't delete the row with it, so a blank row sits there (with the date and venue)

The two blank rows (including date and venue) need to be deleted, how do I do it?

I have a single file that creates the page, its called events.asp, I don't think I need to post any code because this is pretty straight forward.

This is what I have tried:


Code:
 <% if objrs("date") = "May 31, 2005" then object.deleteRow%><% end If %> 


Basically what I thought I could do is delete rows that contain the date "May 31, 2005", but I realised later I can't do that because other events have the same date and they would end up being deleted. Any other suggestions?
Attached Images
File Type: jpg shot.JPG (30.1 KB, 181 views)

Reply With Quote
  #2  
Old April 13th, 2005, 12:16 AM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,267 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 48 m 12 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
Why not just use a simple sql delete statement with where parameters to filter the records to be deleted?
Code:
sql = "delete * from tablename where datefield=#somedate# AND sometextfield='sometextvalue' AND someintegerfield=someintegervalue"

Reply With Quote
  #3  
Old April 13th, 2005, 01:22 AM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
But wouldn't the table have to be written in SQL aswell?

The table has no name, so I can't assign this sql code to the table.

You got to remember that this table is generated using ASP

Reply With Quote
  #4  
Old April 13th, 2005, 01:43 AM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,267 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 48 m 12 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
What? How does the table on the screen get generated? I would assume by parsing the results of a sql select query?

Maybe a bit more information on what you are trying to achieve might help.

Reply With Quote
  #5  
Old April 13th, 2005, 02:46 AM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
ok I think you're right

sorry, I'm still new to this

Code:
 
yr = request("yr")
set objrs=server.createobject("ADODB.Recordset")
sqlstmt = "select * from events where year(first_day) = '" & yr & "' order by first_day"
objdc.CommandText = sqlstmt
objrs.Open objdc, , 3, 1

Reply With Quote
  #6  
Old April 13th, 2005, 03:30 AM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
This is interesting, the code you suggested to me works in Firefox

but not IE 6.0

why is this?

Reply With Quote
  #7  
Old April 13th, 2005, 05:14 AM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,267 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 48 m 12 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
Nothing to do with the browser. Must be something else in your code that is causing the problem.

Reply With Quote
  #8  
Old April 13th, 2005, 05:16 AM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
yeah you are right, I deleted the sql code you gave me, and firefox still makes sure those rows don't show up

strange that IE6 will make them show

wonder how I can fix that

Reply With Quote
  #9  
Old April 13th, 2005, 05:42 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,737 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 41 m 46 sec
Reputation Power: 1914
this is called cache issue... set expire date for the page and prevent its caching in the browser.

Reply With Quote
  #10  
Old April 13th, 2005, 05:52 AM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
Are you sure?

I cleared out my cache

I checked on others computers

I'll give it a try anyway

Reply With Quote
  #11  
Old April 13th, 2005, 06:07 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,737 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 41 m 46 sec
Reputation Power: 1914
try having such code in your page:
Code:
  Response.Expires = 0
  Response.Expiresabsolute = Now() - 1 
  Response.AddHeader "pragma","no-cache" 
  Response.AddHeader "cache-control","private" 
  Response.CacheControl = "no-cache" 
 

this would tell the browser to avoid caching the page, most browsers would listen to this.

Reply With Quote
  #12  
Old April 13th, 2005, 06:20 AM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
Ok does not work

riddle me this then

If your table is generated using SQL and the information is stored on a database
how do you know what the name of the table is?

If I knew the answer to this, would I not finally be able to put in the code:

sql = "delete * from tablename where event_name=''"

(the '' meaning that one of the cells in the event_name column is empty)

Reply With Quote
  #13  
Old April 13th, 2005, 06:53 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,737 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 41 m 46 sec
Reputation Power: 1914
according to this post of yours:
http://forums.aspfree.com/showpost....893&postcount=5
the table name is "events".

Reply With Quote
  #14  
Old April 13th, 2005, 09:10 PM
Sn00py Sn00py is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 13 Sn00py User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 29 sec
Reputation Power: 0
ahh, thanks, is that how it is with sql??, seems a lot of it is made up of words, so it would be easy to miss something

Reply With Quote