Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2003, 04:30 PM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tiennguyen
Default Database connection.

I am so begining with ASP. I have couple questions an hope someone outthere can give me right direction.
1. We have to server and for right now we run IIS and database on the same server, but my boss want to move database to another server, and leave ASP stuff on the old server.
(This is the way we made connection in the past:
With Con
        .ConnectionTimeout = 40
        .Open "DBQ=" & Server.MapPath("../../../../SWGSB-Data/SWGSB.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
    End With
)
2. If I move the database to SWGSBSRV2 Server, how could I do that? I thought we can change the name of Sesver from the old one but that may not correct because we should give it the permission but not only the name of server????
I am so novice with this ASP and I've ever done anything like that.
Thanks so much.
Tracy.


 
Old September 30th, 2003, 04:55 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Trace,

Take a look at this site. It defines various Connection Strings to Access and other database, including an UNC share...

Alternatively, you can create a virtual directory in your webserver (IIS) that you can call Database and that points to some location on your network.

You can then use Server.MapPath("/Database") to retrieve the location of the database.

In both cases, your web server needs enough permissions to read from the database and to create some lock files in the folder where the database resides. If you are using Anonymous Access, the web server uses IUSR_MachineName as the default account. This is usually a local account so you can't use it directly on the server with the database.

A few ways to solve this:

1. Have the IIS Virtual Directory run under a different Domain Account
2. Have IIS run under a Domain Account (you could change the security settings for your entire site, so it uses Domain\SomeUser for example.
3. You can use the IUSR_MachineAccount, but provide it your own password (the account has an automatically generated password, so you'll need to change it)
4. Upgrade to SQL Server or some other real DBMS ;) Makes it lot easier to scale out and to move your database to a different server.

Personally, I think that option 2 is quite OK. It allows you to control the rights this new web server account has, so it can't do more than IUSR could.

This may be a bit hard to digest at once if you're new to this, so feel free to ask further questions.

Cheers and good luck,

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 30th, 2003, 09:48 PM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tiennguyen
Default

Thanks so much, I will try and let you know.
Quote:
quote:Originally posted by Imar
 Hi Trace,

Take a look at this site. It defines various Connection Strings to Access and other database, including an UNC share...

Alternatively, you can create a virtual directory in your webserver (IIS) that you can call Database and that points to some location on your network.

You can then use Server.MapPath("/Database") to retrieve the location of the database.

In both cases, your web server needs enough permissions to read from the database and to create some lock files in the folder where the database resides. If you are using Anonymous Access, the web server uses IUSR_MachineName as the default account. This is usually a local account so you can't use it directly on the server with the database.

A few ways to solve this:

1. Have the IIS Virtual Directory run under a different Domain Account
2. Have IIS run under a Domain Account (you could change the security settings for your entire site, so it uses Domain\SomeUser for example.
3. You can use the IUSR_MachineAccount, but provide it your own password (the account has an automatically generated password, so you'll need to change it)
4. Upgrade to SQL Server or some other real DBMS ;) Makes it lot easier to scale out and to move your database to a different server.

Personally, I think that option 2 is quite OK. It allows you to control the rights this new web server account has, so it can't do more than IUSR could.

This may be a bit hard to digest at once if you're new to this, so feel free to ask further questions.

Cheers and good luck,

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection to Access Database reachsevar ASP.NET 2.0 Basics 1 November 28th, 2007 08:56 AM
Database Connection oneillg PHP Databases 1 October 17th, 2007 04:48 PM
Database Connection kapi.goel SQL Language 2 February 14th, 2006 07:01 PM
database connection Nitin_sharma Classic ASP Databases 1 February 8th, 2005 10:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.