Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 109
  • Last Modified:

SQL Server Security Issue?

Challenge:
Using the following code to supply data to a form using SQL Server Express 2012 Allows data editing on the resulting form.
Using the same code with connection to SQL Server 2008 Express causes the data to be read only in the form.
Code Snippet:
80       OpenSQLConnection
         
90       Set rs_Temp = New ADODB.recordset
         
100      With rs_Temp
110         Set .ActiveConnection = rs_Cnn
120         .Source = SQLStatement
130         .CursorLocation = adUseServer
140         .LockType = adLockOptimistic
150         .CursorType = adOpenDynamic
160         .CursorLocation = adUseClient
170         .Open
180      End With

190      Set FormRS = rs_Temp

Open in new window


What am I missing? An SQL Server security setting?
0
Kurt Bergman
Asked:
Kurt Bergman
  • 5
  • 4
  • 2
1 Solution
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Are you connecting to both databases with the same SQL Server user?
If so, check the user permissions in each database. I'll bet that he has write permission in the SQL Server 2012 DB and read only on SQL Server 2008 DB.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
is there a primary key on both tables (aka on the table in both instances)
I don't recall anything else to "block" edit mode

this would also be checkable in the .CursorLocation, .CursorType and .LockType , after the .Open line, not to match the values requested .

BTW, I see this minor issue:
130         .CursorLocation = adUseServer
...
160         .CursorLocation = adUseClient

the last one shall win, so line 130 is obsolete.
0
 
Kurt BergmanAuthor Commented:
Databases are identical (copied one to the other)
line 130 (I forgot to comment out this line) you HAVE to use adUseClient to use OpenDynamic in Access with no linked tables.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
Kurt BergmanAuthor Commented:
Victor:
In the 2012 version Under [My Database]\Security\Users\[My User]
Under General there is a field: Login Name:

That field does not exist in the 2008 version.

Am I missing something?
0
 
Kurt BergmanAuthor Commented:
Guy:
I went back and checked the 2008 Version...
PKs and FKs had been dropped during the copying process

It works now
What a dummy :-(

Thank you for bringing this up
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
How you did the copy?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>What a dummy :-(
happened a couple of times to me, so no need for shame.
main point is: it got fixed :)
0
 
Kurt BergmanAuthor Commented:
Hi Victor, because I was rolling back from 2012 to 2008 the only method I could think of was to import the tables into Access from 2012 and then upsize them to 2008. That's where I lost my indexes.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
There's a Copy Database Wizard option in SSMS that allows you to do that directly (from MSSQL 2012 to 2008).
0
 
Kurt BergmanAuthor Commented:
this doesn't appear to be available in the Express version under tasks.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
You're right. Not available in Express Edition.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now