|
 |
asp_databases thread: ASP to Query to Tables
Message #1 by sgarstin@t... on Mon, 23 Oct 2000 09:48:52 +0100
|
|
I am writing an ASP application which will run an Access 2000 APPEND QUERY
to enable data to be inserted into an Access database. Simple enough.
However I would like the APPEND query to be able to append data to more
than one Access table.
From many attempts it appears that this is not possible, ie. although you
can select data from many tables in one query, you can only append data to
one table in an Access 2000 query.
Is this true or is there a way of getting a query to append data to more
than one table ?
Apologies if this question appears more access-related than asp, however
in mitigation the answer will determine how the asp code is written !
Many thanks
Simmon Garstin
Message #2 by "Ken Schaefer" <ken@a...> on Tue, 24 Oct 2000 13:30:41 +1000
|
|
To be honest, I don't think you can do this.
If you think about appending, and selecting a little bit more, you will see
that there are differences between the two. The SELECT query allows you to
get data from more than one table because a relationship exists between the
two, and you use a join on that relationship (unless you're using some kind
of UNION query).
Adding data works in a different way.
Basically, insert the data into one table, and then insert the data into the
2nd table:
strSQL = "INSERT INTO table1..."
objConn.execute(strSQL)
strSQL = "INSERT INTO table2...'
objConn.execute(strSQL)
Cheers
Ken
----- Original Message -----
From: <sgarstin@t...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, October 23, 2000 6:48 PM
Subject: [asp_databases] ASP to Query to Tables
> I am writing an ASP application which will run an Access 2000 APPEND QUERY
> to enable data to be inserted into an Access database. Simple enough.
> However I would like the APPEND query to be able to append data to more
> than one Access table.
> From many attempts it appears that this is not possible, ie. although you
> can select data from many tables in one query, you can only append data to
> one table in an Access 2000 query.
> Is this true or is there a way of getting a query to append data to more
> than one table ?
> Apologies if this question appears more access-related than asp, however
> in mitigation the answer will determine how the asp code is written !
>
> Many thanks
>
> Simmon Garstin
>
|
|
 |