PC Review


Reply
Thread Tools Rate Thread

Avoid logon dialog to connect to SQL 2005

 
 
Gabriele Bertolucci
Guest
Posts: n/a
 
      3rd Mar 2006
I have the following problem with Access XP and SQL 2005 Express Edition:
i would like to avoid visualization of Access default logon dialog when I
open my ADP procedure.

I've read the following MS article:

ACC2000: Access Project Prompts You to Log On Even Though "Blank Password"
Check Box Is Selected (Q202615)

Obviously I have my custom logon form.
ADP project has a form (a switchboard) which is opened at startup (after
user authentication) and is closed only when application quits.
Here is the Form_Unload event code for the switchboard:

Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Form_Unload_Err
If MsgBox("Do you want to close the application?", vbYesNo + vbQuestion,
"Closing application") = vbYes Then
' Application.CurrentProject.CloseConnection
Application.CurrentProject.OpenConnection ""
Application.Quit
Else
Cancel = True
Exit Sub
End If

Form_Unload_Exit:
Exit Sub

Form_Unload_Err:
MsgBox Err.Description
Resume Form_Unload_Exit
Resume
End Sub

Unfortunately I'm receiving the following error:

"Method 'OpenConnection' of object '_CurrentProject' unsuccessful" (I translated
from italian, so may be something like this)

I tried to uncomment the linke of code with the CloseConnection, but unsuccessfully.
I tried to edit the line of code with the OpenConnection, passing no parameters,
but unsuccessfully too.

I would not think the problem is related to SQL 2005 Express Edition.

Who know most, please lift his hand and speak up!!! I would like it very
much :-)

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it


 
Reply With Quote
 
 
 
 
Gabriele Bertolucci
Guest
Posts: n/a
 
      6th Mar 2006
Finally I got a solution.

Thanks a lot to Giorgio Rancati (italian MVP) who led me to the right code
line!!!!
Many thanks Giorgio!!!

The secret was to unbind the form from the server, with the following code
in the Form_Unload:

Me.RecordSource= ""
Application.CurrentProject.CloseConnection
Application.CurrentProject.OpenConnection ""

Again, very very very many thanks to Giorgio for the help he gave me.
Giorgio, God bless you!!!

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server 2005 "Connect to Server" Dialog jwgoerlich@gmail.com Microsoft C# .NET 1 7th Jan 2008 03:51 PM
Visual Studio .NET 2005 WebParts can't connect to SQL Server 2005 XJ Microsoft ASP .NET 8 7th Jan 2008 08:51 AM
Avoid login dialog sshock@gmail.com Microsoft Outlook VBA Programming 1 26th Sep 2006 05:47 PM
How to avoid an error dialog =?Utf-8?B?anVzdGFndXlmcm9ta3k=?= Microsoft Excel Programming 2 18th Feb 2006 10:02 PM
How do i avoid the Xp Startup Logon Dialog pop up. =?Utf-8?B?TmF6?= Windows XP General 3 22nd Mar 2005 06:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 PM.