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