DanielGreenwood
Technical User
Hi,
I'm developing an internal system using data access pages to view data stored on Access 2003. In order for the users to only see the data relevent to them i would like to filter based on their login name.
I have found it's not possible to do this using a database login therefore need to grab the windows ID. I found this code to get the ID:
This code works when i run it as stand alone htm but gives the 429 error 'ActiveX cannot creat the object'.
Does anyone have any idea why this won't work when in a data access page or another way of getting the windows user name?
I'd be grateful for your help.
I'm developing an internal system using data access pages to view data stored on Access 2003. In order for the users to only see the data relevent to them i would like to filter based on their login name.
I have found it's not possible to do this using a database login therefore need to grab the windows ID. I found this code to get the ID:
Code:
<SCRIPT language=VBScript>
Dim objNet
On Error Resume Next 'If fail to create object then display error
' (press no message)
Set objNet = CreateObject("WScript.NetWork")
If Err.Number <> 0 Then 'If err
MsgBox err.number & " " & err.Description
'Document.Location = "test2.html" 'Display document by placing name again
End if
Dim strInfo
strInfo = "User Name is " & objNet.UserName & vbCRLF & _
"Computer Name is " & objNet.ComputerName & vbCRLF & _
"Domain Name is " & objNet.UserDomain
txtUserName.value = strInfo
Set objNet = Nothing 'Destroy the Object
</Script>
This code works when i run it as stand alone htm but gives the 429 error 'ActiveX cannot creat the object'.
Does anyone have any idea why this won't work when in a data access page or another way of getting the windows user name?
I'd be grateful for your help.