If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Excel vba + SQL server Permissions mystery

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-04, 08:13
GerryP GerryP is offline
Registered User
 
Join Date: Mar 2004
Posts: 20
Excel vba + SQL server Permissions mystery

Hello all
I use VBA in excel with an ODBC connection but ask for help in an area of the SQL server ID or more correclty the use of it in Excel VBA.

Consider 2 id profiles as
Id 'IOD'
Server Roles : none
Permit in Database Role : public, db_datareader, db_datawriter

Id 'bizinfo'
Server Roles : none
Permit in Database Role : public, db_owner

I 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:=adLockOptimistic

where cnn = "Provider=SQLOLEDB.1;Password=xxxx;User ID=IOD;Initial Catalog=EM2;Data Source=;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."


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 .....

is it the.. "CursorType:=adOpenKeyset, LockType:=adLockOptimistic" ?

Ideas why both wont ??

Gerry
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On