Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Thursday, March 22, 2012

Exclusive connection MSSQL2000

Hi all!
Can anybody help me on how to obtain an exclusive connection on sql server?
Thanx!

Quote:

Originally Posted by zenc

Hi all!
Can anybody help me on how to obtain an exclusive connection on sql server?
Thanx!


Hi there,

Make sure no other users have access to the particular database you wish to connect. Good luck & Take care.

Exclusive Connection

Is there a way to establish an exclusive SQL 2000 connection, i.e. only
allow 1 user to connect?
In Access I am able using a file DSN with Exclusive=1. Is there a similar
property to use in the connect string or ADO connection object (I do not see
anything glaring there)?
Thanks - Tom> Is there a way to establish an exclusive SQL 2000 connection, i.e. only
> allow 1 user to connect?
> In Access I am able using a file DSN with Exclusive=1. Is there a similar
> property to use in the connect string or ADO connection object (I do not
> see anything glaring there)?
> Thanks - Tom
Use the
ALTER DATABASE db_name SET SINGLE_USER
T-SQL command.
Dejan Sarka

Friday, March 9, 2012

Exceptions and damaged databases in SQL Express 2005 & C#

Hi,

When a database has become corrupted (for whatever reason), when you try to open a connection to it using the SqlConnection class in C#, will it allow the connection to open? I'm trying to figure out if it will allow the connection to be opened, but will throw an SqlException when a command is sent to the server.

Thanks,

KingyNL

When you try to open a connection, exception will thrown if damaged database is default for current login or specified as "initial catalog" parameter in connection string.

Good luck,

Evergray

--

Words mean nothing...

Wednesday, March 7, 2012

Exception in xa_open with SqlServer 2000 SP3a on Win 2003

Hi!
I have an application server and try to access my SqlServer 2000
database running on Win 2003 using a two-phase commit connection
(datasource property enable2Phase=true). The JDBC driver is SP3.
I receive the following exception:
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]xa_open (0) returns -3
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReplyToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.pro cessReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReply(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.getNextResultType(Unknown
Source)
at
com.microsoft.jdbc.base.BaseStatement.commonTransi tionToState(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExec ute(Unknown
Source)
at
com.microsoft.jdbc.base.BasePreparedStatement.post ImplExecute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown Source)
at
com.microsoft.jdbc.base.BaseStatement.executeUpdat eInternal(Unknown Source)
at
com.microsoft.jdbc.base.BasePreparedStatement.exec uteUpdate(Unknown Source)
at
com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.executeXaRpc(Unknown
Source)
at
com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.executeXaRpc(Unknown
Source)
at
com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.open(Unknown Source)
at com.microsoft.jdbcx.base.BaseXAConnection.<init>(U nknown Source)
at
com.microsoft.jdbcx.base.BaseXADataSource.getXACon nection(Unknown Source)
at
com.microsoft.jdbcx.sqlserver.SQLServerDataSource. getXAConnection(Unknown
Source)
If I disable either the enable2Phase or use a SqlServer database on
Win2000 everything works fine.
Any ideas?
My JDBC driver reports the following:
Database product name : Microsoft SQL Server
Database product version : Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
JDBC driver name : SQLServer
JDBC driver version : 2.2.0040
David S. Faller wrote:

> Hi!
> I have an application server and try to access my SqlServer 2000
> database running on Win 2003 using a two-phase commit connection
> (datasource property enable2Phase=true). The JDBC driver is SP3.
> I receive the following exception:
> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
> JDBC][SQLServer]xa_open (0) returns -3
Hi. That's not a driver issue, it is a failure of an ancillary ddl that
implements the extended stored procedures thet SQLServer uses for XA.
There have been recent fixes to those DLLs, so the first thing to do is to
upgrade the DBMS to the latest fixpack.
Joe Weinstein at BEA

> at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
> Source)
> at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
> at
> com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
> Source)
> at
> com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReplyToken(Unknown
> Source)
> at
> com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.pro cessReplyToken(Unknown
> Source)
> at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReply(Unknown
> Source)
> at
> com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.getNextResultType(Unknown
> Source)
> at
> com.microsoft.jdbc.base.BaseStatement.commonTransi tionToState(Unknown
> Source)
> at com.microsoft.jdbc.base.BaseStatement.postImplExec ute(Unknown
> Source)
> at
> com.microsoft.jdbc.base.BasePreparedStatement.post ImplExecute(Unknown
> Source)
> at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown Source)
> at
> com.microsoft.jdbc.base.BaseStatement.executeUpdat eInternal(Unknown Source)
> at
> com.microsoft.jdbc.base.BasePreparedStatement.exec uteUpdate(Unknown Source)
> at
> com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.executeXaRpc(Unknown
> Source)
> at
> com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.executeXaRpc(Unknown
> Source)
> at
> com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.open(Unknown Source)
> at com.microsoft.jdbcx.base.BaseXAConnection.<init>(U nknown Source)
> at com.microsoft.jdbcx.base.BaseXADataSource.getXACon nection(Unknown
> Source)
> at
> com.microsoft.jdbcx.sqlserver.SQLServerDataSource. getXAConnection(Unknown
> Source)
> If I disable either the enable2Phase or use a SqlServer database on
> Win2000 everything works fine.
> Any ideas?
> My JDBC driver reports the following:
> Database product name : Microsoft SQL Server
> Database product version : Microsoft SQL Server 2000 - 8.00.760 (Intel
> X86)
> JDBC driver name : SQLServer
> JDBC driver version : 2.2.0040
|||Hi Joe,
Thanks for this information. I verified that the SQL Server has been
updated to SP3a and that the sqljdbc.dll in my SQL Server's binn
directory is the one shipped with the latest JDBC driver (SP3).
Still no luck...
Can you give me more details on which dll has to be updated and where to
get the update? The list of post-SP3 updates of SQL Server does not list
any XA related issues
(http://support.microsoft.com/common/...v2000presp4fix).
Thanks,
David Faller
Joe Weinstein wrote:
>
> David S. Faller wrote:
>
> Hi. That's not a driver issue, it is a failure of an ancillary ddl that
> implements the extended stored procedures thet SQLServer uses for XA.
> There have been recent fixes to those DLLs, so the first thing to do is to
> upgrade the DBMS to the latest fixpack.
> Joe Weinstein at BEA
>
>
|||Hi Joe,
Thanks for this information. I verified that the SQL Server has been
updated to SP3a and that the sqljdbc.dll in my SQL Server's binn
directory is the one shipped with the latest JDBC driver (SP3).
Still no luck...
Can you give me more details on which dll has to be updated and where to
get the update? The list of post-SP3 updates of SQL Server does not list
any XA related issues
(http://support.microsoft.com/common/...v2000presp4fix).
Thanks,
David Faller
Joe Weinstein wrote:
>
> David S. Faller wrote:
>
> Hi. That's not a driver issue, it is a failure of an ancillary ddl that
> implements the extended stored procedures thet SQLServer uses for XA.
> There have been recent fixes to those DLLs, so the first thing to do is to
> upgrade the DBMS to the latest fixpack.
> Joe Weinstein at BEA
>
>
|||David S. Faller wrote:

> Hi Joe,
> Thanks for this information. I verified that the SQL Server has been
> updated to SP3a and that the sqljdbc.dll in my SQL Server's binn
> directory is the one shipped with the latest JDBC driver (SP3).
> Still no luck...
> Can you give me more details on which dll has to be updated and where to
> get the update? The list of post-SP3 updates of SQL Server does not list
> any XA related issues
> (http://support.microsoft.com/common/...v2000presp4fix).
Hi. I am surprised that sp4 isn't out yet. I had been told it would have been.
I also have heqrd that MS will make no mention of the XA problem(s) until
the sp4 comes out, at which time it will be in the release notes.
Joe
[vbcol=seagreen]
>
> Thanks,
> David Faller
> Joe Weinstein wrote:
|||--
| Message-ID: <4151A8CE.20005@.bea.com>
| Date: Wed, 22 Sep 2004 09:31:10 -0700
| From: Joe Weinstein <joeNOSPAM@.bea.com>
| User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4)
Gecko/20030624 Netscape/7.1 (ax)
| X-Accept-Language: en-us, en
| MIME-Version: 1.0
| To: "David S. Faller" <davidfaller@.de.ibm.com>
| Subject: Re: Exception in xa_open with SqlServer 2000 SP3a on Win 2003
| References: <#W9Gg$#nEHA.2096@.TK2MSFTNGP15.phx.gbl>
<415062D3.6080401@.bea.com> <OSVCflIoEHA.2340@.TK2MSFTNGP10.phx.gbl>
| In-Reply-To: <OSVCflIoEHA.2340@.TK2MSFTNGP10.phx.gbl>
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: sj-ez-63-96-169-77.bea.com 63.96.169.77
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:6296
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
|
|
| David S. Faller wrote:
|
| > Hi Joe,
| >
| > Thanks for this information. I verified that the SQL Server has been
| > updated to SP3a and that the sqljdbc.dll in my SQL Server's binn
| > directory is the one shipped with the latest JDBC driver (SP3).
| > Still no luck...
| >
| > Can you give me more details on which dll has to be updated and where
to
| > get the update? The list of post-SP3 updates of SQL Server does not
list
| > any XA related issues
| >
(http://support.microsoft.com/common/...v2000presp4fix).
|
| Hi. I am surprised that sp4 isn't out yet. I had been told it would have
been.
| I also have heqrd that MS will make no mention of the XA problem(s) until
| the sp4 comes out, at which time it will be in the release notes.
| Joe
|
| >
| >
| > Thanks,
| > David Faller
| >
| > Joe Weinstein wrote:
| >
| >>
| >>
| >> David S. Faller wrote:
| >>
| >>> Hi!
| >>>
| >>> I have an application server and try to access my SqlServer 2000
| >>> database running on Win 2003 using a two-phase commit connection
| >>> (datasource property enable2Phase=true). The JDBC driver is SP3.
| >>>
| >>> I receive the following exception:
| >>>
| >>> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
| >>> for JDBC][SQLServer]xa_open (0) returns -3
| >>
| >>
| >>
| >> Hi. That's not a driver issue, it is a failure of an ancillary ddl that
| >> implements the extended stored procedures thet SQLServer uses for XA.
| >> There have been recent fixes to those DLLs, so the first thing to do
| >> is to
| >> upgrade the DBMS to the latest fixpack.
| >> Joe Weinstein at BEA
| >>
| >>> at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
| >>> Source)
| >>> at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReplyToken(Unknown
| >>> Source)
| >>> at
| >>>
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.pro cessReplyToken(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReply(Unknown
Source)
| >>> at
| >>>
com.microsoft.jdbc.sqlserver.SQLServerImplStatemen t.getNextResultType(Unknow
n
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.base.BaseStatement.commonTransi tionToState(Unknown
| >>> Source)
| >>> at com.microsoft.jdbc.base.BaseStatement.postImplExec ute(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.base.BasePreparedStatement.post ImplExecute(Unknown
| >>> Source)
| >>> at com.microsoft.jdbc.base.BaseStatement.commonExecut e(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.base.BaseStatement.executeUpdat eInternal(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbc.base.BasePreparedStatement.exec uteUpdate(Unknown
| >>> Source)
| >>> at
| >>>
com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.executeXaRpc(Unknown
| >>> Source)
| >>> at
| >>>
com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.executeXaRpc(Unknown
| >>> Source)
| >>> at
| >>> com.microsoft.jdbcx.sqlserver.SQLServerImplXAResou rce.open(Unknown
| >>> Source)
| >>> at com.microsoft.jdbcx.base.BaseXAConnection.<init>(U nknown
Source)
| >>> at
| >>> com.microsoft.jdbcx.base.BaseXADataSource.getXACon nection(Unknown
| >>> Source)
| >>> at
| >>>
com.microsoft.jdbcx.sqlserver.SQLServerDataSource. getXAConnection(Unknown
| >>> Source)
| >>>
| >>> If I disable either the enable2Phase or use a SqlServer database on
| >>> Win2000 everything works fine.
| >>>
| >>> Any ideas?
| >>>
| >>> My JDBC driver reports the following:
| >>> Database product name : Microsoft SQL Server
| >>> Database product version : Microsoft SQL Server 2000 - 8.00.760
| >>> (Intel X86)
| >>> JDBC driver name : SQLServer
| >>> JDBC driver version : 2.2.0040
| >>
| >>
| >>
|
|
We have a Knowledge Base article that describes some additional changes
that are required for XA transaction support on Windows Server 2003:
817066 INFO: Registry Entries Are Required for XA Transaction Support
http://support.microsoft.com/?id=817066
Please review this document and see if this resolves the issue.
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
|||Carb Simien [MSFT] wrote:
> We have a Knowledge Base article that describes some additional
> changes
> that are required for XA transaction support on Windows Server 2003:
> 817066 INFO: Registry Entries Are Required for XA Transaction
> Support
> http://support.microsoft.com/?id=817066
> Please review this document and see if this resolves the issue.
> Carb Simien, MCSE MCDBA MCAD
> Microsoft Developer Support - Web Data
>
I tried adding a registry entry for sqlsrv32.dll but I still get
"[SQLServer]xa_open (0) returns -3" in Java and "xa_open_entry failed"
in sqljdbc.log. Are there other DLLs I'm supposed to add? How do we
find out which DLLs need registry entries?
memebag
Posted via http://www.webservertalk.com
View this thread: http://www.webservertalk.com/message400191.html

exception in in connection with SQL server

Hi all,
I am using OdbcConnection for coonectivity with SQL Server db. My code
is working fine with windows application but in ASP.NET or in
webservice its raising following exception -
"ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL
Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver]
[DBNETLIB]ConnectionOpen (Connect())."
at System.Data.Odbc.OdbcConnection.Open()
Same code is working fine for Orace DSN.
My code:
OdbcConnection conn = new
OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
conn.Open();
Please help me to sort out this problem
Thanks
Dharmendra
Check the SQL Server log for login failures. How is your web
app authenticating? How is IIS configured? What are you
using in your config files for the application?
You need to see what login is failing depending on how you
have things configured.
-Sue
On 14 May 2007 23:03:36 -0700, tomar
<dharmendratomar2000@.gmail.com> wrote:

>Hi all,
>I am using OdbcConnection for coonectivity with SQL Server db. My code
>is working fine with windows application but in ASP.NET or in
>webservice its raising following exception -
> "ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL
>Server does not exist or access denied.
>ERROR [01000] [Microsoft][ODBC SQL Server Driver]
>[DBNETLIB]ConnectionOpen (Connect())."
> at System.Data.Odbc.OdbcConnection.Open()
>Same code is working fine for Orace DSN.
>My code:
>OdbcConnection conn = new
>OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
>conn.Open();
>
>Please help me to sort out this problem
>Thanks
>Dharmendra

exception in in connection with SQL server

Hi all,
I am using OdbcConnection for coonectivity with SQL Server db. My code
is working fine with windows application but in ASP.NET or in
webservice its raising following exception -
"ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]
SQL
Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver]
[DBNETLIB]ConnectionOpen (Connect())."
at System.Data.Odbc.OdbcConnection.Open()
Same code is working fine for Orace DSN.
My code:
OdbcConnection conn = new
OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
conn.Open();
Please help me to sort out this problem
Thanks
DharmendraCheck the SQL Server log for login failures. How is your web
app authenticating? How is IIS configured? What are you
using in your config files for the application?
You need to see what login is failing depending on how you
have things configured.
-Sue
On 14 May 2007 23:03:36 -0700, tomar
<dharmendratomar2000@.gmail.com> wrote:

>Hi all,
>I am using OdbcConnection for coonectivity with SQL Server db. My code
>is working fine with windows application but in ASP.NET or in
>webservice its raising following exception -
> "ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLI
B]SQL
>Server does not exist or access denied.
>ERROR [01000] [Microsoft][ODBC SQL Server Driver]
>[DBNETLIB]ConnectionOpen (Connect())."
> at System.Data.Odbc.OdbcConnection.Open()
>Same code is working fine for Orace DSN.
>My code:
>OdbcConnection conn = new
>OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
>conn.Open();
>
>Please help me to sort out this problem
>Thanks
>Dharmendra

Sunday, February 26, 2012

Exception from HRESULT: 0xC0202022

I created a packsge, set up a connection and the connection is tested OK. Then I created a OLE DB Source, gave the created connection and a table. When I click "Preview" button, this is what I got:

Error at DTStask_DTSDataPumpTask_3(OLE DB source[1]): An error occured due to no connection. A data connection is required when requesting metadata.

Additional informatin:

Exception from HRESULT 0xC0202022: (Microsoft.Sqlserver.DTSPipelineWrap)

Please tell me what I did wrong? or have I broken something?

Have you by any chance turned on the "Work Offline" option in the meantime?

Sunday, February 19, 2012

Excel to Sql

Hi,
I want to convert excel sheet data to sql database.I have completed it using OLEDB connection and sql query.I retrieved the data from excel and bind the data into dataset using OLEDataAdapter and then dataset content will be displayed on grid.If the excel sheet data is of same datatype means it is working properly.See the excel sheet example...

Name Mark1 Mark2
Ram 87 76
somu 45 65
james 65 98

When converting this excel to sql it is working properly..
See the problem below..

Name Mark1 Mark2
Ram 87 76
somu 45 AB
james 65 98

when i am giving 'AB' to mark it shows null value at that specified column(ie,blank space on grid for the data 'AB').
This is my problem...How can i rectify this...Any alternative solutions...

You need to check your database column's datatype. The problem you are running into is most likely the target column is a numeric column.

Let me know whether you can fix the problem by change the data type of the column, keep the data type consistent in your code too.

|||May i know,the way to convert excel t sqlserver database table|||You can simply use Import/Export Wizard in SQL ServerSmile