cancel
Showing results for 
Search instead for 
Did you mean: 

User Account Control on Windows 7 affecting Auto-Increment in SQL Anywhere

Former Member
0 Kudos

I am using SQL Anywhere 12 on a Windows 7 system where the User Account Control is affecting access to my database which resides in a folder under ProgramData.  I set the User Account Control to the lowest level and am running under a Administrator User account but the database does not autoincrement a key field.  The code works fine on my XP system, but I want to upgrade to Windows 7, but I need to "fix" the problem before making the move.  Any help would greatly be appreciated.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

jeff_albion
Employee
Employee
0 Kudos

Hi Barry,

I've moved this topic to the SQL Anywhere SCN Community.

---

User Account Control (UAC) should not have a specific effect on the ability to insert records and data into the SQL Anywhere database.

The database file is accessed through a database server process, and you connect to the database server, not the database file. Access to the database server is only limited by a username and password, and once logged in, there are associated database permissions.

UAC is only used to regulate access to files and the ability to change things on an operating system level.

Can you still connect to the database server when UAC is enabled? If so, then your issue will not likely be related to UAC.


but the database does not autoincrement a key field.

Are you seeing an error when initially inserting? Once you insert data, are you committing your transaction? How have you determined currently that the "database does not autoincrement a key field"?

Regards,

Jeff Albion

SAP Active Global Support

Former Member
0 Kudos

I am not seeing any errors when inserting and yes I commit after every transaction.  The reason why I know it is definitely related to UAC is that my Windows 7 Professional I was testing on had UAC at the lowest level and everything worked great.  I then installed it on my friends laptop running Windows 7 Home Premium and UAC was fully turned on it wouldn't work and after some troubleshooting we realized that the auto-increment field wasn't changing.  The way we know is that field # which is a BIGINT is displayed to the screen after each transaction.  So in trying to determine what was the problem, the only difference between the two systems was the UAC control.  So I turned mine on fully and duplicated the problem.  So, I now knew what the problem was.  But, here's the kicker, I turned my UAC back to the lowest level and my program is STILL failing.  It's like something didn't get changed back.

Another interesting fact.  If I "Run as Administrator" to start the Microsoft Visual Studio 8 on my Windows 7 system and compile the program, it performs the auto-increment correctly.  So something weird is happening here and I'm dead in the water!  Any help anyone can suggest would greatly be appreciated.

jeff_albion
Employee
Employee
0 Kudos

Hi Barry,

It sounds like there may be access issues at play, but it sounds to me that it's more related to the application environment than SQL Anywhere specifically. Is this just a regular .NET program? Can you provide more details about what you're doing in your code and what data you're seeing that is 'not incrementing a field'?

If you ever need immediate assistance, the best resolution is to open an incident with support: http://support.sap.com/

Regards,

Former Member
0 Kudos

Yes, it is a regular C# .Net 3.5 program.  Basically, the program is creating a ticket and "TicketNumber" is a BIGINT field and it is auto-increment.  When the record is inserted, it should increment the ticket #, but it doesn't (on Win7) when I  run my code that was compiled on the XP system..  The program works fine in Windows XP.   It also works fine on the Windows 7 system if I compile the code on that system.  Incidentally, the compiled code from the windows 7 system works both with UAC turned fully on or fully low.  I'm using Visual Studio 2008 for the compiler..


The record in the database has the same ticket number after every insert and the rest of the ticket data is the last data entered (meaning that the previous data is overwritten with the new data).

I would agree that it seems that it would be related to the application environment, but there is no difference other than running code compiled on the XP system vs.running the same exact code compiled on the Win7.system.

Former Member
0 Kudos

hi,

I would not fix the problem by lowering to lowest level.

How about checking the AccessControlList of the directory where the database is located in and add the missing users with appropriate access write?

Did you already check this?

kind regards

Peter

Former Member
0 Kudos

Yes. I allowed full control to the directory for everyone as a stab at it, but the thing is that all the data is getting written to the database.  The only thing that is being affected is the auto-increment of the primary key field.  

Any others suggestions?

Thanks for your assistance.

Former Member
0 Kudos

one further question:
Which SAP Product is using SQLAnywhere?

regards

Peter

Former Member
0 Kudos

I'm not using an SAP product.  I'm using Sybase SQL Anywhere 12.0.1 in my custom application in C#.  SAP bought Sybase back in 2010.