?
Solved

Connectivity with SQL6.5

Posted on 2002-05-29
8
Medium Priority
?
309 Views
Last Modified: 2012-05-04
We are facing connectivity problems with sql server 6.5 using OLEDB .Net provider.

can any one help us know what's the problem?
0
Comment
Question by:Suzan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7043659
What errors are you getting?
0
 

Author Comment

by:Suzan
ID: 7043811
Both the below approaches work correctly with VB.Net Desktop Applications.


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objCon As New OdbcConnection()
        Try
            objCon.ConnectionString = "Driver=SQL Server;Server=SQL65;Database=Northwind;UID=sa;PWD=sa"
            objCon.Open()
        Catch o As Exception
            MsgBox(o.Message)
        End Try



    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim objCon As New OleDbConnection()
        objCon.ConnectionString = "Provider=SQLOLEDB;Data Source=SQL65; Initial Catalog=Northwind;User ID=sa;Password=sa"
        objCon.Open()

    End Sub

The below code in ASP.Net does not work

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objCon As New OdbcConnection()
        objCon.ConnectionString = "Driver=SQL Server;Server=sql65;Database=pubs;UID=sa;PWD=sa"
        objCon.Open()
        Response.Write("Connected")
    End Sub

Error Messsage Returned:


ERROR [08001] [Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (Connect()).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.





The below code in ASP.Net does not work


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim objCon As New OleDbConnection()
        objCon.ConnectionString = "Provider=SQLOLEDB;Data Source=SQL65; Initial Catalog=pubs;User ID=sa;Password=sa"
        objCon.Open()

    End Sub


The returned Error is:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Source Error:


Line 36:         Dim objCon As New OleDbConnection()
Line 37:         objCon.ConnectionString = "Provider=SQLOLEDB;Data Source=SQL65; Initial Catalog=pubs;User ID=sa;Password=sa"
Line 38:         objCon.Open()
Line 39:
Line 40:     End Sub
 
What we are looking for is to connect to sql server 6.5 via ASPNet.

Thanks,
Suzan
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7043834
You are running into secutity issues. ASP.Net application runs under ASPNET account. Whereas desktop applications run under the logged in user account.
Unfortunately I have never used SQL6.5 so I am not sure what kind of authentication mechinism is uses and how it comuunicate swith client.
Its more of a problem with network access. Nothing to do with data provider.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Suzan
ID: 7043922
but we are not using trusting connection mode
0
 
LVL 23

Accepted Solution

by:
naveenkohli earned 800 total points
ID: 7044911
Suzan,
So far every information I have found on this issue indicates that there is some problem with SQL Server configuration. Here is some info from another expert.. This is using DSN but gives some info on configuration of Named pipes.

*******************
Looks like the dreaded "Named Pipes" problem. Open the Control Panel ODBC applet, select your DSN,
click Configure. Click "Next" in the Config Dialog. This should take you to a screen with a "Client
Configuration" button on it. Click it. On the subsequent screen, ensure "TCP/IP" is selected. The
ODBC test at the end of setting up a DSN will work with Named Pipes (unfortunately).

Also it looks like you're using NT Authentication. This is the way to go, but you need to ensure
that your Web App runs under/connects as the account for Internet Server Anonymous access, as
defined in User Manager for Domains on the server (starts with IUSR_).
**********************

Naveen
0
 

Author Comment

by:Suzan
ID: 7142613
I put the following code in the web.config file and everything worked fine
<identity impersonate="true"/>
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7144404
When you turned on impersonation to true, the ASP app is running under the logged in user account. This is same as running a desk top application. Thats why it is working now. Previously you were running under ASPNET account.
0
 
LVL 15

Expert Comment

by:gladxml
ID: 8854542
No comment has been added lately and it seems that this question have been abandoned. So it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question or invite a Moderator to close this question if there's no reply from you after seven days.

In the absence of responses, I will recommend the following:

To accept the comment and points awarded to  naveenkohli


** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **


Just trying to help for the cleanup...
gladxml
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question