Re: OLEDB database connection from ASP.NET
From: Steve C. Orr [MVP, MCSD] (Steve_at_Orr.net)
Date: 04/16/04
- Next message: Q. John Chen: "How to redirect"
- Previous message: Julian Hershel: "Re: Calling a .NET web service from classic ASP"
- In reply to: Louise Hadley: "OLEDB database connection from ASP.NET"
- Next in thread: Louise Hadley: "Re: OLEDB database connection from ASP.NET"
- Reply: Louise Hadley: "Re: OLEDB database connection from ASP.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Apr 2004 14:12:29 -0700
ASP.NET applications run under the user account ASPNET by default.
I'd say the likely problem is that this user account does not have
permissions to your database.
Either give it permissions or user impersonation to run ASP.NET under a
different user account that has the necessary privileges.
Here's more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetimpersonation.asp
-- I hope this helps, Steve C. Orr, MCSD, MVP http://Steve.Orr.net "Louise Hadley" <louise.hadley@hadleybain.com> wrote in message news:28d72892.0404161234.6d00cacc@posting.google.com... > I can connect to a Sybase database from a WindowsApp project without > any problems, but when I use the same code to connect from an aspx.vb > file I get an OLEDB exception "Database server not found". > > Code is: > > Imports System.Data.OleDb > > Public Class WebForm1 > Inherits System.Web.UI.Page > > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > > Dim strConn As String > Dim objDBConn As OleDbConnection > Dim objCommand As OleDbCommand > > strConn = "provider=ASAProv;data source=systemsupport" > > objDBConn = New OleDbConnection(strConn) > objCommand = New OleDbCommand("spEventLog_Add_2", > objDBConn) > objCommand.CommandType = CommandType.StoredProcedure > > objDBConn.Open() > ................. > > > If I paste this code into WindowsApp form it runs fine! > > Is there something inherently different in the way I should connect to > the database in ASP. > > I have the same problem when I call method functions in components > from the ASP that simply return arraylists - they work fine when > called from Windows apps but not when called from the ASP. > > Tx, > Louise
- Next message: Q. John Chen: "How to redirect"
- Previous message: Julian Hershel: "Re: Calling a .NET web service from classic ASP"
- In reply to: Louise Hadley: "OLEDB database connection from ASP.NET"
- Next in thread: Louise Hadley: "Re: OLEDB database connection from ASP.NET"
- Reply: Louise Hadley: "Re: OLEDB database connection from ASP.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|