I have a Form "EntityF" that is connected to "EntityT". EntityT is in a Winhost SQL Server. I created a dsn connection myConn.dsn When I open the Form it opens Fine When I close the form it is requesting the Password: --------------------------------------------------- Server: 2s6.winhost.com LoginID: DB_xxxxx_dtata_user Password: __________________ (requested) --------------------------------------------------- If I put the password the form Closes ok.
I have deleted and recreated the dbo Connection and the problem persist. Why is the server asking for the Password to close the File? How can I solve this Problem?
ps. There are other connections where this is not happening.
Kevin Yip
@Reply 3 years ago
Forms don't use DSN; data do. So check all data sources (tables, queries) for the form to see if they have the proper connections built-in. Do you use the Windows ODBC app to set up these connections (see picture below)? Check if the correct and up-to-date ODBC driver is used. I've fixed many connection issues by just updating the driver. Using the ODBC app is better than using a file DSN. Storing passwords and credentials in a plain text file is probably not a good idea.
Kevin Yip
@Reply 3 years ago
Eduardo BenaimOP
@Reply 3 years ago
Thank you Kevin. I am Following Richards recommendations creating a File ODBC. I am still using Access32Bit.
This is what I am doing
Private Sub RelinkTablesBtn_Click()
This is straight out of Richards Code.
Can anyone see something missing?
Eduardo BenaimOP
@Reply 3 years ago
I found that the Problem was that a pause is needed in between the Relinks.
I added Sleep 1000 and that apparently fixed the Problem.
This makes me think also that In the Relink sub we are not clearing the variables.
Update: The Problem still Persist.
Richard, please take a look when you can.
Thanks
Kevin Robertson
@Reply 3 years ago
Your connection string is stored in a TempVars, would it be being cleared somehow? Perhaps try using Constants instead? Just brainstorming.
Eduardo BenaimOP
@Reply 3 years ago
Kevin, Thank you.
I believe you are right. Somehow the "tempvars" are getting reset.
I changed the Tempvars Connection Strings to Global variables and it is working fine for now.
I will report any changes.
Eduardo BenaimOP
@Reply 3 years ago
One more thing: Do you think that
RelinkTable "tblUser", "ID"
may have a problem with the use of the index word "ID"? (Reserved?)
whare:
Private Sub RelinkTable(TableName As String, IndexField As String)
Dim db As Database
Dim td As TableDef
Dim SQL As String
Status "Relinking " & TableName
Set db = CurrentDb
On Error Resume Next
db.TableDefs.Delete (TableName)
On Error GoTo 0
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access SQL Server Lessons.