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

Friday, March 30, 2012

One more connection problem-Security Issue

My company gave me their old Windows 2000 server. I installed my
database on it and the ODBC connection works perfectly on the server.
When I go to my client machine I go the the ODBC Connections in it and
it fails. It refuses connections and will not reply to pings. It is not
a network issue, as I can telnet to the server just fine. It's strictly
a security issue. I just have no clue where to look. Any suggestions
would be appreciated. ThanksCurt (myemail@.nowehere.com) writes:

Quote:

Originally Posted by

My company gave me their old Windows 2000 server. I installed my
database on it and the ODBC connection works perfectly on the server.
When I go to my client machine I go the the ODBC Connections in it and
it fails. It refuses connections and will not reply to pings. It is not
a network issue, as I can telnet to the server just fine. It's strictly
a security issue. I just have no clue where to look. Any suggestions
would be appreciated. Thanks


Which version of SQL Server?

If you are using SQL 2005, you need to enable remote connections, as by
default Express and Developer Editon only accepts local connections. You
can use the Surface Area Configuration tool for this.

Also, if you are using SQL Express, make sure that SQL Broswer is running,
so that the named instance can be found.

If you are using SQL 2000, I would look in the Server Network Utility
to see which protcols that are installed.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

One general q?

Helo all,
i have one general q about sql server and MSDE.
for how many users can i configure MSDE to work for?
i mean connection per second, or something like that?
thanks in advance!
-k.p.
There is no such config in MSDE. Just leave the sp_configure settings as they are. MSDE is
throttled, when you have more than 5.8 queries *executing at the same time* a delay is introduced
for each I/O operation.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.
|||There is no hard limit for the number of users that can connect to MSDE, but
as a rule of thumb you can assume that performance will degrade with more
than about 20 users connected concurrently.
Jacco Schalkwijk
SQL Server MVP
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.
|||Thanx Tibor and Jacco for reply!
"gorostas" wrote:

> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.
|||http://www.aspfaq.com/2343
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.

One general q?

Helo all,
i have one general q about sql server and MSDE.
for how many users can i configure MSDE to work for?
i mean connection per second, or something like that?
thanks in advance!
-k.p.There is no such config in MSDE. Just leave the sp_configure settings as the
y are. MSDE is
throttled, when you have more than 5.8 queries *executing at the same time*
a delay is introduced
for each I/O operation.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.|||There is no hard limit for the number of users that can connect to MSDE, but
as a rule of thumb you can assume that performance will degrade with more
than about 20 users connected concurrently.
Jacco Schalkwijk
SQL Server MVP
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.|||Thanx Tibor and Jacco for reply!
"gorostas" wrote:

> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.|||http://www.aspfaq.com/2343
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.

One general q?

Helo all,
i have one general q about sql server and MSDE.
for how many users can i configure MSDE to work for?
i mean connection per second, or something like that?
thanks in advance!
-k.p.There is no such config in MSDE. Just leave the sp_configure settings as they are. MSDE is
throttled, when you have more than 5.8 queries *executing at the same time* a delay is introduced
for each I/O operation.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.|||There is no hard limit for the number of users that can connect to MSDE, but
as a rule of thumb you can assume that performance will degrade with more
than about 20 users connected concurrently.
--
Jacco Schalkwijk
SQL Server MVP
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.|||Thanx Tibor and Jacco for reply!
"gorostas" wrote:
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.|||http://www.aspfaq.com/2343
"gorostas" <gorostasREMOVE_THIS@.hotmail.com> wrote in message
news:FDD47216-3E4D-411C-96BA-33AC0ABA28F9@.microsoft.com...
> Helo all,
> i have one general q about sql server and MSDE.
> for how many users can i configure MSDE to work for?
> i mean connection per second, or something like that?
> thanks in advance!
> -k.p.

Wednesday, March 28, 2012

One Connection Several queries?

I need to make one connection to a database and return 4 different pieces of data from the database so that I can maximize effciency. Well doing it that way is a guess on my part about maximizing effeciency.

Databases and me don't know a lot about each other. I can do some basic sql queries but that is about it and as far as my knowledge seems to go. ADO.NET is something I am still trying to learn well.

Any help would be great.

You can use Sp_Executesql Microsoft have provided some code to get you started. Hope this helps.

http://support.microsoft.com/default.aspx?scid=kb;en-us;262499

|||

It is advisable to minimize your connections, so you're off to a good start. You have two options for the multiple queries. One would be to open the connection, execute and process query 1, execute and process query 2, etc. For each query, you just specify the same connection. Your other option would be to put all your queries in a single stored procedure. You'd send down the command to execute the stored procedure with any paramers, and all 4 recordsets would be returned as children of one large recordset. You'd then process the first recordset, use the .movenext method, process the next recordset, etc.

Which way you choose depends on what you're doing with the data, how your app is architected, and your level of comfort.

|||Thank you both for your resposnes this has given me a direction to look in. I guess my next step is to learn Stored Procedures. Always new that not learning it would come back and haunt me.

one configure file for all my package.

Hi,

How can i create one configure file that all my packages will inherit the connection to other databases from him?

thanks.

what is better to save my connection string into a table in my DWH or save them to XML file,

so when i want to change my SSIS to work with test enviroment it take the connection string from the db and when i want to switch to prod enviroment i'll use the connection of prod that store in the db.

i think to create a package will switch the connection string value whenever i want?

is it the right way ?

any ideas?

thanks alot!

|||Use of the database or XML is mostly a matter of personal preference. An additional step that is required with a database configuration is managing connections to the configuration database itself. You usually need a seperate XML configuration (or a variable that you set via the commandline) to handle the connection for the configuration database.

Monday, March 26, 2012

One client machine gets a connection error

Which talks about Named Pipes.
We're not using Named Pipes, we're using TCP/IP.
All of the four other machines work...why not this one.
Note. It's a machine that has been reformatted and programs reinstalled.
But my program does nothing special other than connect to a SQL Server
through a WAN.
I'm obviously missing something.
Kyle!Compare the client netlib configuration between the machines (cliconfg.exe).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Kyle Jedrusiak" <kjedrusiak@.princetoninformation.com> wrote in message
news:ujMzvwWnHHA.5052@.TK2MSFTNGP04.phx.gbl...
> Which talks about Named Pipes.
> We're not using Named Pipes, we're using TCP/IP.
> All of the four other machines work...why not this one.
> Note. It's a machine that has been reformatted and programs reinstalled.
> But my program does nothing special other than connect to a SQL Server through a WAN.
> I'm obviously missing something.
>
> Kyle!
>|||Since reformatted and reinstalled, how about windows internet firewall is on
(enabled by default when you applied windows xp SP2)? Or another firewall
product perhaps? Can you connect if you explicitly put in the ip address of
the machine in QA/SSMS?
--
TheSQLGuru
President
Indicium Resources, Inc.
"Kyle Jedrusiak" <kjedrusiak@.princetoninformation.com> wrote in message
news:ujMzvwWnHHA.5052@.TK2MSFTNGP04.phx.gbl...
> Which talks about Named Pipes.
> We're not using Named Pipes, we're using TCP/IP.
> All of the four other machines work...why not this one.
> Note. It's a machine that has been reformatted and programs reinstalled.
> But my program does nothing special other than connect to a SQL Server
> through a WAN.
> I'm obviously missing something.
>
> Kyle!
>sql

One client machine gets a connection error

Which talks about Named Pipes.
We're not using Named Pipes, we're using TCP/IP.
All of the four other machines work...why not this one.
Note. It's a machine that has been reformatted and programs reinstalled.
But my program does nothing special other than connect to a SQL Server
through a WAN.
I'm obviously missing something.
Kyle!
Compare the client netlib configuration between the machines (cliconfg.exe).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Kyle Jedrusiak" <kjedrusiak@.princetoninformation.com> wrote in message
news:ujMzvwWnHHA.5052@.TK2MSFTNGP04.phx.gbl...
> Which talks about Named Pipes.
> We're not using Named Pipes, we're using TCP/IP.
> All of the four other machines work...why not this one.
> Note. It's a machine that has been reformatted and programs reinstalled.
> But my program does nothing special other than connect to a SQL Server through a WAN.
> I'm obviously missing something.
>
> Kyle!
>
|||Since reformatted and reinstalled, how about windows internet firewall is on
(enabled by default when you applied windows xp SP2)? Or another firewall
product perhaps? Can you connect if you explicitly put in the ip address of
the machine in QA/SSMS?
TheSQLGuru
President
Indicium Resources, Inc.
"Kyle Jedrusiak" <kjedrusiak@.princetoninformation.com> wrote in message
news:ujMzvwWnHHA.5052@.TK2MSFTNGP04.phx.gbl...
> Which talks about Named Pipes.
> We're not using Named Pipes, we're using TCP/IP.
> All of the four other machines work...why not this one.
> Note. It's a machine that has been reformatted and programs reinstalled.
> But my program does nothing special other than connect to a SQL Server
> through a WAN.
> I'm obviously missing something.
>
> Kyle!
>

One client machine gets a connection error

Which talks about Named Pipes.
We're not using Named Pipes, we're using TCP/IP.
All of the four other machines work...why not this one.
Note. It's a machine that has been reformatted and programs reinstalled.
But my program does nothing special other than connect to a SQL Server
through a WAN.
I'm obviously missing something.
Kyle!Compare the client netlib configuration between the machines (cliconfg.exe).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Kyle Jedrusiak" <kjedrusiak@.princetoninformation.com> wrote in message
news:ujMzvwWnHHA.5052@.TK2MSFTNGP04.phx.gbl...
> Which talks about Named Pipes.
> We're not using Named Pipes, we're using TCP/IP.
> All of the four other machines work...why not this one.
> Note. It's a machine that has been reformatted and programs reinstalled.
> But my program does nothing special other than connect to a SQL Server thr
ough a WAN.
> I'm obviously missing something.
>
> Kyle!
>|||Since reformatted and reinstalled, how about windows internet firewall is on
(enabled by default when you applied Windows XP SP2)? Or another firewall
product perhaps? Can you connect if you explicitly put in the ip address of
the machine in QA/SSMS?
TheSQLGuru
President
Indicium Resources, Inc.
"Kyle Jedrusiak" <kjedrusiak@.princetoninformation.com> wrote in message
news:ujMzvwWnHHA.5052@.TK2MSFTNGP04.phx.gbl...
> Which talks about Named Pipes.
> We're not using Named Pipes, we're using TCP/IP.
> All of the four other machines work...why not this one.
> Note. It's a machine that has been reformatted and programs reinstalled.
> But my program does nothing special other than connect to a SQL Server
> through a WAN.
> I'm obviously missing something.
>
> Kyle!
>

one ado connection object - multiple spids?

Hi,
We have asp application (ado connection) which connects to the sql server
2000 (sp3). There is one asp page which sequentially executes set of 6
stored procedures. When I execute same set of stored procedures in query
analyzer, I get response in less than 1 second.When application does that,
response gets back in 15-20 seconds (only when we have problem, otherwise in
2-3 seconds). In the trace, I noticed that each of these 6 stored procedures
(which btw use 1 connection object) gets a different SPID. Why is that?
Shouldn't they use the same SPID, if they use the same connection object
(executed sequentially!)?
Also, the trace shows that each of them gets executed almost instantly
(1ms), but between end of previous, and beginning of the next one, there is
delay of 2-3 seconds. During these 2-3 seconds, there is nothing going on on
the database server (very few events).
Does anybody have an idea?
ThanksPedja wrote:
> Hi,
> We have asp application (ado connection) which connects to the sql
> server 2000 (sp3). There is one asp page which sequentially executes
> set of 6 stored procedures. When I execute same set of stored
> procedures in query analyzer, I get response in less than 1
> second.When application does that, response gets back in 15-20
> seconds (only when we have problem, otherwise in 2-3 seconds). In the
> trace, I noticed that each of these 6 stored procedures (which btw
> use 1 connection object) gets a different SPID. Why is that?
> Shouldn't they use the same SPID, if they use the same connection
> object (executed sequentially!)? Also, the trace shows that each of them
> gets executed almost instantly
> (1ms), but between end of previous, and beginning of the next one,
> there is delay of 2-3 seconds. During these 2-3 seconds, there is
> nothing going on on the database server (very few events).
> Does anybody have an idea?
> Thanks
Are you sure you are not closing the connection and opening it up each time
your ASP code executed some SQL?
David Gugick
Quest Softwaresql

Friday, March 23, 2012

On 2003 cluster (SQL 2000) connection pooling causes crash

For performance reasons we have (successfully) used pooling in our apps and
services on almost one hundred installations, NT 4.0 to 2000 servers (SQL
7.0 - 8.0), NT 4.0 to XP workstations without a problem in any combination.
Now with 5.2 (2003) server a local client is unable to connect and crashes
within the SQLDriverConnect call (SQLConnect as well). Does not return at
all.
When the same runs on any other client (4.0, 2000, XP), everything is OK.
The problem comes and goes with SQL_ATTR_CONNECTION_POOLING
100% sure the bug is not in our code - the pure MS-supplied code as shown in
Q164221 crashes precisely the same way.
When SQLSetEnvAttr(...SQL_ATTR_CONNECTION_POOLING...) is not used, it's ok,
BUT:
To quit using benefits of pooling is a solution with severe impact on
performance.
Any hint?
TIA
Jaroslav Pivonka
mailto:jpivonka@.centrum.cz
// Windows Server 2003, 2 in a cluster, SQL Server 2000 EE SP4 (8.00.2039)
Hi
I am assuming that your are not using AWE memory, as you should apply hotfix
2040 for SQL Server SP4
(http://support.microsoft.com/default...b;en-us;899761)
As to the connection pooling, check the versions of the ODBC drivers between
your various platforms. You will notice Windows 2003 has the most recent
one.
It may be a bug in the driver, or it may be that the feature is not working
anymore.
Do you have the same problem with Windows XP SP2 or Windows 2003 SP1?
If so, I would open a case with Microsoft Support Services.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jaroslav" <Jaroslav@.discussions.microsoft.com> wrote in message
news:1D39DE4D-FA1C-4A8B-A4D7-CBFCBB60D29A@.microsoft.com...
> For performance reasons we have (successfully) used pooling in our apps
> and
> services on almost one hundred installations, NT 4.0 to 2000 servers (SQL
> 7.0 - 8.0), NT 4.0 to XP workstations without a problem in any
> combination.
> Now with 5.2 (2003) server a local client is unable to connect and crashes
> within the SQLDriverConnect call (SQLConnect as well). Does not return at
> all.
> When the same runs on any other client (4.0, 2000, XP), everything is OK.
> The problem comes and goes with SQL_ATTR_CONNECTION_POOLING
> 100% sure the bug is not in our code - the pure MS-supplied code as shown
> in
> Q164221 crashes precisely the same way.
> When SQLSetEnvAttr(...SQL_ATTR_CONNECTION_POOLING...) is not used, it's
> ok,
> BUT:
> To quit using benefits of pooling is a solution with severe impact on
> performance.
> Any hint?
> TIA
> Jaroslav Pivonka
> mailto:jpivonka@.centrum.cz
> // Windows Server 2003, 2 in a cluster, SQL Server 2000 EE SP4 (8.00.2039)
>
|||"Mike Epprecht (SQL MVP)" wrote:

> Hi
> I am assuming that your are not using AWE memory, as you should apply hotfix
> 2040 for SQL Server SP4
> (http://support.microsoft.com/default...b;en-us;899761)
Negative. 2GB each server.
Moreover it seems to be an ODBC problem, not server.

> As to the connection pooling, check the versions of the ODBC drivers between
> your various platforms. You will notice Windows 2003 has the most recent
> one.
> It may be a bug in the driver, or it may be that the feature is not working
> anymore.
Hopefully the first is true and somebody will fix it soon.
So far we have put a switch outside, enabling us not to use pooling (default
is yes), into a couple of generic services running on the cluster so we can
leave all but two new systems as they were, and on the new installations
we'll keep waiting until a patch comes.

> Do you have the same problem with Windows XP SP2 or Windows 2003 SP1?
Up to XP SP2 using MDAC 2.8 SP1 everything works fine.
The problem came with Windows 2003 Server SP1 having MDAC 2.8. SP2

> If so, I would open a case with Microsoft Support Services.
Please try to check it. I have proven that freshly installed systems
(nothing but Win2003 SP1 w MDAC 2.8 SP2, SQL 2000 EE (8.00.2039)) fail to run
locally even the sample code shown in Q164221 (MS only, not a line of ours).
Remote clients (pre-2003) are ok.
Thanks
Jaroslav Pivonka
sql

Wednesday, March 21, 2012

OleDbConnection with MSDE

I'm trying to connect to a MSDE database using the following code:


'set up connection
dim myConnection as new OleDbConnection("Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=LearnASP_DB;Integrated Security=SSPI;Connect Timeout=30")

'open connection
dim myCommand as new OleDbDataAdapter("select * from tblUsers",myConnection)

'fill dataset
dim ds as DataSet = new DataSet()
myCommand.Fill(ds, "tblUsers")

And I'm getting the following error:

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Can someone tell me what I'm doing wrong?

Thanks in advanceI am pretty sure you should use (local) instead of localhost for the Data Source.

Terri|||localhost calls the webserver. (local) is the correct syntax.

should also add that if you're using "Provider=SQLOLEDB;", you might as well use System.Data.SqlClient|||you said if I'm using Provider="SQLOLEDB" I migh as well use System.Data.SqlClient

What are my other choices for Provider?
And what the difference between OleDbConnection and SqlClient?

Thanks again|||SqlClient was made specifically as the namespace to use for SqlServer. No "Provider" is needed.

http://able-consulting.com/dotnet/adonet/Data_Providers.htm#SQLClientManagedProvider|||thanks for you help :)

OLEDB versus ODBC

HI,

I'm using a reporting tool for retrieving information from a sqlsrv 2005 env. using OLE DB for my connection.
When i've created a metric and whilst refreshing it i get the message 'object was open'. Changing the connection into ODBC everything went well.

By looking at the log file it's trying to write the metric record in the DB but it simply cannot (OLEDB) but using ODBC is all went fine...

Is something not properly installed on the server side?

anyone?

E10

Are you using a 3rd-party reporting tools? It looks like they do not use OleDb in a proper way. Better check with the reporting tools' vendor.

Oledb Source adapter exception Error code: 0x80040E21

Hi

I am using Oledb Provider for Db2 from IBM. (There is another one from microsoft)

Through this provider I am constructing a oledb connection manager.

This connection manager I am Using in Oledb Source adapter.

Now when I set Data Access mode as Table or view I Am able to preview the data.

But when I use Data Access Mode as SQL Command try to preview I get this Error

TITLE: Microsoft Visual Studio

Error at s_NEWMAPPING10 [EMP [1]]: An OLE DB error has occurred. Error code: 0x80040E21.


ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)


BUTTONS:

OK

I am not able to figure out how to resolve this.

I am receiving the exact same error. Can't run custom queries against the database and it is frustrating. Someone from Microsoft needs to respond to this immediately...it's not acceptable.sql

Oledb Source adapter exception Error code: 0x80040E21

Hi

I am using Oledb Provider for Db2 from IBM. (There is another one from microsoft)

Through this provider I am constructing a oledb connection manager.

This connection manager I am Using in Oledb Source adapter.

Now when I set Data Access mode as Table or view I Am able to preview the data.

But when I use Data Access Mode as SQL Command try to preview I get this Error

TITLE: Microsoft Visual Studio

Error at s_NEWMAPPING10 [EMP [1]]: An OLE DB error has occurred. Error code: 0x80040E21.


ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)


BUTTONS:

OK

I am not able to figure out how to resolve this.

I am receiving the exact same error. Can't run custom queries against the database and it is frustrating. Someone from Microsoft needs to respond to this immediately...it's not acceptable.

Tuesday, March 20, 2012

OleDB open connection fails for user DSN

Platform: VC 7.0, Windows 2000
Database: SQL Server 2000
Hi,
I created an API, in-proc server, which uses OLEDB to open connection for a
given DSN.
When I create system dsn and execute API from SQL Server Store procedure it
success.
When I create user dsn and execute API from SQL Server Store procedure it
fails and returns error "Data source name not fond and no default driver
specified".
May I know reason for failing API for user DSN? Is there any solution.
Thanks in advance.
Regards
VijayA user DSN is specific to the user logged in... For this to work you must
create a user DSN for the same user that SQL is using ( since you are doing
this in a sp)... Most people would create a System DSN and not even worry
about it though.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"vijay" <vijaysingh@.abo.abosoftware.com> wrote in message
news:u9puL320DHA.4064@.tk2msftngp13.phx.gbl...
> Platform: VC 7.0, Windows 2000
> Database: SQL Server 2000
>
> Hi,
> I created an API, in-proc server, which uses OLEDB to open connection for
a
> given DSN.
>
> When I create system dsn and execute API from SQL Server Store procedure
it
> success.
>
> When I create user dsn and execute API from SQL Server Store procedure it
> fails and returns error "Data source name not fond and no default driver
> specified".
>
> May I know reason for failing API for user DSN? Is there any solution.
>
> Thanks in advance.
>
> Regards
> Vijay
>
>|||How could I decide which DSN should be crated i.e. either system dsn or user
dsn.
Vijay
Sr. Software Engineer
ABO Software
New Delhi
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:eS7jFH40DHA.2396@.TK2MSFTNGP09.phx.gbl...
> A user DSN is specific to the user logged in... For this to work you must
> create a user DSN for the same user that SQL is using ( since you are
doing
> this in a sp)... Most people would create a System DSN and not even worry
> about it though.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "vijay" <vijaysingh@.abo.abosoftware.com> wrote in message
> news:u9puL320DHA.4064@.tk2msftngp13.phx.gbl...
> > Platform: VC 7.0, Windows 2000
> >
> > Database: SQL Server 2000
> >
> >
> >
> > Hi,
> >
> > I created an API, in-proc server, which uses OLEDB to open connection
for
> a
> > given DSN.
> >
> >
> >
> > When I create system dsn and execute API from SQL Server Store procedure
> it
> > success.
> >
> >
> >
> > When I create user dsn and execute API from SQL Server Store procedure
it
> > fails and returns error "Data source name not fond and no default driver
> > specified".
> >
> >
> >
> > May I know reason for failing API for user DSN? Is there any solution.
> >
> >
> >
> > Thanks in advance.
> >
> >
> >
> > Regards
> >
> > Vijay
> >
> >
> >
> >
>

oledb for oracle

hi,

can i use the acquireconnection method to an oledb for oracle connection manager?

I don't really understand the question. You can call AcquireConnection on any connection manager, including any that maintain a pool of connections to Oracle.

Does that answer the question?

-Jamie

Monday, March 19, 2012

OleDB Connection to Excel

Hi,

My application connects to excel files.
I am using this code:



dc = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + fileName + ";" +
"Extended Properties=\"Excel 8.0;HDR=YES;\"");

It works fine on Excel 2000 on all computers. Also it works on some computers with Excel 2002/XP, but on some computers with Excel 2002/XP it doesn't work.

How can I solve it?

Thank's
AlexeiHi,
I used above code sample for my program. but i did not worked.can u help me. I want to do ,take excel information to one record set or data set.I can't understand how to do it.I send u my connection coding.please check it send me wht is the correct syntax or correct code and tell me wht is the componts want. this program using the .net
following has my codes:

MyConnection = New OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=D:\Oven Sheet (Track)\Data For Symix_23082005-Tracks.xls;Extended Properties=\Excel 8.0")

|||Are you sure you have the right version of Jet on the machine? Check this by right clicking on the desktop and create a new text file, call it demo.udl. This is a datalink file. If you double click on the file it should show you a list of OLE DB Providers, check that Jet 4.0 is installed.

If it is installed then try changing \Excel 8.0 to plain Excel 8.0

OLEDB connection to a remote SQL Server Database - Servername

I want to establish a ADO OLEDB connection to a SQL Server 2K at a webserver
with a reference to the server name instead of IP-adress. Just like :
db.Properties("Data Source").Value = "http://testserver.com"
Do I need to specify the standard port '1433' ( as is the case with IP
adressing) in the connection string ?
OscarI Have the same problem (under W2003 Server)
"Oscar" <oku@.xs4all.nl> a crit dans le message de
news:40575beb$0$126$e4fe514c@.dreader10.news.xs4all.nl...
> I want to establish a ADO OLEDB connection to a SQL Server 2K at a
webserver
> with a reference to the server name instead of IP-adress. Just like :
> db.Properties("Data Source").Value = "http://testserver.com"
> Do I need to specify the standard port '1433' ( as is the case with IP
> adressing) in the connection string ?
> Oscar
>

OLE-Db connection in Transformation Script Component

Hello,

Using the following documentation as a guide:

http://msdn2.microsoft.com/zh-cn/library/aa337080.aspx

I instantiated a new script component into an existing Data Flow in my SSIS project.

In the Script Transformation Editor, under the Connection Managers section, I associated the name dbConnManager to an already existing Connection Manager in the project.

My Connection Manager is of the type oOLEDB.

I then opened up the script designer and added the following lines of code where it said "Add your code here"

Dim myConnManager As IDTSConnectionManager90 = _

Me.Connections.ECFconnection

Dim dbConn As OleDb.OleDbConnection = _

CType(myConnManager.AcquireConnection(Nothing), OleDb.OleDbConnection)

When I test run the project I get the following error and the new script component is red:

Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.OleDb.OleDbConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

I know the database connection works since I am using it in a component that executes before this new script component.

I am stuck...Any suggestions?

Unfortunately you cannot use a Connection Manager that returns a native type in managed code. This includes OLE DB and Excel.

This limitation is noted in BOL in
http://msdn2.microsoft.com/en-us/library/ms136018.aspx
and
http://msdn2.microsoft.com/en-us/library/aa337080.aspx

with this suggestion:

If you need to call the AcquireConnection method of a connection manager that returns an unmanaged object, use an ADO.NET connection manager. When you configure the ADO.NET connection manager to use an OLE DB provider, it connects by using the .NET Framework Data Provider for OLE DB. In this case, the AcquireConnection method returns a System.Data.OleDb.OleDbConnection instead of an unmanaged object. To configure an ADO.NET connection manager for use with an Excel data source, select the Microsoft OLE DB Provider for Jet, specify an Excel workbook, and then enter Excel 8.0 (for Excel 97 and later) as the value of Extended Properties on the All page of the Connection Manager dialog box.

-Doug

|||

Thank you. That was the nudge in the right direction that I needed.

Greg.