Discussion Locked

SQL Server ODBC Connection

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I program the UserID and Password into a VBA application (Access97) so that the client using the front end doesn't need to enter password (and will not know what it is) . The user can only get into the tables the program allows.

5 replies

by donq

Paste the UserID anywhere using:
FieldToFill = CurrentUser()
and paste a password using as long as the password is not encrypted:
FieldToFill = [PasswordFieldName] or
FieldToFill = "PasswordFieldName"

It's difficult to figure what securityyou are enabling using a password this way - it's not secure itself or not required for user access?

by frankus

I couldn't make it work this way. Asked question on e-mail, but didn't get an answer.

by gutridgesj

I am using this in an Access97 DB to an SQL server using ODBC.

DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=MyDSN;UID=MyUserId;PWD=MyPasswd;database=MyDatabase", acTable, "dbo.Mytable", "dbo_MyTable"

If you do not want users to see that code, i am not sure how to do but if you make the mdb an mde file, it might hide it.

This discussion is closed to new replies.