problem accessing server 
Author Message
 problem accessing server

I am trying to doing some data access for a web site using scriting. Being
a beginer at this i have come across a problem and am not sure what I need
to do.
I have copied the following script and am trying to get it to work :

var Source = "SELECT * FROM Authors";
var Connect =  "Provider=sqloledb;Data Source=srv;" +
    "Initial Catalog=Pubs;User Id=sa;Password=;"
var Rs1 = Server.CreateObject( "ADODB.Recordset.2.5" );
Rs1.Open(Source,Connect,adOpenForwardOnly);
Response.Write("Success!");

I keep getting the following Jscript error :
'Server' is undefined
in line 3 when I run the script

I think something has not been included which should define the Server but I
don't know what it is

TIA

Neville



Thu, 06 Feb 2003 12:24:29 GMT  
 problem accessing server
Hi Neville

I think this message would only be thrown if you run this code on the
client-side, where there is no "Server". It should be run on the server-side
(ASP).

Klaus

Quote:

> I am trying to doing some data access for a web site using scriting. Being a
> beginer at this i have come across a problem and am not sure what I need to
> do.
> I have copied the following script and am trying to get it to work :

> var Source = "SELECT * FROM Authors";
> var Connect =  "Provider=sqloledb;Data Source=srv;" +
>     "Initial Catalog=Pubs;User Id=sa;Password=;"
> var Rs1 = Server.CreateObject( "ADODB.Recordset.2.5" );
> Rs1.Open(Source,Connect,adOpenForwardOnly);
> Response.Write("Success!");

> I keep getting the following Jscript error :
> 'Server' is undefined
> in line 3 when I run the script

> I think something has not been included which should define the Server but I
> don't know what it is

> TIA

> Neville



Fri, 07 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access to file system on remote FTP-server

2. Help...Trying to access Server Side Object

3. Accessing SQL Server CE from JScript and pIE?

4. IE Jscript access to files from web server?

5. Local HTML file access to Server set Cookies

6. Internet information server locks up on too many simultaneous accesses to a single script

7. Server side file access

8. Server side file access

9. Server-side JScript for DB access?

10. Accessing pages on another server

11. Accessing a View on SQL Server from an ASP

12. Client side access to database on server?

 

 
Powered by phpBB® Forum Software