PC Review


Reply
Thread Tools Rate Thread

Error Message: "Undefined function "Date" in expression"

 
 
Archidrb
Guest
Posts: n/a
 
      11th Mar 2009
This morning users in my database started getting this message hen opening
the database. I use an autoexec command to start the database and open a
(splash scrren). This form that opens shows the most up to date version
number, so I know right there the ODBC connection to the SQL Server backend
is working. Then when that form closes the main menu opens.

As part of the main menu, a bit of code goes out and grabs the user's LAN ID
and populates it into a hidden field on the main menu. This field then
allows the user to update records and their name automatically populates.
This name also limits access to certain bits of the database using macros.

Each users gets this error four times, then the VBA de-bugging window opens
and the code attached to this LAN ID process opens. It highlights the line
containing the name of the function - which of course had not to do with a
'Date'.

Here is the code, I removed the (green) notes to save space and reading time.


Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
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

Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?


 
Reply With Quote
 
 
 
 
Archidrb
Guest
Posts: n/a
 
      12th Mar 2009
Sorry, Office (Access) 2003, Windows XP-Pro 2002 SP2

"ruralguy via AccessMonster.com" wrote:

> You did not mention what version of Access you are using nor the OS in play.
>
> Archidrb wrote:
> >This morning users in my database started getting this message hen opening
> >the database. I use an autoexec command to start the database and open a
> >(splash scrren). This form that opens shows the most up to date version
> >number, so I know right there the ODBC connection to the SQL Server backend
> >is working. Then when that form closes the main menu opens.
> >
> >As part of the main menu, a bit of code goes out and grabs the user's LAN ID
> >and populates it into a hidden field on the main menu. This field then
> >allows the user to update records and their name automatically populates.
> >This name also limits access to certain bits of the database using macros.
> >
> >Each users gets this error four times, then the VBA de-bugging window opens
> >and the code attached to this LAN ID process opens. It highlights the line
> >containing the name of the function - which of course had not to do with a
> >'Date'.
> >
> >Here is the code, I removed the (green) notes to save space and reading time.
> >
> >Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
> > "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
> >
> >Function fOSUserName() As String
> >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
> >
> >Did Microsoft release an update or hotfix that is causing this problem? Any
> >other ideas?

>
> --
> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200903/1
>
>

 
Reply With Quote
 
 
 
 
Archidrb
Guest
Posts: n/a
 
      12th Mar 2009
I should also mention that I am not having this problem, but four of my end
users are.

"ruralguy via AccessMonster.com" wrote:

> You did not mention what version of Access you are using nor the OS in play.
>
> Archidrb wrote:
> >This morning users in my database started getting this message hen opening
> >the database. I use an autoexec command to start the database and open a
> >(splash scrren). This form that opens shows the most up to date version
> >number, so I know right there the ODBC connection to the SQL Server backend
> >is working. Then when that form closes the main menu opens.
> >
> >As part of the main menu, a bit of code goes out and grabs the user's LAN ID
> >and populates it into a hidden field on the main menu. This field then
> >allows the user to update records and their name automatically populates.
> >This name also limits access to certain bits of the database using macros.
> >
> >Each users gets this error four times, then the VBA de-bugging window opens
> >and the code attached to this LAN ID process opens. It highlights the line
> >containing the name of the function - which of course had not to do with a
> >'Date'.
> >
> >Here is the code, I removed the (green) notes to save space and reading time.
> >
> >Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
> > "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
> >
> >Function fOSUserName() As String
> >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
> >
> >Did Microsoft release an update or hotfix that is causing this problem? Any
> >other ideas?

>
> --
> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200903/1
>
>

 
Reply With Quote
 
Archidrb
Guest
Posts: n/a
 
      12th Mar 2009
SQL Server backend connected using ODBC. I have a design master that is
replicated to a "master replica", then each user has their own copy (replica)
of the front end made from the master replica. This way I can make
structural changes, synch to the master replica, then each user can
synchronize the changes.

"ruralguy via AccessMonster.com" wrote:

> Is your application split FrontEnd and BackEnd and does everyone have their
> own copy of the FrontEnd? Or is this not a MultiUser application? Are the
> users using MDE or MDB? Are there any reference errors that have cropped up?
>
> Archidrb wrote:
> >I should also mention that I am not having this problem, but four of my end
> >users are.
> >
> >> You did not mention what version of Access you are using nor the OS in play.
> >>

> >[quoted text clipped - 34 lines]
> >> >Did Microsoft release an update or hotfix that is causing this problem? Any
> >> >other ideas?

>
> --
> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via http://www.accessmonster.com
>
>

 
Reply With Quote
 
Archidrb
Guest
Posts: n/a
 
      12th Mar 2009
MDB's.

The error says "Undefined function 'Date' in expression". It pops-up four
times upon opening the database, then the VBA code debug window opens to the
code that runs to paste the users LAN ID onto the main menu. Then closing
the debugger allows the database to open, but the name does not paste.

I know that the SQL Server backend is connecting because there is a splash
form that comes up first showing the version of the database. The version is
stored in a SQL table in the backend. So whatever is causing the problem
occurs after the ODBC has opened/connected.



"ruralguy via AccessMonster.com" wrote:

> MDE or MDB's? Any there any Reference errors, bogus or otherwise?
>
> Archidrb wrote:
> >SQL Server backend connected using ODBC. I have a design master that is
> >replicated to a "master replica", then each user has their own copy (replica)
> >of the front end made from the master replica. This way I can make
> >structural changes, synch to the master replica, then each user can
> >synchronize the changes.
> >
> >> Is your application split FrontEnd and BackEnd and does everyone have their
> >> own copy of the FrontEnd? Or is this not a MultiUser application? Are the

> >[quoted text clipped - 8 lines]
> >> >> >Did Microsoft release an update or hotfix that is causing this problem? Any
> >> >> >other ideas?

>
> --
> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200903/1
>
>

 
Reply With Quote
 
Archidrb
Guest
Posts: n/a
 
      12th Mar 2009
Here was the problem:

On several (most) of the members of my team a Reference was missing. The
reference was called "Microsoft Windows Common Controls-2 6.0 (SP6)".

I had the reference on my laptop and it was located on my machine at:
C:\Windows\System32\ and called MSCOMCT2.OCX

Here's what I did:

I made a copy of my OCX file to a network location, went to each affected
user's machine and copied the file back to their System32 folder.

I did not even need to go through all of the "Reference" steps in the link
provided. As soon as the OCX file was replaced, the database worked.

Thank you for your help!


"ruralguy via AccessMonster.com" wrote:

> Have you checked for any missing references?
> http://www.accessmvp.com/djsteele/Ac...nceErrors.html
>
> Archidrb wrote:
> >MDB's.
> >
> >The error says "Undefined function 'Date' in expression". It pops-up four
> >times upon opening the database, then the VBA code debug window opens to the
> >code that runs to paste the users LAN ID onto the main menu. Then closing
> >the debugger allows the database to open, but the name does not paste.
> >
> >I know that the SQL Server backend is connecting because there is a splash
> >form that comes up first showing the version of the database. The version is
> >stored in a SQL table in the backend. So whatever is causing the problem
> >occurs after the ODBC has opened/connected.
> >
> >> MDE or MDB's? Any there any Reference errors, bogus or otherwise?
> >>

> >[quoted text clipped - 9 lines]
> >> >> >> >Did Microsoft release an update or hotfix that is causing this problem? Any
> >> >> >> >other ideas?

>
> --
> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200903/1
>
>

 
Reply With Quote
 
Peter Hibbs
Guest
Posts: n/a
 
      12th Mar 2009

This may be due to a Windows Security update. I see that MSCOMCT2.OCX
is one of the affected controls. Have a look at :-

http://support.microsoft.com/kb/957924
and
http://www.microsoft.com/technet/sec...ry/960715.mspx

Peter Hibbs.

On Thu, 12 Mar 2009 08:12:02 -0700, Archidrb
<(E-Mail Removed)> wrote:

>Here was the problem:
>
>On several (most) of the members of my team a Reference was missing. The
>reference was called "Microsoft Windows Common Controls-2 6.0 (SP6)".
>
>I had the reference on my laptop and it was located on my machine at:
>C:\Windows\System32\ and called MSCOMCT2.OCX
>
>Here's what I did:
>
>I made a copy of my OCX file to a network location, went to each affected
>user's machine and copied the file back to their System32 folder.
>
>I did not even need to go through all of the "Reference" steps in the link
>provided. As soon as the OCX file was replaced, the database worked.
>
>Thank you for your help!
>
>
>"ruralguy via AccessMonster.com" wrote:
>
>> Have you checked for any missing references?
>> http://www.accessmvp.com/djsteele/Ac...nceErrors.html
>>
>> Archidrb wrote:
>> >MDB's.
>> >
>> >The error says "Undefined function 'Date' in expression". It pops-up four
>> >times upon opening the database, then the VBA code debug window opens to the
>> >code that runs to paste the users LAN ID onto the main menu. Then closing
>> >the debugger allows the database to open, but the name does not paste.
>> >
>> >I know that the SQL Server backend is connecting because there is a splash
>> >form that comes up first showing the version of the database. The version is
>> >stored in a SQL table in the backend. So whatever is causing the problem
>> >occurs after the ODBC has opened/connected.
>> >
>> >> MDE or MDB's? Any there any Reference errors, bogus or otherwise?
>> >>
>> >[quoted text clipped - 9 lines]
>> >> >> >> >Did Microsoft release an update or hotfix that is causing this problem? Any
>> >> >> >> >other ideas?

>>
>> --
>> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
>> Please post back to this forum so all may benefit.
>>
>> Message posted via AccessMonster.com
>> http://www.accessmonster.com/Uwe/For...oding/200903/1
>>
>>

 
Reply With Quote
 
Archidrb
Guest
Posts: n/a
 
      12th Mar 2009
Thanks, Peter. I forwarded these links to my friend in the IT department
that is involved in rolling out this patch/upgrade. I suspect there is
nothing they can do to keep from having to reinstall this OCX file on (many)
user's machines.

And a big thanks to Ruralguy for helping point me to the problem. I love
solving problems and I needed a place to start!


"Peter Hibbs" wrote:

>
> This may be due to a Windows Security update. I see that MSCOMCT2.OCX
> is one of the affected controls. Have a look at :-
>
> http://support.microsoft.com/kb/957924
> and
> http://www.microsoft.com/technet/sec...ry/960715.mspx
>
> Peter Hibbs.
>
> On Thu, 12 Mar 2009 08:12:02 -0700, Archidrb
> <(E-Mail Removed)> wrote:
>
> >Here was the problem:
> >
> >On several (most) of the members of my team a Reference was missing. The
> >reference was called "Microsoft Windows Common Controls-2 6.0 (SP6)".
> >
> >I had the reference on my laptop and it was located on my machine at:
> >C:\Windows\System32\ and called MSCOMCT2.OCX
> >
> >Here's what I did:
> >
> >I made a copy of my OCX file to a network location, went to each affected
> >user's machine and copied the file back to their System32 folder.
> >
> >I did not even need to go through all of the "Reference" steps in the link
> >provided. As soon as the OCX file was replaced, the database worked.
> >
> >Thank you for your help!
> >
> >
> >"ruralguy via AccessMonster.com" wrote:
> >
> >> Have you checked for any missing references?
> >> http://www.accessmvp.com/djsteele/Ac...nceErrors.html
> >>
> >> Archidrb wrote:
> >> >MDB's.
> >> >
> >> >The error says "Undefined function 'Date' in expression". It pops-up four
> >> >times upon opening the database, then the VBA code debug window opens to the
> >> >code that runs to paste the users LAN ID onto the main menu. Then closing
> >> >the debugger allows the database to open, but the name does not paste.
> >> >
> >> >I know that the SQL Server backend is connecting because there is a splash
> >> >form that comes up first showing the version of the database. The version is
> >> >stored in a SQL table in the backend. So whatever is causing the problem
> >> >occurs after the ODBC has opened/connected.
> >> >
> >> >> MDE or MDB's? Any there any Reference errors, bogus or otherwise?
> >> >>
> >> >[quoted text clipped - 9 lines]
> >> >> >> >> >Did Microsoft release an update or hotfix that is causing this problem? Any
> >> >> >> >> >other ideas?
> >>
> >> --
> >> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> >> Please post back to this forum so all may benefit.
> >>
> >> Message posted via AccessMonster.com
> >> http://www.accessmonster.com/Uwe/For...oding/200903/1
> >>
> >>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the "if" function, the "and" function and the "or" function Superblonde64 Microsoft Excel New Users 1 28th Feb 2010 03:13 AM
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there any way that I can preallocate the resulting table or give SQL server hint as to how many rows my fun DR Microsoft Dot NET Framework 1 22nd Nov 2007 12:36 PM
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there any way that I can preallocate the resulting table or give SQL server hint as to how many rows my fun DR Microsoft ADO .NET 3 22nd Nov 2007 10:17 AM
Excel Function VLOOKUP - ARRAY Function Error elstuart Microsoft Excel Misc 2 21st Jul 2004 05:59 AM
Trap error in sub or function, return sub or function name? Tim Frawley Microsoft VB .NET 6 16th Mar 2004 02:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:08 PM.