Access 2002 fails in VB Function under Vista

A

Amos Sobel

I did write a big Access/Msql application which is using one VB function
which does recover the network UserName. Here it is:

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function

This works OK under Windows XP but fails under Windows Vista.
The failure is in the String$ statement and the error report talks about a
missing project or library.
This means that Access 2002 is not compatible with Windows Vista and that
something must be done with the VB included in Access 2002. I know very
little about VB so I ask for this comunity's help.

Amos Sobel
 
M

missinglinq via AccessMonster.com

"The failure is in the String$ statement and the error report talks about a
missing project or library. This means that Access 2002 is not compatible
with Windows Vista"

No, it doesn't mean that Access 2002 "is not compatible with Windows Vista,"
although there are problems with all versions of Access and Vista, depending
on how the db is structered/distributed, but rather that the reference to a
library is missing. For step-by-step instructions on remedying this, goto
this site:

http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top