ADODB using 97
- From: T <teiben@xxxxxxxxxxxxxxxx>
- Date: 30 Apr 2007 14:01:16 -0700
--------------------------------------------------------------------------------
I tried this audit trail code, using 2003 and it works great, I try
and use it at work w/97 and it blows up:
Compile error, user defined type not defined
I assume the ADODB is the problem? How would I change / fix this to
work w/97
Table called UserLog
w/field UserName txt
WhenUsed date & time
module
Option Compare Database
Option Explicit
Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal _
lpBuffer As String, nSize As Long) As Long
Public Function GetUser() As String
Dim strBuffer As String
Dim lngSize As Long, lngRetVal As Long
lngSize = 199
strBuffer = String$(200, 0)
lngRetVal = GetUserName(strBuffer, lngSize)
GetUser = Left$(strBuffer, lngSize - 1)
End Function
'module ends'
On Open of my switchboard
Dim cmd As ADODB.Command
Dim strSQL As String
Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
cmd.CommandText = strSQL
strSQL = "INSERT INTO UserLog(UserName,WhenUsed) " & _
"VALUES(""" & GetUser() & """,#" & _
Format(Now(), "mm/dd/yyyy hh:nn:ss") & "#)"
cmd.CommandText = strSQL
cmd.Execute
Any help would be greatly appreciated...I'm a hack at best
I did try adding in Microsoft Active X 2.0 then the error moved to
cmd.ActiveConnection = CurrentProject.Connection line
.
- Follow-Ups:
- Re: ADODB using 97
- From: '69 Camaro
- Re: ADODB using 97
- Prev by Date: Re: installing graphics filter for JPEG or JIF
- Next by Date: Re: Problem installing Office 97 Professional SR2b patch in Vista
- Previous by thread: FTP DOWNLOAD! CRACKED SOFTWARE/SOFTWARE CRACKS/DONGLE CRACKS/DONGLE EMULATORS/WAREZ CD/CODES/SERIALS
- Next by thread: Re: ADODB using 97
- Index(es):
Relevant Pages
|