Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: RES: Re: something very easy, if you know how...


Message #1 by "bahi0272" <jbnetto@c...> on Sat, 3 Mar 2001 10:46:55 -0300

-----Mensagem original-----

De: Ken Schaefer [mailto:ken@a...]

Enviada em: sexta-feira, 2 de março de 2001 04:01

Para: ASP Database Setup

Assunto: [asp_database_setup] Re: something very easy, if you know

how...







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

: strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

:                  "Data Source=C:\datastores\Movie2000.mdb;" & _

:                  "Persist Security Info=False"

:

:

: When i use this database on my computer is working quit well,

: but if I try to put it on the server, i do not know how to change

: the code "Data Source=C:\datastores\Movie2000.mdb;" &

:              This c:\, how do I call the data base, This a very basic e

: error, but I do not Know how to call the data base on the server...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Try using Server.Mappath("/")



This returns the physical path of your WWW address, eg:



Response.Write(Server.Mappath("/"))



Cheers

Ken

Message #2 by "Sara Petty" <spetty@w...> on Tue, 20 Mar 2001 15:58:55
I will pass on this code that I received from someone else.  If you don't know the path to the 

database on the server, just copy the code below into an .asp file and view it.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



<%

Option Explicit

Dim Key

%>



<HTML>

<HEAD>

<TITLE>The HTTP Server Variables Collection</TITLE>

</HEAD>



<BODY BGCOLOR=white>

<CENTER>

<H2>The HTTP Server Variables Collection</H2>

</CENTER>



<TABLE BORDER=1>

<TR>

  <TD><B>Variable Name</B></TD>

  <TD><B>Value</B></TD>

</TR>



<%

  For Each Key in Request.ServerVariables

    Response.Write "<TR><TD>" & Key & "</TD><TD>"



    If Request.ServerVariables(key) = "" Then

      Response.Write " "

    Else

      Response.Write Request.ServerVariables(key)

    End If



    Response.Write "</TD></TR>"

  Next

%>



</TABLE>

</BODY>

</HTML>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





> 

> -----Mensagem original-----

> De: Ken Schaefer [mailto:ken@a...]

> Enviada em: sexta-feira, 2 de março de 2001 04:01

> Para: ASP Database Setup

> Assunto: [asp_database_setup] Re: something very easy, if you know

> how...

> 

> 

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> : strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

> :                  "Data Source=C:\datastores\Movie2000.mdb;" & _

> :                  "Persist Security Info=False"

> :

> :

> : When i use this database on my computer is working quit well,

> : but if I try to put it on the server, i do not know how to change

> : the code "Data Source=C:\datastores\Movie2000.mdb;" &

> :              This c:\, how do I call the data base, This a very basic e

> : error, but I do not Know how to call the data base on the server...

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> 

> Try using Server.Mappath("/")

> 

> This returns the physical path of your WWW address, eg:

> 

> Response.Write(Server.Mappath("/"))

> 

> Cheers

> Ken


  Return to Index