Access 2007

B

Bryan Hughes

I have a database that was created in access 2003. It has worked fine. Not
users are using Access 2007 and there are errors on procedures that ran
before, especially with the queries that run in back end code. Is Access
2007 using a newer DAO version, or is the vba version changed for access
2007 that would be causing these errors?

I have looked at the queries and they are fine. The only question is on
strings in queries I have a single quote and ampersands (WHERE ID ='" &
strID & "' ..) in the procedure. Has this changed and I need to use the +
instead, like a normal SQL stored procedure?

Thanks for the help!
Bryan
 
D

Douglas J. Steele

Both & and + are still valid string concatenation characters in Access 2007.
The difference is that + propagates Nulls, while & doesn't (in other words,
"abc" & Null will result in "abc", while "abc" + Null will result in Null)

Is there a chance that strID might contain an apostrophe? If so, try

WHERE ID ='" & Replace(strID, "'", "''") & "' ..)

Exagerated for clarity, the Replace statement is

Replace(strID, " ' ", " ' ' ")

If that's not the issue, knowing what the errors you're encountering are
would probably help.
 

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