Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: connecting to a dabase on a remote server


Message #1 by "Coby L. Herd" <cobyco@c...> on Tue, 26 Nov 2002 14:18:43
I'm having problems extablishing a connection- 
The login script below (From Begining Active Server Pages 3.0) works fine 
on localhost but when I put in on my remote server I can't seem to make 
the database connection. 


<% 
  Dim objConn 
  Set objConn = Server.CreateObject("ADODB.Connection") 
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _ 
               "Data Source= 
C:\Inetpub\wwwroot\caterdata\database\classified.mdb" 

  If Session("blnValidUser") = True and Session("PersonID") = "" Then 
    Dim rsPersonIDCheck 
    Set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset") 
    Dim strSQL 
    strSQL = "SELECT PersonID FROM Person " & _ 
             "WHERE EMailAddress = '" & Session("EMailAddress") & "';" 
    rsPersonIDCheck.Open strSQL, objConn 
    If rsPersonIDCheck.EOF Then 
      Session("blnValidUser") = False 
    Else 
      Session("PersonID") = rsPersonIDCheck("PersonID") 
    End If 
    rsPersonIDCheck.Close 
    Set rsPersonIDCheck = Nothing 
  End If 
%> 
-------------------- 
Of course I realize that I need to change the Data Source but everything 
I've tried has not worked-- 
http://www.caterdata.com/database/classified.mdb
 
--------------------------------- 
Or trying ADO connections 
DSN="classified")) 

any suggestions would be a big help 

CobyCo
Message #2 by Nikos <pappas@c...> on Tue, 26 Nov 2002 17:18:21 +0200
Is this the path in the server?
This looks like your machine's path.

At 04:18 =EC=EC 26/11/2002, you wrote:
>I'm having problems extablishing a connection-
>The login script below (From Begining Active Server Pages 3.0) works fine
>on localhost but when I put in on my remote server I can't seem to make
>the database connection.
>
>
><%
>   Dim objConn
>   Set objConn =3D Server.CreateObject("ADODB.Connection")
>   objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0; " & _
>                "Data Source=3D
>C:\Inetpub\wwwroot\caterdata\database\classified.mdb"
>
>   If Session("blnValidUser") =3D True and Session("PersonID") =3D "" Then
>     Dim rsPersonIDCheck
>     Set rsPersonIDCheck =3D Server.CreateObject("ADODB.Recordset")
>     Dim strSQL
>     strSQL =3D "SELECT PersonID FROM Person " & _
>              "WHERE EMailAddress =3D '" & Session("EMailAddress") & "';"
>     rsPersonIDCheck.Open strSQL, objConn
>     If rsPersonIDCheck.EOF Then
>       Session("blnValidUser") =3D False
>     Else
>       Session("PersonID") =3D rsPersonIDCheck("PersonID")
>     End If
>     rsPersonIDCheck.Close
>     Set rsPersonIDCheck =3D Nothing
>   End If
>%>
>--------------------
>Of course I realize that I need to change the Data Source but everything
>I've tried has not worked--
>http://www.caterdata.com/database/classified.mdb
>
>---------------------------------
>Or trying ADO connections
>DSN=3D"classified"))
>
>any suggestions would be a big help
>
>CobyCo
 pappas@c...
>%%email.unsub%%
>


Message #3 by Nikos <pappas@c...> on Tue, 26 Nov 2002 17:25:33 +0200
Wrong answer in a harry

something like

cn.open "Provider=3DMicrosoft.Jet.OLEDB.4.0;data
source=3D\\MyServer\MyShareDir\MyDatabase.mdb"

Hope it helps

At 04:18 =EC=EC 26/11/2002, you wrote:
>I'm having problems extablishing a connection-
>The login script below (From Begining Active Server Pages 3.0) works fine
>on localhost but when I put in on my remote server I can't seem to make
>the database connection.
>
>
><%
>   Dim objConn
>   Set objConn =3D Server.CreateObject("ADODB.Connection")
>   objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0; " & _
>                "Data Source=3D
>C:\Inetpub\wwwroot\caterdata\database\classified.mdb"
>
>   If Session("blnValidUser") =3D True and Session("PersonID") =3D "" Then
>     Dim rsPersonIDCheck
>     Set rsPersonIDCheck =3D Server.CreateObject("ADODB.Recordset")
>     Dim strSQL
>     strSQL =3D "SELECT PersonID FROM Person " & _
>              "WHERE EMailAddress =3D '" & Session("EMailAddress") & "';"
>     rsPersonIDCheck.Open strSQL, objConn
>     If rsPersonIDCheck.EOF Then
>       Session("blnValidUser") =3D False
>     Else
>       Session("PersonID") =3D rsPersonIDCheck("PersonID")
>     End If
>     rsPersonIDCheck.Close
>     Set rsPersonIDCheck =3D Nothing
>   End If
>%>
>--------------------
>Of course I realize that I need to change the Data Source but everything
>I've tried has not worked--
>http://www.caterdata.com/database/classified.mdb
>
>---------------------------------
>Or trying ADO connections
>DSN=3D"classified"))
>
>any suggestions would be a big help
>
>CobyCo
 pappas@c...
>%%email.unsub%%
>


Message #4 by "Vinnie \(Mailinglists Only\)" <vinnie@j...> on Tue, 26 Nov 2002 16:42:44 +0100
use a dsn-less conenction string ...

for example asp-page is on wwwroot

This is what I should use ..

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Mode=Share Deny
None;Extended Properties="""";Jet OLEDB:System database="""";Jet
OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine
Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;User
Id=Admin;PASSWORD=;Data Source=" &
Server.MapPath("caterdata\database\classified.mdb")



----- Original Message -----
From: "Coby L. Herd" <cobyco@c...>
To: "ASP Database Setup" <asp_database_setup@p...>
Sent: Tuesday, November 26, 2002 2:18 PM
Subject: [asp_database_setup] connecting to a dabase on a remote server


> I'm having problems extablishing a connection-
> The login script below (From Begining Active Server Pages 3.0) works fine
> on localhost but when I put in on my remote server I can't seem to make
> the database connection.
>
>
> <%
>   Dim objConn
>   Set objConn = Server.CreateObject("ADODB.Connection")
>   objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
>                "Data Source
> C:\Inetpub\wwwroot\caterdata\database\classified.mdb"
>
>   If Session("blnValidUser") = True and Session("PersonID") = "" Then
>     Dim rsPersonIDCheck
>     Set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset")
>     Dim strSQL
>     strSQL = "SELECT PersonID FROM Person " & _
>              "WHERE EMailAddress = '" & Session("EMailAddress") & "';"
>     rsPersonIDCheck.Open strSQL, objConn
>     If rsPersonIDCheck.EOF Then
>       Session("blnValidUser") = False
>     Else
>       Session("PersonID") = rsPersonIDCheck("PersonID")
>     End If
>     rsPersonIDCheck.Close
>     Set rsPersonIDCheck = Nothing
>   End If
> %>
> --------------------
> Of course I realize that I need to change the Data Source but everything
> I've tried has not worked--
> http://www.caterdata.com/database/classified.mdb
>
> ---------------------------------
> Or trying ADO connections
> DSN="classified"))
>
> any suggestions would be a big help
>
> CobyCo
%%email.unsub%%
>
>


  Return to Index