Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

UPDATE two tables in one update? ASP/VB?

LEGEND ,
Oct 27, 2006 Oct 27, 2006
Man, can I find the technote on this on the DW site?
Can someone point me in the right direction or provide me with instruction
on how to edit my DW UPDATE code to update more than one table?

Thanks.

Nath.


TOPICS
Server side applications
315
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 27, 2006 Oct 27, 2006
Tricky thing is, I have two tables and I need to update 1 field in one table
(live - yes/no), and 1 field, with a different name, (del - yes/no), in
another table.
Is this possible? I have Interakt's Insert into two tables extension but am
not sure how to edit this to make it an Update.
Is there an extension out there that will take the effort out of this, or is
it a hand-coded thing?

Any advice would be greatly appreciated again, thanks.

Regards
Nath.

"tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in message
news:ehsslh$n6l$1@forums.macromedia.com...
> Man, can I find the technote on this on the DW site?
> Can someone point me in the right direction or provide me with instruction
> on how to edit my DW UPDATE code to update more than one table?
>
> Thanks.
>
> Nath.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 27, 2006 Oct 27, 2006
LATEST

You can separate SQL commands with a semi-colon, like this:

' Construct SQL string
sqlSTRING = ""
sqlSTRING = "UPDATE dbo.table1 SET column1 = 1 WHERE whereclause1 = value1;
UPDATE dbo.table2 SET column2 = 2 WHERE whereclause2 = value2"
' Perform the update
set cmdUpdate = Server.CreateObject("ADODB.Command")
cmdUpdate.ActiveConnection = conn
cmdUpdate.CommandText = sqlSTRING
cmdUpdate.CommandType = 1
cmdUpdate.CommandTimeout = 0
cmdUpdate.Prepared = true
cmdUpdate.Execute()

HTH
Cheers,
Rob
http://robgt.com/ [Tutorials and Extensions]
Firebox stuff: http://robgt.com/firebox
Skype stuff: http://robgt.com/skype
SatNav stuff: http://robgt.com/satnav



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines