Solved

Connectivity with SQL6.5

Posted on 2002-05-29
8
298 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
  • 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
 

Author Comment

by:Suzan
ID: 7043922
but we are not using trusting connection mode
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Update Stored Procedure question 8 41
SQL Filter Question 8 69
Select distinct 25 60
Auto Submit on dropdown box 14 32
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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now