Prev   Next

Back to the top of the FAQ

Q. Example of use in an aspx page

A.

<%@ Page Language="vb"%>
<%@ Page aspcompat=true %> 
<HTML>
<body>
<%
dim auth, pathname, result
auth = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1")
pathname="c:\inetpub\wwwroot\customer2\"
result = auth.AuthAdd(pathname)
auth.AuthDataAuthentiXDBEnabled(pathname) = False
auth.AuthDataODBCEnabled(pathname) = True
auth.AuthDataCustomSelect(pathname) = 2
auth.AuthDataODBCAdvancedUsage(pathname) = 1
auth.AuthDataODBCConnectString(pathname) =  "DSN=test;uid=test;pwd=test;"
auth.AuthDataODBCAdvancedString(pathname) 
	= "aulogin '$USERNAME$', $PASSWORD$', 'customer1'" 
auth.AuthDataODBCImpersonate(pathname) = False
auth.AuthDataODBCOverrideEnabled(pathname) = False
auth=nothing
response.Write( result)
%>
</body>
</HTML> 

Note the use of <%@ Page aspcompat=true %> . Without this you will get the error: "The component 'AUTHXOCX.AuthXOCXCtrl.1' cannot be created. Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive."

Back to the top of the FAQ

Prev   Next