Solved

SQL Server Security Issue?

Posted on 2014-11-20
11
104 Views
Last Modified: 2014-11-21
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
Comment
Question by:Kurt Bergman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40455486
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
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 40455517
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
 

Author Comment

by:Kurt Bergman
ID: 40455527
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:Kurt Bergman
ID: 40455544
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
 

Author Comment

by:Kurt Bergman
ID: 40455929
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
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40456780
How you did the copy?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40456814
>What a dummy :-(
happened a couple of times to me, so no need for shame.
main point is: it got fixed :)
0
 

Author Comment

by:Kurt Bergman
ID: 40457414
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
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40457425
There's a Copy Database Wizard option in SSMS that allows you to do that directly (from MSSQL 2012 to 2008).
0
 

Author Comment

by:Kurt Bergman
ID: 40457464
this doesn't appear to be available in the Express version under tasks.
0
 
LVL 50

Expert Comment

by:Vitor Montalvão
ID: 40457492
You're right. Not available in Express Edition.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question