>I have never done a Connection String before in Crystal Reports, but I think I have it figured out. I just want to double-check that my thinking is correct on this... I am using Crystal Reports 11, but I think this works the same for almost any version Crystal because soon I will need to do it in Crystal Reports 7 also.
>
>On Report Refresh in Crystal it asks for
>Server (I know the Server Name)
>User ID (I know the User ID)
>Password (I know the Password)
>Database ( I dont' know the Database Name, but I am getting it on Monday)
>Trusted Connection (I don't know whether to check this box or not)
>
>Is this all I need to know under Report Refresh so I can connect successfully from an existing report to a remote server located miles away that contains the SQL Server database and tables?
>
>I already have an icon my desktop that allows me to successfully connect to their VPN which is working fine!
>
>Please let me know if once I get the Database Name if I will be in business using Connection String under Report Refresh.
A typical connection string looks like:
"Driver=SQL server;server=servername;Trusted_connection=yes"
servername is either a name or an IP (with port number if not default).
"Trusted_connection=yes" or "Integrated security=SSPI" is the preferred authentication. However instead you might need User ID and Password (if using Trusted_connection leave them empty).
If you're connecting through VPN then most likely you'd use Trusted_connection=yes.
You might try the needed connection string in VFP like this:
local lnHandle
lnHandle = SqlStringConnect( "Driver=SQL server;server=servername;Trusted_connection=yes" )
if m.lnHandle > 0
? 'OK'
SQLDisconnect(m.lnHandle)
endif
Cetin