Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 December 6th, 2005, 11:25 AM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Sami_Sami
Default Saving field info into 2 databases

Hi,

I am working on this project. I am working on a program where you enter information into fields. I need the info that is typed into the field to go simultaneously into two different databases.

 
Old December 6th, 2005, 02:50 PM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to karthik_p Send a message via Yahoo to karthik_p
Default

create 2 different functions where u assign the connectionstring field differently

chk it out and leme knw

 
Old December 7th, 2005, 05:36 PM
Authorized User
 
Join Date: Dec 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hemanth_p2p
Default

Assuming you are using SQL Server and you are using ADO.
If both the databases are on the same server, then u can point the initial catalogue to 'master' database. And if you have ADO command type as cmdText then, try a query like this
Insert into [db1].[dbo].[tbl_name] values(fieldnames)(values)
Insert into [db2].[dbo].[tbl_name] values(fieldnames)(values)

Although you will be running two queries..you can use the same connection. just two commands to execute :)

It should work for other type of DbConn's as well. Let me know.
--

Distributed computing ->Causality-> EventDriven ->We have the last laugh.!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on saving changes to databases PatCiferri SQL Server 2005 1 December 4th, 2007 04:56 PM
EXCEL question saving a file saving the the first macupryk VS.NET 2002/2003 0 January 6th, 2005 05:33 PM
How To avoid the SAving of toolbars while saving Hari_Word Excel VBA 6 July 26th, 2004 12:13 AM
info from one field to another automatically miller2000 Access 6 June 18th, 2004 08:59 AM
Where would I get info on how to download info aidanc ASP.NET 1.x and 2.0 Application Design 1 September 29th, 2003 02:45 PM





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