ADP Logon Forms

  • Thread starter Thread starter Rudi Groenewald
  • Start date Start date
R

Rudi Groenewald

Hey people,

Is it possible to use a login form in access adp files? I'd like to use my
own customized "Login Forms" when access connects to sql server....

Is this possible and how would I do this?

Thanks alot in advance
Rudi Groenewald
 
I have just been working on exactly the same thing.

What I have done is the following:

Created a form that has the sole purpose of starting the app disconnected
next it opens. This statement achieves that: CurrentProject.OpenConnection
""
The statement is placed in the OnClose event of the form and the form is
hidden throughout.

In my own login form I use the following statements
strConnectionString = "Provider=sqloledb;Data Source=" & strServer &
";Initial Catalog=" & strDatabase & ";Integrated Security=SSPI"
Application.CurrentProject.OpenConnection strConnectionString

I am so far using integrated security but will change at a later stage. The
connection string then needs to change to something like
Provider=sqloledb;Data Source=myServerName;Initial
Catalog=myDatabaseName;User Id=myUsername;Password=myPassword

Hope it helps
 
Hey Bobby,

Umm... ok... I think that might help... but will it open up a form when
opening the adp file? before it asks for authentication, as far as I know,
access asks you before it does anything else, to login to sql server.....


Any luck with getting it to work?

Rudi
 
In order to avoid the authentication form to pop up I use the statement:
CurrentProject.OpenConnection ""

I just make sure it is the last statement run before closing down the app.
Next time I open the adp I see "disconnected" in brackets in the database
window. It does work here.

So the answer is yes, it does work.

Some will argue that having a hidden form doing some cleaning up work when
the app closes is not fool proof but it is good enough for my purposes.
 
Back
Top