Solved

Connectivity with SQL6.5

Posted on 2002-05-29
8
306 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
Independent Software Vendors: 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 200 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
alert(innerHTML); 8 43
IIS 7 and executing pages using localhost 16 30
Ajax on ASP 2 65
Post from Jquery mobile form goes wrong in classic asp action page 2 34
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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