Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Startup connection to SQL Server

Startup connection to SQL Server

Startup connection to SQL Server

I have an .ADP application that I distribute to my customers.  Is there a way the program can ask for connection data on startup?  I have trouble talking them through the connection process when they first open the program.



RE: Startup connection to SQL Server

You can define your ADO-Connection with the OpenConnection-Method from the CurrentProject-Object.

see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/acmthOpenConnection.asp

I found little information about this, but you can use this method to set the database(connection) and the user + password.

just use:
CurrentProject.OpenConnection connectionstring, user, password

for the connectionstring just use a configured adp, and copy the string from the result of
debug.print CurrentProject.Connection

(as you can see this string also includes the databasename, perhaps you may want to change it for some reason, here you can do it...)

user is a user on the SQL-Server,
pw is the password for the user.

Use this method to built a self-made user-login or to set the connection in a startup-form.

You can check for connection with

hope this helps,
greetings from Germany,

RE: Startup connection to SQL Server

Danke Schoen, Jens.  

Do you know if there is an trigger/method for on Database open?  What I want is to trap the initial connection and then set it with the code you suggest.  I have looked, but can't find where the .ADP startup method is.

Thanks for your help!

Greetings from Oregon (just north of California)


RE: Startup connection to SQL Server

Never mind.  I just looked some more and found that the form I set in the Tools>Startup is where the login comes from.  So I can set it there.  I was looking for the wrong thing (again.)

Thanks for your help,


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close