Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Converting Access 2003 db to 2007 2

Status
Not open for further replies.

straybullet

IS-IT--Management
Jun 5, 2003
593
US
Since adding the following, the person I've been trying to help with a database has been getting an error when trying to convert to 2007. It's 3356, telling her she is trying to open a database which is opened exclusively... I've run a decompile, used the Compile selection on the Debug menu, made sure the default open mode is shared. I know I'm missing something... any ideas?
Code:
Function Concatenate(pstrSQL As String, _
        Optional pstrDelim As String = ", ") _
            As String

    Dim rs As New ADODB.Recordset
    rs.Open pstrSQL, CurrentProject.Connection, _
            adOpenKeyset, adLockOptimistic
    Dim strConcat As String 'build return string
    With rs
        If Not .EOF Then
            .MoveFirst
            Do While Not .EOF
                strConcat = strConcat & _
                    .Fields(0) & pstrDelim
                .MoveNext
            Loop
        End If
        .Close
    End With
    Set rs = Nothing
    
    If Len(strConcat) > 0 Then
        strConcat = Left(strConcat, _
            Len(strConcat) - Len(pstrDelim))
    End If
    Concatenate = strConcat
End Function


Let them hate - so long as they fear... Lucius Accius
 
Try
dim dbs as database
Set dbs = CurrentDb
dim rs as recordset
set rs as dbs.openrecordset(pstrSQL)

if this does not work try looking up in help openrecordset


ck1999

 
What makes you think the error is occuring in the function you posted?, there is no on error statement to trap error(s).

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Thank you CK, I'll try that.

Ken, adding that code and using the function in a query were the only changes made between the copy of the database which she had been able to successfully convert to 2007 and the next one which gave her the error. I thought perhaps there was something in the function which would need editing so that it would convert properly.

Let them hate - so long as they fear... Lucius Accius
 
My $0.02.
See if there is an .ldb file associated with the 2003 database. If the .ldb file isn't getting deleted Access 2007 may think the older db is already open. If the 2003 db is closed, there shouldn't be a problem deleting the .ldb file before trying to convert it.
 
I'll check with her if she's converting from the open database or converting it closed.

Let them hate - so long as they fear... Lucius Accius
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top