Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Gerry.Perry@Avnet.com
Starting Member
6 Posts |
Posted - 2004-03-01 : 17:26:43
|
Hello allI use VBA in excel with an ODBC connection but ask for help in an area of the SQL server IDConsider 2 id profile asId 'IOD'Server Roles : noneAccess to database : EM2Permit in Database Role : public, db_datareader, db_datawriterId 'bizinfo'Server Roles : noneAccess to database : EM2I want the tool to add and delete records and one area of code is strSQL = "Delete from Susi_search " & whereclause rst.Open source:=strSQL, ActiveConnection:=cnn, CursorType:=adOpenKeyset, LockType:=adLockOptimisticwhere cnn = Provider=SQLOLEDB.1;Password=xxxx;User ID=IOD;Initial Catalog=EM2;Data Source=ip;Network Library=dbmssocn;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=xxx;Use Encryption for Data=False;Tag with column collation when possible=False.obviously I've changed the IP and password.I get an error of "Method of open Object Recordset failed. the same code WILL work for the more powerful "bizinfo" ID.I think both should work but .....Ideas why both wont ??Gerry Permit in Database Role : public, db_owner |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-03-01 : 17:39:22
|
So what permissions does bizinfo have? In the thread, it appears as if none. Does that account have sysadmin or something? Do you know that the other user is failing on that DELETE statement? You can run SQL Profiler to determine if a permission problem is occurring. You would want to add the success column and the Errors and warning events.Tara |
|
|
Gerry.Perry@Avnet.com
Starting Member
6 Posts |
Posted - 2004-03-01 : 17:48:39
|
Sorry:- bizinfo has Permit in Database Role : public, db_ownerI shoudl have said that on SQL server directly I can do want I need: run deletes etc. So its something on the VB side. Perhpas the CursorType:=adOpenKeyset, LockType:=adLockOptimistic quote: Originally posted by tduggan So what permissions does bizinfo have? In the thread, it appears as if none. Does that account have sysadmin or something? Do you know that the other user is failing on that DELETE statement? You can run SQL Profiler to determine if a permission problem is occurring. You would want to add the success column and the Errors and warning events.Tara
|
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-03-01 : 17:54:19
|
I don't know what permissions are needed for those. Could you explain what those two options do? With the explanation, I can probably tell you what is needed for permissions.Tara |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2004-03-04 : 13:46:27
|
Rather than using a Recordset object to issue a Delete statement, I usually just use the .Execute method of my Connection object. You don't need to worry about the cursor type or lock type that way.--------------------------------------------------------------Find more words of wisdom at [url]http://weblogs.sqlteam.com/markc[/url] |
|
|
|
|
|
|
|