Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Sunday, March 25, 2012

Connection problem

Strange database problem.
I have 2 servers one running as webserver and the other as Database server running MSSQL 2000 SP3.
They are connected i 2 ways. Through a public net using static IP and through a direct cable using another IP.

My problem is that I cannot connect to or from the database through the crossed cable (I run a DTS which imports a zipped access file from an FTP account on the webserver).
Running through the public net works fine but not through the crossed/direct cable.
All other connecting (ping, filesharing, FTP not through DTS, etc) works fine through that cable but ODBC connections from the webserver don't and neither does DTS access from the database server.
Does anyone have a clue.I assume there is a different IP associated with the crossed-cable connection. Configure your ODBC to use that IP address instead of the server name.|||That's what I couldn't do. However everything worked out after restarting the webbserver. Seems like it was just a glitch.sqlsql

Connection pooling in MSSQL via VB

Hi folks,
Is there a way to implement connection pooling in MSSQL 7 or 2k when accessing it from VB?
Thanks.Yes, if you implement the VB data consuming object as a MTS COM object (COM DLL). MTS is already integrated in COM+ with w2k.

Originally posted by lokem
Hi folks,

Is there a way to implement connection pooling in MSSQL 7 or 2k when accessing it from VB?

Thanks.|||If you use ADO via ODBC, and you:

1. enable connection pooling in ODBC control panel
2. make sure you Close() your connection and set it to nothing when you've finished using it

...then you've got connection pooling. I think the closed connection objects hang around for a default of 60 seconds.|||Originally posted by dbadelphes
Yes, if you implement the VB data consuming object as a MTS COM object (COM DLL). MTS is already integrated in COM+ with w2k.

So I just have to get it registered to Component Services for a computer and I'm set? Do I need to do anything special when defining the connection string?

mwilkes: Thanks for the tip. Will be trying that out!|||To make Coonection Pooling work you also need to make sure that you use the same connection string all the time. In the past developers used the same UID, PWD, DATABASE and SERVER in the connection string but would change ApplicationName by setting it to a UserID so they could distinguish connections via IIS. This would end up creating a seperate connection.

Thursday, March 22, 2012

Connection Pool and MSSql driver

Hi all,
I'm trying to build an application using MSSQL Server and Connection pool.
At my server.xml file I have:
<Context path="/sample" docBase="C:/myprojects/sample" reloadable="true" >
<Resource name="jdbc/StrutsDemoDS" auth="Container"
type="javax.sql.DataSource" scope="Shareable"/>
<ResourceParams name="jdbc/StrutsDemoDS">
<parameter>
<name>factory</name><value>org.apache.commons.dbcp.BasicDataSourc eFactory</value></parameter>
<parameter><name>driverClassName</name><value>com.microsoft.jdbc.sqlserver.SQLServer Driver</value></parameter>
<parameter><name>url</name><value>jdbc:microsoft:sqlserver://myserver:1433</value></parameter>
<parameter><name>username</name><value>sa</value></parameter>
<parameter><name>password</name><value>passwd</value></parameter>
<parameter><name>maxActive</name><value>20</value></parameter>
<parameter><name>maxIdle</name><value>10</value></parameter>
<parameter><name>maxWait</name><value>100</value></parameter>
</ResourceParams>
</Context>
In my class, I have:
protected static DataSource dataSource;
protected Connection getConnection() throws SQLException {
InitialContext ic = new InitialContext();
dataSource = (DataSource)
ic.lookup("java:comp/env/jdbc/StrutsDemoDS");
Connection conn = null;
try {
conn = dataSource.getConnection(); // The error happens at this
line
}
catch (SQLException e) {
throw e;
}
return conn;
}
I can't get successful my connection. Can anyone tell me why?
Thanks.
Lorena
Lorena,
What is the error you're getting? Are you sure the lookup is successful?
If you write a simple class that doesn't use jndi but instead uses
DriverManager, Connection, and the normal db access stuff, with the
connectstring you're passing, can you connect?
Marc
"Lorena" <Lorena@.discussions.microsoft.com> wrote in message
news:E2508C07-F91E-40C2-BF64-34B7E8C23F58@.microsoft.com...
> Hi all,
> I'm trying to build an application using MSSQL Server and Connection pool.
> At my server.xml file I have:
> <Context path="/sample" docBase="C:/myprojects/sample" reloadable="true" >
> <Resource name="jdbc/StrutsDemoDS" auth="Container"
> type="javax.sql.DataSource" scope="Shareable"/>
> <ResourceParams name="jdbc/StrutsDemoDS">
> <parameter>
> <name>factory</name><value>org.apache.commons.dbcp.BasicDataSourc eFactory</value></parameter>
> <parameter><name>driverClassName</name><value>com.microsoft.jdbc.sqlserver.SQLServer Driver</value></parameter>
> <parameter><name>url</name><value>jdbc:microsoft:sqlserver://myserver:1433</value></parameter>
> <parameter><name>username</name><value>sa</value></parameter>
> <parameter><name>password</name><value>passwd</value></parameter>
> <parameter><name>maxActive</name><value>20</value></parameter>
> <parameter><name>maxIdle</name><value>10</value></parameter>
> <parameter><name>maxWait</name><value>100</value></parameter>
> </ResourceParams>
> </Context>
> In my class, I have:
> protected static DataSource dataSource;
> protected Connection getConnection() throws SQLException {
> InitialContext ic = new InitialContext();
> dataSource = (DataSource)
> ic.lookup("java:comp/env/jdbc/StrutsDemoDS");
> Connection conn = null;
> try {
> conn = dataSource.getConnection(); // The error happens at
> this
> line
> }
> catch (SQLException e) {
> throw e;
> }
> return conn;
> }
> I can't get successful my connection. Can anyone tell me why?
> Thanks.
> Lorena

Tuesday, March 20, 2012

Connection option in MSSQL2005

Hi,
There is a setting in option-> connection -> 'Perform translation for character data' in Query Analyzer in MSSQL 2000. Is there any option in MSSQL2005 has simliar function? Thanks in advance

(stephanielauym@.discussions.microsoft.com) writes:
> There is a setting in option-> connection -> 'Perform translation for
> character data' in Query Analyzer in MSSQL 2000. Is there any option
> in MSSQL2005 has simliar function? Thanks in advance There does not seem to. I had enough with character translation with the 6.5 tools, so I can't say that I miss it. What use would you see for such an option? -- Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

|||in the DB, some of the field in varchar contains chinese characters. In MSSQL2000, we un-click this option to read the chinese char.|||

(stephanielauym@.discussions.microsoft.com) writes:
> in the DB, some of the field in varchar contains chinese characters. In
> MSSQL2000, we un-click this option to read the chinese char. And you are saying that there is no way to turn transkation off in Mgmt Studio? I have it off in my QA, but I can't say whether that is the default or not. (I assumed that it was off by default, but maybe I was wrong.) What is the collation of these columns? How do they display in QA currently? If this is important for you I suggest that submit a suggetion on http://lab.msdn.microsoft.com/productfeedback/. It's a good idea to give a background why you want this. -- Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

|||Yes, I can't find the option which is similar to the option 'Perform translation for character data' in Management Studio. In our case, turning off this option would display chinese in varchar field.sqlsql

Connection MSSQL with Oracle

Hai Pals:
I need a solution where I can access,Update values of MSSQL from Oracle and vice versa.
Could you provide a solution..
Take care
byeHello,

you can use ADBC to update datas from Oracle to MSSQL and vice versa.
Pls download http://www.alligatorsql.com/download/alligator.zip

If you need help, pls send an e-mail to m.peter@.alligatorsql.de

Best regards
Manfred Peter
Alligator Company Software GmbH
http://www.alligatorsql.com

Sunday, March 11, 2012

connection going to sleep?

Ok, here's the scenario. On a Windows 2003 Server I have MSSQL 2000
installed. On another test server I have Windows 2003 server, IIS 6 and
Coldfusion installed. There has been an account created in SQL and assigned
permissions. My coldfusion web site makes multiple calls to the database
server using the account created. All is wonderful. Then, all of a sudden
I start getting connection problems (SQL STATE: HTY00). My web site cannot
connect using that account. I can still ping the SQL server from the
development server so I know thats not the problem. So I tried creating an
ODBC connection using that account. Same error. Sometimes resetting the
password in SQL works. A few days ago, however, I had to reboot the SQL
server and now everything is fine again, until the next time. Can anyone
explain to me why that user account seems to "goes to sleep" every few
days' There have been occasions when it's been fine for a week or two
but sooner or later, it will always do this!when you're dealing with connection problems it helps to do things like:
* try the connection from a different client
* check to see if you can connect from other accounts
* check to see if you can connect from a Windows and/or SQL authenticated
account
* check the SQL Server error logs for messages....
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Steve" <StephenGL@.sabian.ca> wrote in message
news:5Lovb.33154$R13.985896@.ursa-nb00s0.nbnet.nb.ca...
> Ok, here's the scenario. On a Windows 2003 Server I have MSSQL 2000
> installed. On another test server I have Windows 2003 server, IIS 6 and
> Coldfusion installed. There has been an account created in SQL and
assigned
> permissions. My coldfusion web site makes multiple calls to the database
> server using the account created. All is wonderful. Then, all of a
sudden
> I start getting connection problems (SQL STATE: HTY00). My web site
cannot
> connect using that account. I can still ping the SQL server from the
> development server so I know thats not the problem. So I tried creating
an
> ODBC connection using that account. Same error. Sometimes resetting the
> password in SQL works. A few days ago, however, I had to reboot the SQL
> server and now everything is fine again, until the next time. Can anyone
> explain to me why that user account seems to "goes to sleep" every few
> days' There have been occasions when it's been fine for a week or two
> but sooner or later, it will always do this!
>

Sunday, February 19, 2012

Connection - MSSQL - HOST_ID

Hi Everyone,
I wonder if somebody knows what sets the value resulting from the HOST_ID()
function in SQL2000.
It seems that the OleDb connection sets that property (and pass it to the
server when setting up the connection).
My problem is that I need to create 2 connections in my application to the
same database/server using the same credentials, but I need both connections
to return different HOST_ID().
I haven't been able to accomplish that, currently my both, different
connections return the same HOST_ID() when querying the database.
Any ideas?
Thanks, Jos Araujo.You can specify the desired host name using the 'Workstation ID' connection
string keyword or OLEDB property:
Provider=SQLOLEDB;Data Source=MyServer;Initial Catalog=MyDatabase;Integrated
Security=SSPI;Workstation ID=MyHost"
Hope this helps.
Dan Guzman
SQL Server MVP
"Jos Araujo" <josea@.mcrinc.com> wrote in message
news:O3f60VwQGHA.5808@.TK2MSFTNGP12.phx.gbl...
> Hi Everyone,
> I wonder if somebody knows what sets the value resulting from the
> HOST_ID()
> function in SQL2000.
> It seems that the OleDb connection sets that property (and pass it to the
> server when setting up the connection).
> My problem is that I need to create 2 connections in my application to the
> same database/server using the same credentials, but I need both
> connections
> to return different HOST_ID().
> I haven't been able to accomplish that, currently my both, different
> connections return the same HOST_ID() when querying the database.
> Any ideas?
> Thanks, Jos Araujo.
>
>
>|||It is not quite exactly what I wanted: I wanted to change the HOST_ID()
return value, it changes the HOST_NAME() return value.
However: I can workaround my problem by using this.
Thanks! Jos.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:O1mkLmyQGHA.5468@.TK2MSFTNGP14.phx.gbl...
> You can specify the desired host name using the 'Workstation ID'
> connection string keyword or OLEDB property:
> Provider=SQLOLEDB;Data Source=MyServer;Initial
> Catalog=MyDatabase;Integrated Security=SSPI;Workstation ID=MyHost"
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Jos Araujo" <josea@.mcrinc.com> wrote in message
> news:O3f60VwQGHA.5808@.TK2MSFTNGP12.phx.gbl...
>|||I'm glad my answer helped, even though it wasn't exactly what you were
looking for :-)
Dan Guzman
SQL Server MVP
"Jos Araujo" <josea@.mcrinc.com> wrote in message
news:evtB6U4QGHA.1576@.tk2msftngp13.phx.gbl...
> It is not quite exactly what I wanted: I wanted to change the HOST_ID()
> return value, it changes the HOST_NAME() return value.
> However: I can workaround my problem by using this.
> Thanks! Jos.
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:O1mkLmyQGHA.5468@.TK2MSFTNGP14.phx.gbl...
>