on 2011 Nov 21 4:08 AM
Hello.
I'm currently developing a VB.net program which intends to read SQL-scripts from a (SQL-server) database table, and then run those scripts on a SyBase 10.0.1 database. When running this application, I've previously checked the scripts for errors by running them in Interactive SQL, and they do compile nicely, so there are no syntactic errors in them. However, the error I encounter is when executing the second script in the queue. The first script gets processed as I intend it to be, but when running the second, I get a "Authentication violation"-error. This scenario leads me to believe that first query doesn't completely leave the database in a consistent state, or there might be some other anomoly which has to do with my connection method. I've choosen to use a ODBC-source, which obviously works, since the first query runs just fine, so that shouldn't be the problem(?).
Further on, my way of executing these scripts is by using ADO, namely in this way:
-- start code snippet -- SACommand.CommandText = strSql SACommand.Connection = SAconn SACommand.Prepare() SACommand.ExecuteNonQuery() SACommand.Dispose() -- end code snippet --
The error I encounter gets thrown when running the SACommand.ExecuteNonQuery() - line. The scripts I run this way, are a mix of view-declarations, procedures, and DDL-statements, however the error also occurs when trying to run the same (working) first statement twice, which leaves me totally confused.
Any ideas about where I might be missing out something?
Thanks in advance
Jonas
If you getting a SQLCODE -98 "Authentication violation" error, you have tried to run DML statements against an authenticated database (aka OEM edition) that is only allowed to be updated by particular applications:
You attempted to connect to a server that has been authenticated for exclusive use with a specific application.
There's a 30 seconds grace period, and the first statements may have run successfully within that timespan, whereas the latter have not.
If you're allowed to modify that database, you will have to supply the according connection_authentication string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply Volker.
Well, in my example, I'm not talking about a very long timespan between the scripts run, rather 10 sec's when stepping through the code, so I have a hard time believing that is the problem. Below are some additional information about the exception thrown that might come handy. (To me, it's just gibberish I'm afraid.)
{"Authentication violation"} iAnywhere.Data.SQLAnywhere.SAException:
{"Authentication violation"} Data: {System.Collections.ListDictionaryInternal}
HelpLink: Nothing
InnerException: Nothing
Message: "Authentication violation"
Source: "SQL Anywhere .NET Data Provider"
StackTrace:
" at iAnywhere.Data.SQLAnywhere.SACommand.EndExecuteNonQuery(IAsyncResult asyncResult)
at balthzar_server_admin.frmServer_admin.balthzar_server_admin_Monitor_RunThisSQL(String strSql) in C:balthzarbalthzar_server_admin 1.2 Devbalthzar_server_admin 1.2balthzar_server_admin_110705frmServer_admin.vb:rad497"
TargetSite: {System.Reflection.RuntimeMethodInfo}
As I stated in my original post, I assume that I am allowed to modify the database, since the first statement gets executed, however the following ones don't. The thing is, that if I run the working statement twice, I get the "Authentication error" the second time around. If it matters, the first working SQL-statement is a viewdefinition.
Any new thoughts?
Jonas
You could find out whether OEM authentication might be an issue by querying:
select db_property('Authenticated'), connection_property('Authenticated')
If you're not running an authenticaed database, both functions should return 'No', otherwise two 'Yes' will confirm that you're allowed to change the DB contents.
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.