You need to sign in to do that
Don't have an account?
Classic ASP - webscript logon issues using Office Toolkit
I'm just looking at accessing the data on salesforce from our web site which is classic ASP,
The office toolkit has been installed on the web server, but whenever I try to make the login call, it returns false and does not create a valid session.
I have tried using two different username/password combinations, appending the security token to the end of the password and not, but whatever I do it gets to the "Login Failed" line below. The office toolkit seems to be validly installed because it is not failing when the object is created.
Does anyone have any idea what I'm doing wrong?
Thanks in advance
<%@ Language="VBScript" %>
<%
dim g_sfApi
function login(username, password)
set g_sfApi=Server.CreateObject("SForceOfficeToolkit3.SForceSession3.1")
login=g_sfApi.Login(Username,Password)
end function
%>
<body>
<%
dim lr, sid, serverUrl, row, rc
dim qr' as QueryResultSet3
dim s' as SObject3
'lr = login(username, password1)
lr=login(username2,password2)
if not lr then
Response.Write("Login Failed")
else
set qr=g_sfApi.Query("select * from account",false)
...
Below is what I'm using successfully.
Try declaring g_sfApi as SForceOfficeToolkitLib3.SForceSession3.
Perhaps it is because you have not assigned a return datatype to the login function. It is probably returning a datatype of Variant, and I don't know if that will evaluate correctly in a test for true/false.
Public g_sfApi As SForceOfficeToolkitLib4.SForceSession4 Public Function LoginToSForce(strUserName As String, strPW As String) As Boolean Dim x As Variant Set g_sfApi = New SForceOfficeToolkitLib4.SForceSession4 x = g_sfApi.Login(strUserName, strPW) If (g_sfApi.Error = NO_SF_ERROR) Then LoginToSForce = True Else MsgBox g_sfApi.ErrorMessage LoginToSForce = False End If End Function
I make all calls through the public variable g_sfApi.
Thanks this is clarifying a bit where the problem is coming in:
Login Failed5103Unable to send request to server. A connection with the server could not be established
Which sounds like the web server firewall is blocking access to the salesforce login. I had a quick look through the office connector documentation, but I can't find mention of any firewall settings to be permitted for this operation. Does anyone there have a reference I can use for this somewhere, or just know what I need to permit access for?
Further update, the firewall settings are all correct now,
but it now just freezes when the login call is made, and does not return :(