Ask the Expert

Permissions problem connecting to SQL Server with Excel and VBA

I am attempting to connect to SQL Server with Excel 2003 and Visual Basic for Applications (VBA). The connection works (using Data Access Objects) for reading data but not for adding tables and fields or writing data. Please advise me on how to proceed.

    Requires Free Membership to View

This sounds like a permissions issue. Make sure the SQL Server login is mapped to a valid database user with the necessary permissions. If the user should have access to all tables in the database, the easiest solution may be to give the user access to the db_datareader and db_datawriter fixed database roles. The datareader role allows the user to read from all tables in the database. The datawriter role allows the user to create new tables, and manipulate data in any existing table in the database.

This was first published in May 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: