Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Pass data between tables

Reply
Thread Tools

Pass data between tables

 
 
Rookie
Guest
Posts: n/a
 
      12-10-2004
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.
 
Reply With Quote
 
 
 
 
Rookie
Guest
Posts: n/a
 
      12-10-2004
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....

 
Reply With Quote
 
 
 
 
Rookie
Guest
Posts: n/a
 
      12-10-2004
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" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> > 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.

>
>
>

 
Reply With Quote
 
Rookie
Guest
Posts: n/a
 
      12-10-2004
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...

 
Reply With Quote
 
Rookie
Guest
Posts: n/a
 
      12-10-2004
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
%>
 
Reply With Quote
 
Rookie
Guest
Posts: n/a
 
      12-10-2004
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> > %>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get database metadata information (i.e. existing tables and columns in tables) Chris Brat Python 5 08-22-2006 05:25 PM
difference between pass by address and pass by reference!! blufox C Programming 2 04-03-2006 02:53 PM
Tables within tables Otuatail HTML 7 08-02-2004 04:42 AM
Text after 2 tables actually appears between 2 tables ! Peter Bassett HTML 3 08-15-2003 06:46 PM
Inserting into one table data from 2 tables and some input data. Renie83 ASP General 1 07-10-2003 08:29 PM



Advertisments