Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 15th, 2004, 03:40 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default copying from table 1 inserting in table 2

I have the following code but this is inserting manually. I want to make a query from table 1 and automatically enter the records into table 2. What needs to be modified?

Code:
<%@ LANGUAGE="VBSCRIPT" %>



<%
if isAdmin then

   set rs = Server.CreateObject("ADODB.Connection")
    rs.Open "kjv"

    set linkSet = Server.CreateObject("ADODB.RecordSet")
    linkSet.Open "select * from results order by id desc", rs, adOpenStatic, adLockOptimistic, adCmdText
    linkSet.MoveFirst
    if linkSet.EOF then
        p_link_id = 1
    else
        p_id = linkSet("id") + 1
    end if

    p_link_id_in = Request.querystring("p_id")
    if p_link_id_in <> "" then
        linkSet.Find "id = " & p_link_id_in
    end if
    if p_link_id_in = "" or linkSet.EOF then
        p_book = ""
        p_link_desc = ""
        p_link_url = ""
    else
        p_book = linkSet("book")
        p_link_desc = linkSet("book_title")
        p_link_url = linkSet("book_spoke")
        p_link_id = p_link_id_in
        p_existing = p_link_id_in
    end if

    linkSet.Close
    set linkSet = Nothing
%>
    <CENTER>
    <FORM ACTION="edit_links_rec_action.asp" METHOD="post">
    <INPUT TYPE="hidden" NAME="p_existing" "
        VALUE="<%=p_existing%>">
    <h2>Edit Link</h2>
    <TABLE>
    <TR>
        <TD>Link ID</TD>
        <TD>
            <INPUT TYPE="hidden" NAME="p_link_id" VALUE="<%= p_link_id %>">
            <%= p_link_id %>
        </TD>
    </TR>
    <TR>
        <TD>Book #</TD>
        <TD><INPUT TYPE="text" NAME="p_name" SIZE="25" 
               VALUE="<%=p_book%>">
    </TR>
    <TR>
        <TD>Link Description</TD>
        <TD><INPUT TYPE="text" NAME="p_desc" SIZE="50" 
               VALUE="<%=p_link_desc%>" maxlength=MAXLENGTH="255">
    </TR>
    <TR>
        <TD>Link URL:  http://</TD>
        <TD><INPUT TYPE="text" NAME="p_url" SIZE="50" 
                VALUE="<%=p_link_url%>" maxlength=MAXLENGTH="100">
    </TR>

    </TABLE>

    <INPUT TYPE="submit">

    </form>
    </CENTER>
<%
    rs.Close
    set rs = Nothing
else

    Response.Write "You do not have access to this page."

end if
%>
</BODY>
</HTML>
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying values into a column from another table madrob3975 SQL Server 2000 1 December 8th, 2006 03:31 AM
Copying from one table to another Clive Astley VB Databases Basics 2 August 23rd, 2005 12:48 AM
Inserting a value from one table to another Hudson40 Access VBA 1 February 25th, 2005 08:54 AM
Copying Table Relationship Diagram mike123abc SQL Server 2000 1 February 19th, 2004 09:16 AM
copying array to table (reverse of getrows?) rachelow VB Databases Basics 0 July 19th, 2003 03:10 AM



All times are GMT -4. The time now is 04:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.