I want to express my excuses about this...
I made a mistake when selecting the main object on the project, On design time I used to run the program wich calls the form, but the project's main object was the form, so the connection was not made.. I would like to give more details about this, but i think my english is not good enough..
If you want, I can preppare a document with several more explicative screenshots and send it to you...
>>Hi.
>>I have a program that access a SQLServer database called Anddox2 only when i run it within Visual Foxpro; but when I compile it and run the executable; it gives the next error:
>>
>>Connection Failed:
>>SQLState: '08004'
>>SQL Server Error: 4060
>>Server rejected the connection; Access to selected database has been denied
>>
>>Then it shows the SQLServer Login window..
>>I'm working with this connection string:
>>
>>proconn=SQLSTRINGCONNECT([Driver={SQL Server};Server=METAFRAME;DATABASE=anddox2;Trusted_Connection=yes;])
>>
>>
>>As you can see, I'm working with a DSNLess, trusted connection..
>>
>Try to omit the "Database=" part from the connectstring, to see whether it's the matter of the rights to this particular DB or just accessing the server.
>
>Then somewhere in the startup of your app, try to "USE ANDDOX2" via SqlExec() and check whether you're getting any error. If it's still complaining about the rights, then you need to check your rights to this DB - and also to check the username under which your app accesses the server. Something is not letting you in, and I hope some of these will tell you what.