| Stonefield Query SDK |
| Login |
Syntax
Login(UserName as String, Password as String) as Boolean
Parameters
UserName
The name of the user to log in as (case-insensitive).
Password
The password for the user (case-insensitive).
Return Value
True if the log in was successful. The reasons it may fail are:
The ErrorMessage property contains the text of the reason for failure.
Example
This example, which could be used as the code for the Application.BeforeLogin script for a project, logs the user in using their network ID (this code assumes the password is the same as the user name).
Visual FoxPro
lparameters toApplication as SQApplication
local loWSH, lcUser
loWSH = createobject('WScript.Network')
lcUser = loWSH.UserName
toApplication.Users.Login(lcUser, lcUser) VBScript
function Main(Application)
dim WshNetwork
set WshNetwork = CreateObject("WScript.Network")
UserName = WshNetwork.UserName
Application.Users.Login(UserName, UserName)
end function JavaScript
function Main(Application) {
var WshNetwork ;
WshNetwork = new ActiveXObject('WScript.Network') ;
UserName = WshNetwork.UserName ;
Application.Users.Login(UserName, UserName) ;
} C#
public static bool Application_BeforeLogin(SFQApplication sfqApplication)
{
return sfqApplication.Users.Login(Environment.UserName, Environment.UserName);
} VB.NET
public shared function Application_BeforeLogin(sfqApplication as SFQApplication) _
as Boolean
return sfqApplication.Users.Login(Environment.UserName, Environment.UserName)
End FunctionSee Also
Users Collection
| Last Updated: 06/11/10 |