Database access from ASP via ATL COM 
Author Message
 Database access from ASP via ATL COM

Hi,

I failed to access database from ASP via my ATL COM dll. I detected that I
can't connect to database in C++ codes only when called from ASP, this dll
works well in Excel VBA or Visual Basic. Is there anything wrong or security
settings for ASP calling?

Thanks!
Weiming



Tue, 29 Jun 2004 08:28:36 GMT  
 Database access from ASP via ATL COM
Your security as a standard app. (e.g. VB) is that of the logged-in user.
Your security as an ASP is inherited from the web-server.  The web-server
has a separate account set up that it runs under.  (I'd tell you the name of
the account, but it varies from one machine to the next.  I think it is
typically IUSR_ prepended to the machine name; e.g. IUSR_MYSERVER.)  You can
either give that account the access it needs, or have your dll do whatever
signon it needs to access the D/B.

The ASPs that I develop to access SQL Server DBs via ADO all do an explicit
signon when they create their connections.  They implement an user/password
that I set up specifically go restrict web user access.

TFM3

Note: Spam-resistant e-mail address


Quote:
> Hi,

> I failed to access database from ASP via my ATL COM dll. I detected that I
> can't connect to database in C++ codes only when called from ASP, this dll
> works well in Excel VBA or Visual Basic. Is there anything wrong or
security
> settings for ASP calling?

> Thanks!
> Weiming



Tue, 29 Jun 2004 08:55:08 GMT  
 Database access from ASP via ATL COM
Is there any sample codes to sign on explicitly when connecting to database?
As I don't want to change IUSER_ account security.

Thanks!
Weiming


Quote:
> Your security as a standard app. (e.g. VB) is that of the logged-in user.
> Your security as an ASP is inherited from the web-server.  The web-server
> has a separate account set up that it runs under.  (I'd tell you the name
of
> the account, but it varies from one machine to the next.  I think it is
> typically IUSR_ prepended to the machine name; e.g. IUSR_MYSERVER.)  You
can
> either give that account the access it needs, or have your dll do whatever
> signon it needs to access the D/B.

> The ASPs that I develop to access SQL Server DBs via ADO all do an
explicit
> signon when they create their connections.  They implement an
user/password
> that I set up specifically go restrict web user access.

> TFM3

> Note: Spam-resistant e-mail address



> > Hi,

> > I failed to access database from ASP via my ATL COM dll. I detected that
I
> > can't connect to database in C++ codes only when called from ASP, this
dll
> > works well in Excel VBA or Visual Basic. Is there anything wrong or
> security
> > settings for ASP calling?

> > Thanks!
> > Weiming



Tue, 29 Jun 2004 09:11:14 GMT  
 Database access from ASP via ATL COM
Are you using ADO?  With ADO, the connection string varies from one database
to the next.  As an example, the connection string for connecting to a SQL
Server D/B might look like the following:

"Provider=SQLOLEDB;Data Source=ServerName;Initial Catalog=DbName;User
ID=UserName;Password=UserPassword"

TFM3

Note: Spam-resistant e-mail address


Quote:
> Is there any sample codes to sign on explicitly when connecting to
database?
> As I don't want to change IUSER_ account security.

> Thanks!
> Weiming



> > Your security as a standard app. (e.g. VB) is that of the logged-in
user.
> > Your security as an ASP is inherited from the web-server.  The
web-server
> > has a separate account set up that it runs under.  (I'd tell you the
name
> of
> > the account, but it varies from one machine to the next.  I think it is
> > typically IUSR_ prepended to the machine name; e.g. IUSR_MYSERVER.)  You
> can
> > either give that account the access it needs, or have your dll do
whatever
> > signon it needs to access the D/B.

> > The ASPs that I develop to access SQL Server DBs via ADO all do an
> explicit
> > signon when they create their connections.  They implement an
> user/password
> > that I set up specifically go restrict web user access.

> > TFM3

> > Note: Spam-resistant e-mail address



> > > Hi,

> > > I failed to access database from ASP via my ATL COM dll. I detected
that
> I
> > > can't connect to database in C++ codes only when called from ASP, this
> dll
> > > works well in Excel VBA or Visual Basic. Is there anything wrong or
> > security
> > > settings for ASP calling?

> > > Thanks!
> > > Weiming



Tue, 29 Jun 2004 09:32:28 GMT  
 Database access from ASP via ATL COM
I use ODBC from my ATL COM, I don't know how to make my own dll have access
security like ADO.


Quote:
> Are you using ADO?  With ADO, the connection string varies from one
database
> to the next.  As an example, the connection string for connecting to a SQL
> Server D/B might look like the following:

> "Provider=SQLOLEDB;Data Source=ServerName;Initial Catalog=DbName;User
> ID=UserName;Password=UserPassword"

> TFM3

> Note: Spam-resistant e-mail address



> > Is there any sample codes to sign on explicitly when connecting to
> database?
> > As I don't want to change IUSER_ account security.

> > Thanks!
> > Weiming



> > > Your security as a standard app. (e.g. VB) is that of the logged-in
> user.
> > > Your security as an ASP is inherited from the web-server.  The
> web-server
> > > has a separate account set up that it runs under.  (I'd tell you the
> name
> > of
> > > the account, but it varies from one machine to the next.  I think it
is
> > > typically IUSR_ prepended to the machine name; e.g. IUSR_MYSERVER.)
You
> > can
> > > either give that account the access it needs, or have your dll do
> whatever
> > > signon it needs to access the D/B.

> > > The ASPs that I develop to access SQL Server DBs via ADO all do an
> > explicit
> > > signon when they create their connections.  They implement an
> > user/password
> > > that I set up specifically go restrict web user access.

> > > TFM3

> > > Note: Spam-resistant e-mail address



> > > > Hi,

> > > > I failed to access database from ASP via my ATL COM dll. I detected
> that
> > I
> > > > can't connect to database in C++ codes only when called from ASP,
this
> > dll
> > > > works well in Excel VBA or Visual Basic. Is there anything wrong or
> > > security
> > > > settings for ASP calling?

> > > > Thanks!
> > > > Weiming



Tue, 29 Jun 2004 11:10:34 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Database access using ATL COM

2. Emergency question on c# access remote Access Database from ASP.net

3. Accessing access via MFC Database classes and ODBC

4. Accessing access via MFC Database classes and ODBC

5. Accessing access via MFC Database classes and ODBC

6. ATL COM - Passing ATL COM classes through another ATL COM class in the same app

7. Upload via ASP (ActiveX ASP component/ATL) and via ISAPI/MFC script. Where is trouble?

8. ASP.NET (ADO.NET) connect to remote MS Access Database

9. database access connection in asp.net

10. Accessing data in two DIFFERENT Oracle databases via ODBC

11. VC++/ATL COM ASP component thread problem.

12. ATL Attributed COM ASP array fails

 

 
Powered by phpBB® Forum Software