If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Delete AUTONUMBER in ACCESS using ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-04, 15:04
DiabloDigital DiabloDigital is offline
Registered User
 
Join Date: Feb 2004
Location: South Africa
Posts: 6
Exclamation Delete AUTONUMBER in ACCESS using ASP

***ASP & ACCESS***

So i eventually got it right inserting data into a table that holds an autonumber field....

The problem I'm facing now is to delete one of those records.
For some reason it just isn't as simple as deleting a record where there isn't an autonumber involved...

I basically have:
sql1 = "DELETE * FROM table WHERE userID = '" & tempID & "' "

THIS STATEMENT USED TO WORK WHEN THE ID FIELD WAS SET AS TEXT.
So my guess is that something else has to change.

Anybody out there that can shine some light on my problem?



Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 02-15-04, 17:12
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
try this...

sql1 = "DELETE * FROM table WHERE userID = " & tempID & " "

your id field is now a number, not text. Removing the single quote will allow the statement to work...

In theory comparing a numeric value to a string value should never find a match because they are nothing like each other, it would be like comparing the clock speed of a computer with the clock speed of a coconut.
Reply With Quote
  #3 (permalink)  
Old 02-15-04, 18:55
DiabloDigital DiabloDigital is offline
Registered User
 
Join Date: Feb 2004
Location: South Africa
Posts: 6
Cool Thanks

Thank you for your reply

I made the changes and it works!
Now i also know why.

THANK YOU ONCE AGAIN!
Reply With Quote
  #4 (permalink)  
Old 02-15-04, 19:43
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
It works on the same theory as comparing NULL.

You should never use

if XYZ = Null then

because if something is null it means you have no idea what it is,.. it is completely undefined.... you don't know that it doesn't = XYZ because you can't compare the two together....

Anyway, glad to be of service.
Reply With Quote
  #5 (permalink)  
Old 02-16-04, 03:19
kaeldowdy kaeldowdy is offline
Member
 
Join Date: Apr 2003
Location: Evansville, Indiana
Posts: 75
Quote:
Originally posted by rokslide
...it would be like comparing the clock speed of a computer with the clock speed of a coconut.
Hmmm...what would the clock speed of a coconut be if it were carried by an African swallow? heh-heh

Kael
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On