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:
  #1  
Old September 8th, 2003, 04:39 PM
mccray_26 mccray_26 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Memphis
Posts: 6 mccray_26 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to mccray_26
How to submit to a table in two different db's

I am working with two db's (i.e John and John1) I have a form that when submitted the information goes to the (i.e) Doe table. This table (Doe) is located in both the John db and John1 db, I need to add the functionality so that when the submit button is selected both db's are updated. Plese help.

Reply With Quote
  #2  
Old September 8th, 2003, 05:13 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 13 m 21 sec
Reputation Power: 76
Assuming you can do the update for one table, simply duplicate that command for the other table. So in your form handler page, you would have a connection to the 'John' and execute your query, then close that connection, and do the exact same thing again, only changing 'John' to 'John1'.
If you don't know what to do at all, I can point you to some tutorials online.

Reply With Quote
  #3  
Old September 8th, 2003, 07:20 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Depends....

I'd recommend looking at transactional replication if they're complete copy tables.

If it's just duplicates from this form, A) why? that sounds like redundant data and you could split it up to be the same table or work with referential keys and B) look into using triggers if you can in this situation, triggers will automatically update another table when some action occurs.

Reply With Quote
  #4  
Old September 8th, 2003, 09:40 PM
mccray_26 mccray_26 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Memphis
Posts: 6 mccray_26 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to mccray_26
karsh44, tutorial would be great. I was thinking I would need two Data Connections. Also, I suggest using triggers but I was told to do it on the web application. So, I must do my job as told.

Karsha44 please forward that tutorial info ASAP.

Thanks very much!

Reply With Quote
  #5  
Old September 8th, 2003, 10:24 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 13 m 21 sec
Reputation Power: 76
http://www.planet-source-code.com/v...&txtCodeId=6442
is all about connecting to database and running sql queries. http://www.ultimateapps.com/support/kbarticle.asp?ID=2 has more info about connection strings if you need it.
A couple good asp sites in general: www.asp101.com www.aspfree.com www.4guysfromrolla.com
HTH

Reply With Quote
  #6  
Old September 8th, 2003, 10:33 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
who told you to do it all through the web application out of curiosity? Only because there are many very good reasons not to do it that way. THE only reason to do it that way is convenience, but i guess you should ask how important is the validity/integrity of these two databases? Probably not very high and i always go too far anyways *shrug*

Last edited by unatratnag : September 8th, 2003 at 10:36 PM.

Reply With Quote
  #7  
Old September 8th, 2003, 10:42 PM
mccray_26 mccray_26 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Memphis
Posts: 6 mccray_26 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to mccray_26
My Team Lead told me this. I thought it would be better to do on the db side. We have DTS set up now to do this, but the DTS is set to update dB 2 every morning. They want to update the db in real time.

Last edited by mccray_26 : September 8th, 2003 at 10:52 PM.

Reply With Quote
  #8  
Old September 9th, 2003, 02:26 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 6
In realtime? no problem. A trigger can absolutely do it.

Data consistency, delay for processing the request need to be considered for a web page.

I think they can be very well avoided with a trigger doing the second db update. You have the transaction handling that you can use to roll back the changes from within your application, if the trigger fails.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > How to submit to a table in two different db's


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 3 hosted by Hostway
Stay green...Green IT