473,324 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Select Permission Error

50
I am trying to connect from an Access 20000 database to a SQL Server 2000 table through VBA.

I am trying to do a simple select: SELECT COUNT(*) FROM Contracts.
The login I am using has every right imaginable (db owner,admin, etc.). Plus on the table in question, it has Select, insert, delete, update and dri (whatever that is).

Whenever I try to run the query, I get "Select permission denied on object contracts" Error number -2147217911

Here is the calling routine:
Expand|Select|Wrap|Line Numbers
  1.      s_SQL ="SELECT (COUNT(*) FROM Contracts"
  2.     Set adoConnection = New ADODB.Connection
  3.     adoConnection.CommandTimeout = 30
  4.     adoConnection.Open gs_ConnectionString
  5.  
  6.     Set rs = New ADODB.Recordset
  7.     Set rs = adoConnection.Execute(s_SQL)
  8.     Set rs = New ADODB.Recordset
  9.     rs.Open s_SQL, adoConnection, adOpenStatic, adLockReadOnly
  10.  
Here is the connection string:
Public Const gs_ConnectionString = "Provider=sqloledb;Data Source=[ip address],1433;" & _
"Network Library=DBMSSOCN;Initial Catalog=MyDatabase;" & _
"User ID=MyLogin;Password=MyPassword;"

Since the login has more than enough rights to do a select on the table, I suspect that this one of those errors that is really about something else.

Any ideas that I can try?
Aug 19 '08 #1
1 1980
NeoPa
32,556 Expert Mod 16PB
Line #6 shouldn't be followed by line #7.

Check out the return value of the .Execute.

Which line in your code is highlighted when the error occurs?
Aug 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Benny | last post by:
Dear All, My ASP-MS Access application works fin in our local server and in our hosting I get this errors, while adding/editing or deleteing. When deleting a product: error Microsoft VBScript...
12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
1
by: Amin Schoeib | last post by:
Hi, I have a problem with permissions for SELECT. Here is what I did: test=> GRANT SELECT ON "poi"."fondsstamm" TO "flex"; GRANT test=> \dp fondsstamm; Access privileges for database...
0
by: David Berman | last post by:
Hello, I'm receiving an error reading the machine.config file when I try to access my web application. This error came out of nowhere. After searching many sites, googelizing and searching here,...
1
by: Mr.KisS | last post by:
Hi, In my aspx page i use a stocked procedure and in this procedure, there is a SELECT query. And whene the aspx page calls the procedure i get this exception : ...
4
by: Lastie | last post by:
Hi all, I’m an ASP developer but I just started to try and learn ASP.NET. I have the following code but it seems like I have a permissions problem. <%@ Page Language="VB" Debug="true" %>...
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.