We are trying to access a SQL Server 7.0 table using the remote view "sql_Vehicle". Using all four methods below from within the development environment, the connections appear to work correctly, but when you go to use the remote view, it always prompts for the password. If the environment is set to not prompt for the password (Tools->Options->Remote Data->Show Login=Never), then the ODBC driver error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection" is displayed. The DSN is set for TCP/IP connection to the SQL Server and a network sniff shows that it is using the TCP/IP port to communicate with the SQL Server.
What needs to be done to use the remote view without being prompted for a password?
Method 1:
modi conn connect1
=DbSetProp("Connect1", "Connection", "UserID", cUserName)
=DbSetProp("Connect1", "Connection", "Password", cPassword)
Use sql_Vehicle in 0
Method 2:
nConnectionHandle = SqlStringConnect('dsn='+cDSN+';uid='+cUserName+';pwd='+cPassword)
? SqlSetProp(nConnectionHandle, 'DispLogin', 3)
Use sql_Vehicle in 0
= SqlDisConnect(nConnectionHandle)
Method 3:
nConnectionHandle = SqlConnect(cDSN, cUserName, cPassword)
? SqlSetProp(nConnectionHandle, 'DispLogin', 3)
Use sql_Vehicle in 0
= SqlDisConnect(nConnectionHandle)
Method 4:
STORE SQLCONNECT(cDSN, cUserName, cPassword) TO gnConnHandle
IF gnConnHandle <= 0
= MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
ELSE
= MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
Use sql_Vehicle in 0
= SQLDISCONNECT(gnConnHandle)
ENDIF
Melissa Danforth
Customsoft Corporation