473,651 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Good use of CurrentProject. isConnected ?

I used to force a new connection between my Access 2K database and a
SQL Server backend every time the user launches the application, but it
seemed very slow, in fact using a timer function, I determined this
accounted for 90% of the startup time.

I am toying with this method below, where I use
CurrentProject. isConnected. My thought is that Access makes the
connection (based on the info provided in the connection dialog)
anyway, so why drop it and reconnect it if the connection is good...
I am hoping someone can shed some light on whether this is a good
practice or not.

Dim strConnect As String
Dim isConnected As Boolean
Dim myConnectionStr ing As String

isConnected = CurrentProject. isConnected

If isConnected = False Then
'make sure previous connection is closed:
CurrentProject. OpenConnection "Provider="

'create a new connetion to the Getty server:
strConnect = "PROVIDER=SQLOL EDB.1;INTEGRATE D
SECURITY=SSPI;P ERSIST SECURITY INFO=FALSE;INIT IAL
CATALOG=<Databa seName>L;DATA SOURCE=<ServerN ame>"

CurrentProject. OpenConnection strConnect

End If

Jun 9 '06 #1
7 4556
Lauren Quantrell wrote:
I used to force a new connection between my Access 2K database and a
SQL Server backend every time the user launches the application, but it
seemed very slow, in fact using a timer function, I determined this
accounted for 90% of the startup time.

I am toying with this method below, where I use
CurrentProject. isConnected. My thought is that Access makes the
connection (based on the info provided in the connection dialog)
anyway, so why drop it and reconnect it if the connection is good...
I am hoping someone can shed some light on whether this is a good
practice or not.

Dim strConnect As String
Dim isConnected As Boolean
Dim myConnectionStr ing As String

isConnected = CurrentProject. isConnected

If isConnected = False Then
'make sure previous connection is closed:
CurrentProject. OpenConnection "Provider="

'create a new connetion to the Getty server:
strConnect = "PROVIDER=SQLOL EDB.1;INTEGRATE D
SECURITY=SSPI;P ERSIST SECURITY INFO=FALSE;INIT IAL
CATALOG=<Databa seName>L;DATA SOURCE=<ServerN ame>"

CurrentProject. OpenConnection strConnect

End If


Forcing a new connection seems incredibly stupid to me, but it's what I
have come to expect from your ruminations. In any case I suggest that
you ask the:

" ...thousands of other competent technicians outside of [sic] cdma who
gladly share their knowledge without all the liberal paranoia exhibited
by some cdma posters -- people who chose NOT to be offended by the very
idea that anyone would want to implement a technological mechanism to
protect their intellectual property."

Perhaps, they will have:
"A SINGLE line of code was what cause all the other pieces to fall into
place."

If they can help, you may be able to continue your masquerade as a
Developer.

Jun 9 '06 #2
Lyle,
Thank you so much for pointing out the intellectual differences between
us. For a second, I thought I might just be able to make it in this
world, but now, thanks to you, I see that I cannot. Your genious is
amazing and thank you so much for sharing it with us all on such a
regular basis. I don't know what in the world we would all do without
your illuminations. Please, keep up the good work.
Lauren

Lyle Fairfield wrote:
Lauren Quantrell wrote:
I used to force a new connection between my Access 2K database and a
SQL Server backend every time the user launches the application, but it
seemed very slow, in fact using a timer function, I determined this
accounted for 90% of the startup time.

I am toying with this method below, where I use
CurrentProject. isConnected. My thought is that Access makes the
connection (based on the info provided in the connection dialog)
anyway, so why drop it and reconnect it if the connection is good...
I am hoping someone can shed some light on whether this is a good
practice or not.

Dim strConnect As String
Dim isConnected As Boolean
Dim myConnectionStr ing As String

isConnected = CurrentProject. isConnected

If isConnected = False Then
'make sure previous connection is closed:
CurrentProject. OpenConnection "Provider="

'create a new connetion to the Getty server:
strConnect = "PROVIDER=SQLOL EDB.1;INTEGRATE D
SECURITY=SSPI;P ERSIST SECURITY INFO=FALSE;INIT IAL
CATALOG=<Databa seName>L;DATA SOURCE=<ServerN ame>"

CurrentProject. OpenConnection strConnect

End If


Forcing a new connection seems incredibly stupid to me, but it's what I
have come to expect from your ruminations. In any case I suggest that
you ask the:

" ...thousands of other competent technicians outside of [sic] cdma who
gladly share their knowledge without all the liberal paranoia exhibited
by some cdma posters -- people who chose NOT to be offended by the very
idea that anyone would want to implement a technological mechanism to
protect their intellectual property."

Perhaps, they will have:
"A SINGLE line of code was what cause all the other pieces to fall into
place."

If they can help, you may be able to continue your masquerade as a
Developer.


Jun 9 '06 #3
Hi, Lyle.

I suspect that this isn't the same Lauren of Lead Management Consultants
(LMC.bz) that comes to this newsgroup to entertain us with her wild stories:

http://www.lmc.bz/privacy.php

.. . . and lecture us on intellectual property rights, while continuing to
plagiarize/steal copyrighted material, including the following article she
posted on her Web site:

http://www.lmc.bz/support.php?sub =Start%20Window s%20Faster!

.. . . which is copied verbatim (right down to the graphics) from PC
Magazine's book (and book excerpt published on the Web), "PC Magazine
Windows XP Speed Solutions," in which PC Magazine charges a monthly fee for
Web "reprints":

http://www.pcmag.com/article2/0,1759,1819090,00.asp

If any Access expert wants a heads up on the next questions that Lauren of
LMC.bz is going to ask so that he can write the exact VBA code for her for
the newest features of her application, please see the "Coming Attractions"
item on the list of her application's features on the following Web page:

http://www.lmc.bz/index.php

.. . . so that she can turn around and demand that her intellectual property
rights be protected for "her" software application because she does "NOT
want to live in a world where human contrived limitations stand in the way
of me or my progeny (or any other harmless person) having the opportunity to
become a TRILLIONAIRE as a result of pleasing their fellow man with products
or services that people simply DECIDE they cannot do without."

http://groups.google.com/group/comp....5a9e5df?hl=en&

She must be an awesome saleswoman if she can sell a Microsoft Access 2000
database application to enough people at enough profit where she'll beat out
793 billionaires to become the world's first trillionaire. She'll make Bill
Gates look like a slacker with his mere $50 billion of pocket change
compared to her wealth. Ka-ching!!!

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Lyle Fairfield" <ly***********@ aim.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Lauren Quantrell wrote:
I used to force a new connection between my Access 2K database and a
SQL Server backend every time the user launches the application, but it
seemed very slow, in fact using a timer function, I determined this
accounted for 90% of the startup time.

I am toying with this method below, where I use
CurrentProject. isConnected. My thought is that Access makes the
connection (based on the info provided in the connection dialog)
anyway, so why drop it and reconnect it if the connection is good...
I am hoping someone can shed some light on whether this is a good
practice or not.

Dim strConnect As String
Dim isConnected As Boolean
Dim myConnectionStr ing As String

isConnected = CurrentProject. isConnected

If isConnected = False Then
'make sure previous connection is closed:
CurrentProject. OpenConnection "Provider="

'create a new connetion to the Getty server:
strConnect = "PROVIDER=SQLOL EDB.1;INTEGRATE D
SECURITY=SSPI;P ERSIST SECURITY INFO=FALSE;INIT IAL
CATALOG=<Databa seName>L;DATA SOURCE=<ServerN ame>"

CurrentProject. OpenConnection strConnect

End If


Forcing a new connection seems incredibly stupid to me, but it's what I
have come to expect from your ruminations. In any case I suggest that
you ask the:

" ...thousands of other competent technicians outside of [sic] cdma who
gladly share their knowledge without all the liberal paranoia exhibited
by some cdma posters -- people who chose NOT to be offended by the very
idea that anyone would want to implement a technological mechanism to
protect their intellectual property."

Perhaps, they will have:
"A SINGLE line of code was what cause all the other pieces to fall into
place."

If they can help, you may be able to continue your masquerade as a
Developer.

Jun 10 '06 #4
Lauren Quantrell wrote:
Lyle,
Thank you so much for pointing out the intellectual differences between
us. For a second, I thought I might just be able to make it in this
world, but now, thanks to you, I see that I cannot. Your genious is
amazing and thank you so much for sharing it with us all on such a
regular basis. I don't know what in the world we would all do without
your illuminations. Please, keep up the good work.
Lauren


Lauren

I mistook you for someone else. I apologise for my comments.

As for your question, why are you forcing a new connection? What do you
think you will gain? It seems to take Access quite sometime to
establish a new connection. I run code like yours but only to make the
switch from the development server to the program server; thus it
happens only when a new ADP is first used.

As a caveat, I suggest create and open a new ADP, as a user might. A
Dialog should open and the Servers available to that user will appear
in a drop down. Use the most vital of them. Make the connection. Look
at the Database window. Are there tables and procedures there that a
user could manipulate without the benefit and direction of your
application? If there are, what now?

Jun 10 '06 #5
"'69 Camaro" wrote
If any Access expert wants a heads up
on the next questions that Lauren of
LMC.bz is going to ask so that he can
write the exact VBA code for her for
the newest features of her application,
please see the "Coming Attractions"
item on the list of her application's
features on the following Web page:

http://www.lmc.bz/index.php


How to Endear Yourself to the Denizens of comp.databases. ms-access: Promise
the next enhancement to your application will be new and exciting "spamming
technology", stealthified so it won't be detected as spam by your ISP!

<SNNNRRRRRCCCHH H>
Jun 10 '06 #6
Well, nothing helps to hide hypocrisy like chutzpah.

Thanks for the detailed presentation. I've never personally witnessed
something so blatant as what I found at those links.
Jun 11 '06 #7
Maybe I should change my first name to Monica to prevent being mistaken
in the newsgroups for someone really onerous?
lq

'69 Camaro wrote:
Hi, Lyle.

I suspect that this isn't the same Lauren of Lead Management Consultants
(LMC.bz) that comes to this newsgroup to entertain us with her wild stories:

http://www.lmc.bz/privacy.php

. . . and lecture us on intellectual property rights, while continuing to
plagiarize/steal copyrighted material, including the following article she
posted on her Web site:

http://www.lmc.bz/support.php?sub =Start%20Window s%20Faster!

. . . which is copied verbatim (right down to the graphics) from PC
Magazine's book (and book excerpt published on the Web), "PC Magazine
Windows XP Speed Solutions," in which PC Magazine charges a monthly fee for
Web "reprints":

http://www.pcmag.com/article2/0,1759,1819090,00.asp

If any Access expert wants a heads up on the next questions that Lauren of
LMC.bz is going to ask so that he can write the exact VBA code for her for
the newest features of her application, please see the "Coming Attractions"
item on the list of her application's features on the following Web page:

http://www.lmc.bz/index.php

. . . so that she can turn around and demand that her intellectual property
rights be protected for "her" software application because she does "NOT
want to live in a world where human contrived limitations stand in the way
of me or my progeny (or any other harmless person) having the opportunity to
become a TRILLIONAIRE as a result of pleasing their fellow man with products
or services that people simply DECIDE they cannot do without."

http://groups.google.com/group/comp....5a9e5df?hl=en&

She must be an awesome saleswoman if she can sell a Microsoft Access 2000
database application to enough people at enough profit where she'll beat out
793 billionaires to become the world's first trillionaire. She'll make Bill
Gates look like a slacker with his mere $50 billion of pocket change
compared to her wealth. Ka-ching!!!

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Lyle Fairfield" <ly***********@ aim.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Lauren Quantrell wrote:
I used to force a new connection between my Access 2K database and a
SQL Server backend every time the user launches the application, but it
seemed very slow, in fact using a timer function, I determined this
accounted for 90% of the startup time.

I am toying with this method below, where I use
CurrentProject. isConnected. My thought is that Access makes the
connection (based on the info provided in the connection dialog)
anyway, so why drop it and reconnect it if the connection is good...
I am hoping someone can shed some light on whether this is a good
practice or not.

Dim strConnect As String
Dim isConnected As Boolean
Dim myConnectionStr ing As String

isConnected = CurrentProject. isConnected

If isConnected = False Then
'make sure previous connection is closed:
CurrentProject. OpenConnection "Provider="

'create a new connetion to the Getty server:
strConnect = "PROVIDER=SQLOL EDB.1;INTEGRATE D
SECURITY=SSPI;P ERSIST SECURITY INFO=FALSE;INIT IAL
CATALOG=<Databa seName>L;DATA SOURCE=<ServerN ame>"

CurrentProject. OpenConnection strConnect

End If


Forcing a new connection seems incredibly stupid to me, but it's what I
have come to expect from your ruminations. In any case I suggest that
you ask the:

" ...thousands of other competent technicians outside of [sic] cdma who
gladly share their knowledge without all the liberal paranoia exhibited
by some cdma posters -- people who chose NOT to be offended by the very
idea that anyone would want to implement a technological mechanism to
protect their intellectual property."

Perhaps, they will have:
"A SINGLE line of code was what cause all the other pieces to fall into
place."

If they can help, you may be able to continue your masquerade as a
Developer.


Jun 11 '06 #8

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

Similar topics

10
2027
by: KN | last post by:
I know both are pretty much the same and it comes down to personal choice. But I have to make the choice for the team. Things so far that I am considering 1. XML documentation in C# -- thats good.. not there in VB.net?? 2. Some language features of VB.Net like Redim(makes it easier for developers), but not good enough reason. 3. C# is in more like standard languages and key words used are more
29
3004
by: RAY | last post by:
Hi , my boss has asked I sit in on an interview this afternoon and that I create some interview questions on the person's experience. What is C++ used for and why would a company benefit from someone who could use it? I would like you guys/and gals to give me some good questions & the correct answers so I can give this person a good review for my boss.
0
4767
by: Steve Morris | last post by:
Why does CurrentProject.Connection.Execute "qryStoresImport5ToStage", RecordsAffected, adCmdText return the error: Run-time error'-2147217900(80040e14)': Invalid SQL statement; Expected 'DELETE','INSERT','PROCEDURE','SELECT, OR 'UPDATE'. but Dim SQL As String SQL = "INSERT INTO StoresStage ( StoreNumber, StoreName,
3
12600
by: Ol!v!é | last post by:
I have an ADP Project in MsAccess XP, with an MSSQL-backand (MSDE). I would like to set the Connection of the project from VBA, so all the forms and reports can use it. Normally, I set this through the File->Connection menu, but if the network connection falls away for a moment, I have to reconnect manually. I would like to reconnect automatically with VBA. I've tried using CurrentProject.Connection.Open and...
1
10410
by: carmela_wong | last post by:
Hello all, I had a database in MS Access 2003 which I converted to Access 97. The "CurrentProject" object causes an error in the code that was automatically written by Access when I created the original database. I have researched and this object is only available in version 2000 and later. I need to get rid of the reference to "CurrentProject" and replace it with something that will work in Access 97. Here's what the code looks like:
6
13484
by: alex.hatzisavas | last post by:
Hi all. I'm having a serious problem when i'm trying to use the CurrentProject.Connection property for some ADO manipulation. Here's the error message i'm getting: Run-time error '-2147220999 (800401f9)': Method 'Connection' of object '_CurrentProject' failed
0
1847
by: cyberdwarf | last post by:
Hi y'all I like to be able to trap the OnClose event for the CurrentProject.Connection in my ADE. As this is a very large project, I can't see where, or how I should insert the code to reconnect to the SQL server if the connection is lost when the user is away from the workstation for a while..... Anyone got any ideas? All help greatly appreciated
5
9305
by: akirekab | last post by:
Can this be saved somehow in a field in the database along with some other address criteria, so I can always be looking at the current location. like this? Application.CurrentProject.Path\year\month\nbr 9.jpg and when pulled out, you get C:\Folder1\year\month\nbr 9.jpg with C:\Folder1 being the current path
76
4032
by: lorlarz | last post by:
Crockford's JavaScript, The Good Parts (a book review). This shall perhaps be the world's shortest book review (for one of the world's shortests books). I like Douglas Crockford (because I am a crabby old man too; plus he _is_ smart and good).. But, how can he write a book on the good parts of JavaScript and not mention functions that address CSS & DOM? Weird. It's like
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8576
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.