You need to sign in to do that
Don't have an account?
steven75
Classic ASP / VBScript Connection
Hi,
I am trying to connect to SalesForce using Classic ASP. I have downloaded the "SForce Office Toolkit.msi" version 4 and installed on my web server. I attempted to use this code below (found in this forum), but could connect to SalesForce.
<% Dim SforceApi Dim sObject(0) Set SforceApi = server.CreateObject("SForceOfficeToolkit4.SForceSession4.0") if SforceApi.Login("mylogin","mypassword_and_securityToken") then Set sObject(0) = SforceApi.CreateObject("Lead") sObject(0).Item("FirstName").value = "Test" sObject(0).Item("LastName").value = "Testing" if SforceApi.Create(sObject,false) then Response.Write "Correct insert " else Response.Write "Error on insert" end if else response.Write "login failed" end if Set SforceApi = nothing Set sObject(0) = nothing %>
Any advice, please?
That link is very helpful. Thanks alot for being patient and helpful. Appreciated!
All Answers
What goes wrong?
So it removed the "0" in the object, and it seemed to passed the login like this below.
Set SforceApi = server.CreateObject("SForceOfficeToolkit4.SForceSession4")
Then, it complained the required the company name, then I add the Company like below and it said "Insert Error". Not sure what I need to do.
----------------------------------------------------------------
I also try this following to see if I can loop through and list all the account names. but no luck.
I am getting this error below. It doesn't know EOF.
error '800a01b6'
Microsoft VBScript runtime
Object doesn't support this property or method: 'EOF'
/test/sf2.asp, line 24
Please help,
Thanks,
There is no EOF on query Result, have you seen the office toolkit docs ? http://www.salesforce.com/us/developer/docs/officetoolkit/index.htm
That link is very helpful. Thanks alot for being patient and helpful. Appreciated!
Simon,
One more question. I was successfully connected to the free test account (Enterprise), but when I try this for the real production account (Professional), I was getting login failed error and I have double-check username/password multiple times to make sure it correct. Could it be because of the free test account has "enabled" OfficeTool somewhere, and production account is "disabled"? Or the Professional version doesn't support OfficeToolKit?
Thanks,
Professional Edition doesn't include API access.
Why not post a working example an tag that as your answer? =)