Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Database Connectivity
Microsoft has a tutorial for ASP.  There is a connection string in the
code
as follows:

 DBQ=C:\Inetpub\Wwwroot\Tutorial\guestboo
k.mdb;"\

How do I change this statement once I move the page to my web server?
I
have the database in my root folder.


Thanks


Report this thread to moderator Post Follow-up to this message
Old Post
MROPARTNER@comcast.net
12-28-04 01:55 AM


Re: Database Connectivity
Try using this, both locally and remotely:

Dim sConnectionString
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("/tutorial/guestbook.mdb")

Note that unless you've configured IIS so that read-access is denied to that
file or directory via HTTP, anyone in the world can download your database.
(Assuming that directory is a WWW-published directory.)

Ray at work


<MROPARTNER@comcast.net> wrote in message
news:1104181530.101426.202050@z14g2000cwz.googlegroups.com...
> Microsoft has a tutorial for ASP.  There is a connection string in the
> code
> as follows:
>
>  DBQ=C:\Inetpub\Wwwroot\Tutorial\guestboo
k.mdb;"\
>
> How do I change this statement once I move the page to my web server?
> I
> have the database in my root folder.
>
>
> Thanks
>



Report this thread to moderator Post Follow-up to this message
Old Post
Ray Costanzo [MVP]
12-28-04 01:55 AM


Re: Database Connectivity
On Mon, 27 Dec 2004 16:11:54 -0500, "Ray Costanzo [MVP]" <my first
name at lane 34 dot commercial> wrote:

>Try using this, both locally and remotely:
>
>Dim sConnectionString
>sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>Server.MapPath("/tutorial/guestbook.mdb")

As an explanation, Server.MapPath finds the actual physical path on
the system to the file beginning at the root of the web.  So if your
file was physically at:

 c:\inetpub\wwwroot\subfolder1\applicatio
n\database.mdb

and your site's root was at:

c:\inetpub\wwwroot\

then the MapPath argument would be:

("/subfolder1/application/database.mdb")

Using MapPath ensure that the structure of your web site is followed,
no matter where the root of your site happens to be on the server.
Your ISP could have your root at H:\Webroots\BasicHostingPlans\Bob\
and as long as your structure of your site is the same as on your
home/development system you don't need to change the code.

Jeff


>Note that unless you've configured IIS so that read-access is denied to tha
t
>file or directory via HTTP, anyone in the world can download your database.
>(Assuming that directory is a WWW-published directory.)
>
>Ray at work
>
>
><MROPARTNER@comcast.net> wrote in message
>news:1104181530.101426.202050@z14g2000cwz.googlegroups.com... 
>


Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Cochran
12-28-04 01:55 AM


Re: Database Connectivity
Jeff,

Do you offer consulting (tech support) by the hour?  If so what is your
fee?

Thanks


Report this thread to moderator Post Follow-up to this message
Old Post
MROPARTNER@comcast.net
12-28-04 08:55 AM


Re: Database Connectivity
On 27 Dec 2004 18:06:00 -0800, MROPARTNER@comcast.net wrote:

>Do you offer consulting (tech support) by the hour?  If so what is your
>fee?

Contact me via email at:

jeff at zina dot com

Jeff

Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Cochran
12-29-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:26 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.