Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hi i have the next problem, we have this server wich is running an application (app1) that uses Sybase 9 to store the DB, this application runs everytime so the DB is open indefinitely. Im programming an interface between this application and another one (app2), this second application needs some data from the original application so the interface in developing needs to open the DB that uses the original application to take those data, and i need to also write some data to reflect changes.

So basically i need to open Sybase 9 DB to read/write operations, the problem is that because this DB is open indefinitely by app1 when im trying to connect to the DB i get a you canĀ“t open this file because is opened by another process error.

How could i be able to connect to this DB while app1 also get it openned. I cant stop app1, thats a problem, app1 is a security application that handles security signals (burglary, medical emergencies, fire and control access) from all our clients (we are a security company), so basically killing it even for a few minutes while i process the DB is out of the question, even worst i need to open the DB all day in the interface to feed app2.

Do you guys know a way to handle this problem? i have total control of the server app1 is running, but i dont have internal control of app1, its a third party application.

Right now i try to connect to DB directly using Odbc connection in C#:

using (var coneccion = new OdbcConnection("Driver={SQL Anywhere 16};Dbf=" + dbPath + ";Uid=" + user + ";Pwd=" + pass + ";)")  
{  
    using (var cmd = new OdbcCommand(query.ToString()))  
    {  
        // Here it crash when it try to open the conection  
        conection.Open();  
        using (OdbcDataReader reader = cmd.ExecuteReader())  
        {  
            while (reader.Read())  
            {  
              /* Internal stuff here */  
            }  
        }  
    }  
}

asked 03 Mar '15, 18:54

patryush's gravatar image

patryush
46112
accept rate: 0%

1

Take out the Dbf, replace it with ENG=xxx;DBN=yyy; to specify the engine name and database name of the running database. By default xxx and yyy will be the same, equal to the filename. For example, if the dbPath is c:\aaa\bbb\ddd.db then use ENG=ddd;DBN=ddd;

(03 Mar '15, 20:17) Breck Carter
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×3

question asked: 03 Mar '15, 18:54

question was seen: 2,982 times

last updated: 04 Mar '15, 09:03