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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 12th, 2003, 10:39 PM
sparky145 sparky145 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 3 sparky145 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Updating records with a join

The following form post data into itslef through a join statement. the contact and ticket tables. The ticket ID field is read only as I don't want that updated.

Through the form action I want to be able to update the existing record. Is it possible to run an update through a join? The statement selects a ticket and the associated contact. The user should be able to change the contents of any field and then hit the submit button the update save the ticket.

The form:

<!-- #include virtual="login3/adovbs.inc" -->
<HTML>
<HEAD>
<TITLE>Search_Test</title>

</HEAD>



<% 'specify the provider
strProvider="Driver={SQL Server};Server=SPARKDLE-LPSJXL;Database=Login;Uid=sa;Pwd=sa;"

'define the inner join query
strQuery = "SELECT tcontact.firstname, tcontact.lastname, tticket.ticketid, tticket.urgency, tticket.description, tticket.probdescription, tticket.probresolution FROM tcontact inner JOIN tticket ON tcontact.contactid=tticket.contactid"


'create and open the recordset
set rsJoin=Server.CreateObject("ADODB.Recordset")
rsJoin.Open strQuery, strProvider, , , adCmdText %>


<!-- <% 'cycle thru the record set and display each row results
'do until rsJoin.EOF %> -->
<BODY>
<TABLE>

<form action= "searchtest_update.asp">
<TR>
<TD>Firstname</TD>
<TD><INPUT TYPE="text" NAME="ticket" value=<% Response.Write rsJoin("firstname")%>> </TD>
</TR>
<TR>
<TD>Lastname</TD>
<TD><INPUT TYPE="text" NAME="ticket" value=<% Response.Write rsJoin("lastname")%>> </TD>
</TR>

<TR>
<TD>Ticket ID</TD>
<TD><% Response.Write rsjoin("ticketid")%> </TD>
</TR>

<TR>
<TD>Subject</TD>
<TD><INPUT TYPE="text" NAME="contact" value=<% Response.Write rsJoin("description")%>> </TD>
</TR>
<TR>
<TD>Urgency</TD>
<TD><INPUT TYPE="text" NAME="urgency" value=<% Response.Write rsJoin("urgency")%>></TD>
</TR>
<TR>
<TD>Problem Description</TD>
<TD><INPUT TYPE="text" NAME="description" value=<% Response.Write rsJoin("probdescription")%>></TD>
</TR>
<TR>
<TD>Problem Resloution</TD>
<TD><INPUT TYPE="text" NAME="probdescription" value=<% Response.Write rsJoin("probresolution")%>></TD>
</TR>
<td> <INPUT TYPE="submit" value=save>

</form>



<% 'close record set and flush object from memory
rsJoin.Close
set rsJoin = Nothing %>


</TABLE>
</BODY>
</HTML>

Reply With Quote
  #2  
Old June 13th, 2003, 08:42 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
I do not believe you can do an update across multiple tables at the same time.

Reply With Quote
  #3  
Old June 15th, 2003, 09:09 PM
mohecan mohecan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Melbourne, Australia
Posts: 212 mohecan User rank is Private First Class (20 - 50 Reputation Level)mohecan User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
You would have to run two updates.
One for each table.
__________________
How can I soar like an eagle when
I'm flying with turkey's?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Updating records with a join


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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