I'm in the process of converting an Access 2003 mdb to an Access 2010 (32 bit version). Needless to say, the Access 2003 version (mdb & mde) have been working flawlessly for close to ten years.
I'm trying to convert the 2003 mdb file to Access 2010 32 bit version (accdb) file.
I'm getting compile errors (Method or data member not found). The debug points to the dot operators of recordset objects as being the offending piece of code. Sample code here: Offending error line is pRst_Data.Edit
Code:
Function IsLocked(pRst_Data As Recordset, pStr_UserName As String, pStr_MachineName As String) As Boolean
' Purpose: determines if the current record in the recordset is locked,
' and if so who has it locked
' Returns: True if current record is locked (and sets pStr_UserName and pStr_MachineName
' to the user with the lock). False if the record isn't locked.
' From: Building Applications Chapter 12
Dim ErrorString As String
Dim intMachineNameStart As Integer
IsLocked = False
On Error GoTo IsLockedError
pRst_Data.Edit 'Try to edit the current record in the recordset.
pRst_Data.MoveNext
pRst_Data.MovePrevious
Exit Function 'No error, so return False.
IsLockedError:
If Err = 3260 Then 'Record is locked -- parse error string.
ErrorString = Error$
pStr_UserName = Mid$(ErrorString, 44, InStr(44, ErrorString, "'") - 44)
intMachineNameStart = InStr(43, ErrorString, " on machine ") + 13
pStr_MachineName = Mid$(ErrorString, intMachineNameStart, Len(ErrorString) - intMachineNameStart - 1)
IsLocked = True
End If
Exit Function
End Function
The above is just one sample of obviously many that are strewn throughout my application. As mentioned, coding is correct under the 2003 version.
I'm unsure of which references are suppose to be included but here is the list as it stands now (Access 2010 version):
- Visual Basic For Applications
- Microsoft Access 14.0 Object Library
- OLE Automation
- Microsoft Visual Basic for Applications Extensibility 5.3
- Microsoft Office 14.0 Access database engine Object Library
The references included for the Access 2003 version are as follows:
- Visual Basic For Applications
- Microsoft Access 10.0 Object Library
- Microsoft DAO 3.6 Object Library
- OLE Automation
- Microsoft Visual Basic for Applications Exensibility 5.3
- Microsoft ActiveX Data Objects 2.1 Library
I've attempted to include the "Microsoft DAO 3.6 Object Library" into the 2010 version but I'm then hit with a name conflict error.
Any advice or suggestions would be greatly appreciated in order to convert my application.
Steve.