Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 15th, 2004, 03:40 PM
Friend of Wrox
Join Date: Jul 2004
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?


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
    if linkSet.EOF then
        p_link_id = 1
        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 = ""
        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

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


    <INPUT TYPE="submit">

    set rs = Nothing

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

end if

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

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