No, this is NOT what I am asking. Actually, I should use acLink as example code. But that is not the point. I am not asking code to import or link, I am asking if there is code to test connection (neither import or link).
Let me clarify my question again:
1. I build Access application, and I use my own Username/Password and the code acLink to Sybase table to Access Application already. However, if I close/save the file, the table connection is lost. When I re-open the file,a window will pop up for Username/Password again(see attached photo). So every time when I open the file and use the application, I need to provide Username/Password again. Network: password expires every a period of time anyway, so the password keeps changing. So every time when using the application, I need to provide CURRENT Username/Password.
2. Now when I deliver the product to colleagues, when user opens the file and run the program, it will ask for Username/Password too (see attached photo). That is the reason I build Login form to ask user to provide Username/Password.
3. There are many programs inside Access application, when user enters Username/Password through login form, I want the code to test if user provides valid Username/Password or not, since many programs inside the application require valid User/Password. If user provides correct username/password, then login form disappear and new form (with many buttons) appears, then user can click the button to run program to interact with back end Sybase database; If user provides incorrect Username/Password, then login form stays there, and returns error message then Exit Sub.