ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

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 Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old July 30th, 2003, 08:47 AM
srinath srinath is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Bangalore, India.
Posts: 21 srinath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to srinath
Question Data updated into the database twice ??

Hi All,

I am using a ASP page(User_Account.asp) to create username and password & updating the info into the database through another ASP page(User_Account_Upload.asp).

The problem I am facing is that, at random instances the data gets duplicated. I tried to check if the user Id exixts in the database before updating. After implementing this logic, whenever I create a new user, if the ASP page tries to store the username for the 2nd time, it generates an error message that the user_id exists and doesn't update the database. However, this error message is displayed on the screen even though the user_id was created for the 1st time.

I would appreciate any kind of help !! I am also attaching the files with this mail.

Thanks in advance!

Regards

Srinath
Attached Files
File Type: zip user_account.zip (2.6 KB, 207 views)

Reply With Quote
  #2  
Old July 30th, 2003, 09:07 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
You are sure that the double creation happens truly at random, and have not found any pattern?
From a quick look, I haven't found your problem yet, but as a suggestion I would recommend not using "SQL_Query" as the variable for all your queries. Number them or something, so that you don't keep using the same variable with different values all the time. Other than that, I would recommend that you make sure there isn't a pattern or certain circumstances that make the data duplicate. If there are, post that, it could be very helpful.
Also, you could try just executing the insert, without setting the variable RS1. Not sure if that will change things, but its a bit simpler.

Last edited by karsh44 : July 30th, 2003 at 09:10 AM.

Reply With Quote
  #3  
Old July 30th, 2003, 01:04 PM
srinath srinath is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Bangalore, India.
Posts: 21 srinath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to srinath
Unhappy Data updated into the database twice ??

Hi Karsh44,

Thanks for the quick reply. I tried both the options, but to no luck. The data duplication is absolutely random. Sometimes it happens while creating a 2nd user, sometimes the 4th or 5th and sometimes during 8th or 11th. There is absolutely no particular pattern. I am really confused ?? I have a similar code for updating one table with absolutely same logic, & it works like a charm. Any more suggestions you got for me ?

Thanks once again !!

Regards

Reply With Quote
  #4  
Old July 30th, 2003, 03:39 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Well, I don't really have any more ideas. Could you try to make this into 2 separate actions, since you said you have a similar version for 1 table that works? You could try to make this two 1 table updates instead of 1 two table update.
Good luck

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Data updated into the database twice ??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway