473,564 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

use existing connection or create new

I'm wondering which is the best approach using an Access2K front end
and a SQL Server 2K backend.
I have a stored procedure running three INSERT INTO statements that
inserts records into three different tables.

Should I use the ADP project connection as set through the Access
Connection window:
Set cmd = New ADODB.Command
Set cmd.ActiveConne ction = CurrentProject. Connection

Or, should I create a new connection, then execute the command, then
close the connection.

Does it make any difference at all?
Would it make a difference as far as minimizing blocking errors to do
it one way or the other?

Help is appreciated.
lq
Nov 12 '05 #1
1 2472
Lauren Quantrell wrote:
I'm wondering which is the best approach using an Access2K front end
and a SQL Server 2K backend.
I have a stored procedure running three INSERT INTO statements that
inserts records into three different tables.

Should I use the ADP project connection as set through the Access
Connection window:
Set cmd = New ADODB.Command
Set cmd.ActiveConne ction = CurrentProject. Connection

Or, should I create a new connection, then execute the command, then
close the connection.

Does it make any difference at all?
Would it make a difference as far as minimizing blocking errors to do
it one way or the other?

Help is appreciated.
lq


I'd use one connection wrapped in a transaction, that way I can roll
back everything if one fails.

The only time I'd use another connection is to be outside of the
transaction, e.g for error logging purposes, I found out the hard way
that my error log got rolled back when I rolled back everything else.
--
But why is the Rum gone?
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
327
by: Lauren Quantrell | last post by:
I'm wondering which is the best approach using an Access2K front end and a SQL Server 2K backend. I have a stored procedure running three INSERT INTO statements that inserts records into three different tables. Should I use the ADP project connection as set through the Access Connection window: Set cmd = New ADODB.Command Set...
0
2390
by: Mike | last post by:
VB .NET 2003, Pocket PC 2003, CF 1.0 SP 2 Only when I use a proxy server, I'm getting this error when attempting to write data to a Stream object from an HTTPWebRequest object. (System.IO.Stream.Write() raises the exception):"An existing connection was forcibly closed by the remote host". The error only happens with fairly large amounts of...
0
1953
by: SisAndz | last post by:
Hello, I'm trying to do a secure connect to the site https://212.77.100.18/p/ with ..net 2.0 HttpWebRequest class, unfortunately for some reason I'm not able to do that - WebException is thrown with inner exception message of "An existing connection was forcibly closed by the remote host." I hoped I'll solve my problem with...
2
3343
by: Alan Mailer | last post by:
I'm sorry if this one has been asked and answered a million times: Is it possible to have a VB6 app alter the name of an *existing* field in Access 2002 database? To be clear, I'm not talking about adding a new field to the Access database. I want to change the name of an *existing* field using a VB6 app. What type of VB6 code would you...
0
385
by: ricolee99 | last post by:
Hi Everyone, I'm using the System.IO.Ports.SerialPort component to attempt to kill an existing component opened by another application. I use the following code: SerialPort serialPort = new SerialPort ("COM1"); if(serialPort.IsOpen)
1
12671
by: balaya | last post by:
was an error downloading 'https://pushmxtest.equitynational.com/EquityNational/PushMXService.svc/secure'. The underlying connection was closed: An unexpected error occurred on a receive. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly...
4
2227
by: Anbu | last post by:
Hi All, I'm using the Cassini component in my desktop application to create a web site to host the web services. The application works fine in normal scenario. If the system is kept idle for some time, the application getting terminated with the following error: Unhandled Exception : An existing connection was forcibly closed by the...
1
5164
by: arcingmad | last post by:
Hi I am using the following code in a button click event to run a query stored in a .mdb file from an external geographic program ArcGIS via a jet adodb connection I have the need to run an existing make table query, my problem is it will over write an existing table. i.e when run in access a warning that you are about to overwrite an existing...
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.