dbTalk Databases Forums  

ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Specified databasefile already in use

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Specified databasefile already in use in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shouri.cirigiri@gmail.com
 
Posts: n/a

Default ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Specified databasefile already in use - 02-11-2010 , 04:44 PM






Hello everybody iam new to .NET and sybase so i need some help on
solving the issue.My project is to make web app compatible with vista
and windows 7.I have a delphi desktop application running and is
connected to Sybase SQL Anywhere 11 database now iam working on
developing .NET web application which uses a webservice to connect to
same database .I am not trying to open a new connection rather trying
to use
(share) the same connection to database opened by delphi desktop
application.When i tried using the webservice to connect to database i
got an error in the browser which is as follows:

ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Specified database
file already in use

Connection String := ("Dsn=GlobeRelay5;uid=DBA;pwd=SQL")

Is there anyway i can share the same connection opened by
Desktop application ?.

I even tried opening a new connection which returned same
error
Here is the code

ODBC Connection Code:
using (OdbcConnection cn = new
OdbcConnection("Dsn=GlobeRelay5;uid=DBA;pwd=SQL"))
{
cn.Open();
const string domainString = "SELECT MailDomainName FROM
DBA.SETTINGS";
using (OdbcCommand cmd = new OdbcCommand(domainString,cn))
{
using (OdbcDataReader reader =cmd.ExecuteReader())
{
if (reader.HasRows)
{
while (reader.Read())
{
Settings.MailDomainName =
reader.GetString(0);
}
}


int fCount = reader.FieldCount;
}
}
}

How can i create a new connection to a database which is
already opened by other app whithout shutting down?.


Thank you
Ram Cirigiri

Reply With Quote
  #2  
Old   
dantheguy
 
Posts: n/a

Default Re: ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Specifieddatabase file already in use - 03-23-2010 , 09:28 AM






On Feb 11, 5:44*pm, "shouri.cirig... (AT) gmail (DOT) com"
<shouri.cirig... (AT) gmail (DOT) com> wrote:
Quote:
Hello everybody iam new to .NET and sybase so i need some help on
solving the issue.My project is to make web app compatible with vista
and windows 7.I have a delphi desktop application running and is
connected to Sybase SQL Anywhere 11 database now iam working on
developing .NET web application which uses a webservice to connect to
same database .I am not trying to open a new connection rather trying
to use
(share) the same connection to database opened by delphi desktop
application.When i tried using the webservice to connect to database i
got an error in the browser which is as follows:

ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Specified database
file already in use

Connection String := ("Dsn=GlobeRelay5;uid=DBA;pwd=SQL")

Is there anyway *i can share the same connection opened by
Desktop application ?.

I even tried opening a new connection which returned same
error
Here is the code

ODBC Connection Code:
using (OdbcConnection cn = new
OdbcConnection("Dsn=GlobeRelay5;uid=DBA;pwd=SQL"))
* *{
* * *cn.Open();
* * *const string domainString = "SELECT MailDomainName FROM
DBA.SETTINGS";
* * *using (OdbcCommand cmd = new OdbcCommand(domainString,cn))
* * * * {
* * * * * * *using (OdbcDataReader reader =cmd.ExecuteReader())
* * * * * * {
* * * * * * * * if (reader.HasRows)
* * * * * * * * {
* * * * * * * * * * while (reader.Read())
* * * * * * * * * * {
* * * * * * * * * * * * Settings.MailDomainName =
* * * * * * * * * * * * reader.GetString(0);
* * * * * * * * * * }
* * * * * * * * }

* * * * * * * * int fCount = reader.FieldCount;
* * * * * * }
* * * * }
* * }

How can *i create a new connection to a database which is
already opened by other app whithout shutting down?.

Thank you
Ram Cirigiri
When using a DSN it tells the driver manager or library where to look
in the registry or sys info file to get the data source info. The
driver manager and driver get the rest of the connection parameters
from there. My guess is there is some parameter there that says to
start the database, but it's already started so it errors out. I'd
check those parameters.

As for sharing it's very possible, but I think only one thread should
be using a connection at a time. We have a pool that we manage
between our threads.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.