Pass data between tables

Discussion in 'ASP General' started by Rookie, Dec 10, 2004.

  1. Rookie

    Rookie Guest

    This is my scenario:
    I develop a .asp app that reads its data from an Access DB "A", and I have a
    desktop app with a FoxPro DB "B".

    How can I insert data from a table in DB "A" to a table in DB "B". Im new to
    asp and I really know only the basic's, so who can guide me to a tutorial or
    where can I dowload an example... it would be great.
     
    Rookie, Dec 10, 2004
    #1
    1. Advertising

  2. Rookie

    Rookie Guest

    O.K. thanks...
    now I know what to do... but can you help me on "how to do it ?"
    I searched the web, but cant find an example of how to do it....
     
    Rookie, Dec 10, 2004
    #2
    1. Advertising

  3. Rookie

    Rookie Guest

    O.K. thanks...
    now I know what to do... but can you help me on "how to do it ?"
    I searched the web, but cant find an example of how to do it...

    "Curt_C [MVP]" wrote:

    > You'll have to establich connections to each. Pull the values from one,
    > structure them into a statement and insert them into the other. Dont think
    > of this as one process, but 2 seperate things.
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > Site: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "Rookie" <> wrote in message
    > news:D...
    > > This is my scenario:
    > > I develop a .asp app that reads its data from an Access DB "A", and I have
    > > a
    > > desktop app with a FoxPro DB "B".
    > >
    > > How can I insert data from a table in DB "A" to a table in DB "B". Im new
    > > to
    > > asp and I really know only the basic's, so who can guide me to a tutorial
    > > or
    > > where can I dowload an example... it would be great.

    >
    >
    >
     
    Rookie, Dec 10, 2004
    #3
  4. Rookie

    Rookie Guest

    O.K. thanks...
    now I know what to do... but can you help me on "how to do it ?"
    I searched the web, but cant find an example of how to do it...
     
    Rookie, Dec 10, 2004
    #4
  5. Rookie

    Rookie Guest

    Im new in asp, and I dont know how to open more than one connection, and how
    to "distinc" each one. I know that it should be something like this:

    insert from db1.table1 field1, field2, field3 values db2.table1 field1,
    field2, field3 where field1 = request.querystring("id_num")

    This is my old code, it saves from a form to the database...
    <%
    '
    ' Open the database
    '
    set conn=server.createobject("adodb.connection")
    conn.open("DBQ=" & server.mappath("Base.mdb") & _
    ";Driver={Microsoft Access Driver (*.mdb)};")
    '
    ' user's information
    '
    v_name = request.form("name")
    v_email = request.form("email")
    v_age = request.form("age")
    v_gender = request.form("gender")
    v_comment = request.form("comment")
    v_hideEmail = request.form("hideEmail")
    '
    ' SQL INSERT query
    '
    conn.execute("insert into GuestBook " &_
    "(name,email,hideEmail, age,gender,comment) " & _
    "values (" & _
    "'" & v_name & "'," & _
    "'" & v_email & "'," & _
    " " & v_hideEmail & " ," & _
    " " & v_age & " ," & _
    "'" & v_gender & "'," & _
    "'" & v_comment & "')")
    '
    ' Step 4: Close and exit the database
    '
    conn.close
    set conn=nothing
    %>
     
    Rookie, Dec 10, 2004
    #5
  6. Rookie

    Rookie Guest

    Thanks to make me realize how "stupid" am I, I'm really new in asp, and "self
    learning" is really hard,... Truth, I´m not a "great programmer" and was
    expecting some help...

    Thanks anyway...

    "Curt_C [MVP]" wrote:

    > It's just a matter of
    >
    > open connection to first fb
    > use sql query to first db
    > myStirng = rs("fieldFromDB")
    > close connection to first db
    >
    > open connection to second db
    > use insert statement with myString as the value
    > close connection.
    >
    > It looks like you have all the parts here already
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > Site: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "Rookie" <> wrote in message
    > news:...
    > > Im new in asp, and I dont know how to open more than one connection, and
    > > how
    > > to "distinc" each one. I know that it should be something like this:
    > >
    > > insert from db1.table1 field1, field2, field3 values db2.table1 field1,
    > > field2, field3 where field1 = request.querystring("id_num")
    > >
    > > This is my old code, it saves from a form to the database...
    > > <%
    > > '
    > > ' Open the database
    > > '
    > > set conn=server.createobject("adodb.connection")
    > > conn.open("DBQ=" & server.mappath("Base.mdb") & _
    > > ";Driver={Microsoft Access Driver (*.mdb)};")
    > > '
    > > ' user's information
    > > '
    > > v_name = request.form("name")
    > > v_email = request.form("email")
    > > v_age = request.form("age")
    > > v_gender = request.form("gender")
    > > v_comment = request.form("comment")
    > > v_hideEmail = request.form("hideEmail")
    > > '
    > > ' SQL INSERT query
    > > '
    > > conn.execute("insert into GuestBook " &_
    > > "(name,email,hideEmail, age,gender,comment) " & _
    > > "values (" & _
    > > "'" & v_name & "'," & _
    > > "'" & v_email & "'," & _
    > > " " & v_hideEmail & " ," & _
    > > " " & v_age & " ," & _
    > > "'" & v_gender & "'," & _
    > > "'" & v_comment & "')")
    > > '
    > > ' Step 4: Close and exit the database
    > > '
    > > conn.close
    > > set conn=nothing
    > > %>

    >
    >
    >
     
    Rookie, Dec 10, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kairi Zikpin

    Re: Pass data between pages

    Kairi Zikpin, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    410
    Kairi Zikpin
    Jul 1, 2003
  2. Peter Bassett
    Replies:
    3
    Views:
    947
    Augustus
    Aug 15, 2003
  3. Otuatail

    Tables within tables

    Otuatail, Jul 31, 2004, in forum: HTML
    Replies:
    7
    Views:
    509
  4. Chris Brat
    Replies:
    5
    Views:
    708
    =?iso-8859-1?q?Luis_M._Gonz=E1lez?=
    Aug 22, 2006
  5. blufox
    Replies:
    2
    Views:
    575
Loading...

Share This Page