ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 28th, 2002, 02:04 PM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Testing of Active Server Pages scripting using Personal Web Server

Hi,

I am trying to test a beginners piece of ASP scripting:

<% @language=VBScript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Derek Robertson">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Win95; U) [Netscape]">
<title>Active Server Page 02</title>
</head>
<body>

<center><b><font size=+1>ASP Test Page</font></b>
<p><b><i>This page is one which will be built up to interact with an MS
Access database</i></b></center>


Output: <br>

<%
intS= 60*60
%>
There are
<%
response.write intS
%>
seconds in an hour.


</body>
</html>

Why won't MSN Explorer or Netscape 6.2 interpret the ASP scripting? They handle the HTML OK, but just throw the ASP scripting back at me.

I don't seem to have any beginners luck on this one!

Regards

Derek

Last edited by Derek Robertson : September 15th, 2002 at 06:42 AM.

Reply With Quote
  #2  
Old August 28th, 2002, 02:33 PM
markerdave markerdave is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Illinois, USA
Posts: 71 markerdave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Hi Dereck,

Netscape and Explorer don't interpret ASP code. Your web server has to do that. Do you have your web server set up to handle the ASP code? Also, make sure that your page is in a folder where the web server has access to.

Reply With Quote
  #3  
Old August 28th, 2002, 06:52 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Sounds to me, that your just running it off your hard drive and not on a server configured for asp. In order to run any server side language, you must have a server configured to run that language on. For asp, you would probally want to look at IIS, as a server, to run your scripts

Reply With Quote
  #4  
Old August 29th, 2002, 03:36 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Testing using Personal Web Server

What about the use of Personal Web Server? I have got that running in the bacground, but not responding properly. Maybe there is a complication because I am running Windows ME, and had to download Personal Web Server to a different directory?

Last edited by Derek Robertson : August 30th, 2002 at 02:43 PM.

Reply With Quote
  #5  
Old September 1st, 2002, 04:02 PM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 17
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
Hi Derek,

Did you install Option Pack 4 on your personal webserver? I am running PWS on a Win ME system without problems, ie can read ASP files.


But in order for you to make it work
download option pack 4:
http://www.microsoft.com/ntserver/n...tPk/default.asp

and install.
Ensure your asp page is in a directory where PWs has access to and run the page using http://localhost/yourpage.asp

Since asp is server side, your need to treat your computer as a webserver (which PWS does)

You will see in your tray if PWS is running or not
__________________
- Rogier Doekes

Reply With Quote
  #6  
Old September 2nd, 2002, 03:04 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question ASP and Windows ME

Hi Rogier,

Thank you for your helpful response.

I did download Option Pack 4 from the MSN site you quoted.

Installation of OP4 kept giving various error messages, so I surfed about, and used the advice given by Mike Burgess at Microsoft MVP
http://www.users.qwest.net/~careyh/fixes.htm

>>QUOTE:
Problem: How can I add PWS to windows ME?
Possible Solution: From Mike Burgess, Microsoft MVP
(How To Install PWS in Windows Me: http://members.home.net/winhelp98/pws.htm)
Q266456 - Personal Web Server Is Not Included with Windows Millennium Edition
http://support.microsoft.com/suppor...s/Q266/4/56.asp
Use the patch from this Microsoft Knowledgebase Article first:
Error Message: An Unknown Error Occurred While Making MTS Specific Changes to the System Registry
http://support.microsoft.com/suppor...s/Q246/0/81.ASP
Install PWS IN custom MODE and ONLY install Transaction Server, SETUP will prompt you, that other components are needed. Get it down to
basically just Transaction Server, core components and MDAC. Reboot and then run Setup again via Add/Remove and install the other
components. (Personal Web Server, etc..)
If you already have PWS installed, try removing everything via Add/Remove but Transaction Server then reboot. Run Setup again to add the
rest.
>>UNQUOTE

After getting PWS installed successfully, the present situation is that I have a PWS icon in my system tray, and it shows "Personal Web Server is running"

Your point about:
Ensure your asp page is in a directory where PWs has access to and run the page using
http://localhost/yourpage.asp
seems to be my current problem.
The file I am trying to test resides in my
c:\inetpub\wwwroot\dmrweb and it has a filename with a ".html" file extension.
How do I get PWS to test that file?

Thanks again

Regards

Derek

Reply With Quote
  #7  
Old September 2nd, 2002, 03:36 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 17
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
try to save the file with a .asp extension and run it again using
http://localhost/drwweb/yourfile.asp

Also ensure your properties are setup right:
- dubble click on the PWS icon in your tray
- click Advanced
- Click Edit Properties
- verify the directory (and the wwwroot directory) has read and scripts access

Then it should work.

success

Reply With Quote
  #8  
Old September 2nd, 2002, 10:22 AM
infamous-online infamous-online is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 403 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 27 m 25 sec
Reputation Power: 17
Red face Re: Testing of Active Server Pages scripting

Quote:
Originally posted by Derek Robertson
Hi,

I am trying to test a beginners piece of ASP scripting:

<% @language=VBScript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Derek Robertson">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Win95; U) [Netscape]">
<title>Active Server Page 02</title>
</head>
<body>

<center><b><font size=+1>ASP Test Page</font></b>
<p><b><i>This page is one which will be built up to interact with an MS
Access database</i></b></center>


Output: <br>

<%
intS= 60*60
%>
There are
<%
response.write intS
%>
seconds in an hour.


</body>
</html>

Why won't MSN Explorer or Netscape 6.2 interpret the ASP scripting? They handle the HTML OK, but just throw the ASP scripting back at me.

I don't seem to have any beginners luck on this one!

Regards

Derek



lol iis 5 or apache with the asp module would help you see your asp scripts as other's have mentioned this
__________________
Apache Expert

Reply With Quote
  #9  
Old September 2nd, 2002, 11:43 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 17
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
Smile see abow

Hi asp_man,

See above:

ASP runs server side. this means you need to configure your computer as a server. See abow how to download option pack 4 for PWS. You need this to run asp files.

Which browser you use does not matter, again, since asp runs server side.

see here a tutorial on beginning with ASP:
http://www.devguru.com/features/tutorials/ASP/ASP.html

Reply With Quote
  #10  
Old September 13th, 2002, 08:38 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Working with Access Databases

Thanks to all contributors,

I have now got some simple ASP working, and I want to move on to using ASP to go to an Access 2000 database, which is parked in my c:\inetpub\databases

At this stage I need to be sure that I understand fully the personalised pieces of the tutorial line:

DataConn.Open "DSN=dsnname;SRVR=server IP address;UID=username;PWD=password"

For dsnname I put myfile.mdb

For server IP address I put c:\inetpub\databases

In ODBC Data Sources > System DSN > Name I added myfile.mdb and left Description blank
also under Advanced I left Default Authorisation blank

On trying to test myfile.asp I get the message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

What do I need to do now please?

Regards

Derek

Reply With Quote
  #11  
Old September 13th, 2002, 09:15 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 17
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
Hi Derek

The tutorial you read speaks of a DSN, which is a ODBC connection. ODBC stands for Open DataBase Connection, which is microsoft way of handling connections to databases. DSN less connection also exist, but that's another matter.

What you need to do:
1. Go Start/ settings/Control Panel/ODBC Data Source
2. Go to the tab System DSN
3. Click Add..
4. Select the Access Driver and click Finish
5. Under Data Source Name enter a name
6. Desciption is for reference
7. Click Select and select the database
8. After OK, your DSN is ready

Now in your ASP connection string you reference the name you gave under point 5:
cnn.Open "dsn=see_5;Uid=;Pwd="

success

-Rogier

Reply With Quote
  #12  
Old September 13th, 2002, 10:33 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Working with Access Databases

Thanks Rogier,

Having done as you suggested, I now get no error messages.

Now we come to pulling information from the database.

Line 1 of the 4 lines discussed in the tutorial:

StrSQL = "SELECT * from TABLE"
I substituted mytablename in place of TABLE

Line 4 of 4 in tutorial:

Set TABLE = DataConn.Execute(strSQL)
I substituted mytablename in place of TABLE
Is the case of the "s" in str important? Line 1 in the tutorial uses "StrSQL" and Line 4 uses "strSQL"

I got no information from the TABLE.

Regards

Derek

Reply With Quote
  #13  
Old September 13th, 2002, 10:47 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 17
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
option explicit

VBscript is a weak typed language, meaning that all your variables can be of any type.

However, it is a good programming habit to start each asp file with the following snippet:
<% Option Explicit%>

This means that you explicitely have to define your variables: you do this with the Dim statement

So this is correct programming:
Dim oCnn, strSQL

Set oCnn = Ser........

strSQL = "Select......"


If you type now oCnn.Execute (sql) you will get an error message saying that variable sql is not defined, which is good, since you would like to use strSQL..

see http://www.devguru.com/Technologies...ickref/dim.html

-Rogier

Reply With Quote
  #14  
Old September 13th, 2002, 04:08 PM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Communicating with an Access Database

Hi Rogier,

I have tried the Option Explicit advice.

I have now first success in getting information from my database, in that the first record is output OK. But I cannot get the Do....Loop to retrieve subsequent records to EOF.

The contents of my test file are currently:

<% @language=VBScript %>
<!-- Option Explicit -->
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Derek Robertson">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Win95; U) [Netscape]">
<title>ASP Test SQL</title></head>
<body>
<% Dim DataConn, StrSQL %>
<% Set DataConn = Server.CreateObject("ADODB.Connection") %>
<% StrSQL = "SELECT * from icon_database" %>
<% DataConn.Open "DSN=icon-ps_trial;UID=;PWD=" %>
<% icon_database = DataConn.Execute(StrSQL) %>
<% Do Until icon_database.EOF %>
<br><br><% response.write icon_database ("id") %>
<br><br><% response.write icon_database ("pkey") %>
<br><br><% response.write icon_database ("title") %>
<br><br><% response.write icon_database ("refno") %>
<br><br><% response.write icon_database ("description") %>
<br><br><% response.write icon_database ("start") %>
<br><br><% response.write icon_database ("location") %>
<br><br><% response.write icon_database ("category") %>
<br><br><% response.write icon_database ("salary") %>
<%
icon_database.MoveNext
Loop
%>
</body>
</html>

I get two error messages:

For start of Do Loop:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'EOF'

For increments to next record:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'MoveNext'

How do I get the Do....Loop to work?

Regards

Derek

Last edited by Derek Robertson : September 14th, 2002 at 01:08 AM.

Reply With Quote
  #15  
Old September 15th, 2002, 02:51 AM
Nauman Nauman is offline
Twenty Seven
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Multan, Pakistan
Posts: 103 Nauman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 33 m 2 sec
Reputation Power: 17
Send a message via ICQ to Nauman
Re: Communicating with an Access Database

Hello Derk...

You have made your code very complex... You must use i.e.

<%
statements
statements
statements
%>

you must use while loop... i think it would work fine....

i.e.

while not icon_database.eof
statements
statements
statemetns
wend

i dont know what the problem... database access is so simple...

<html><head><% strConnect = ----your connection string----%>
</head><body>
<%
dim objRS
set objRS = server.createobject("ADODB.REcordset")
objRS.open "TableName", strConnect

while not objrs.eof
response.write objRS("field1")
response.write objRS("Field2")
--------
--------
objRS.MoveNext
wend
objRS.close
set objrS=nothing
%>

Reply With Quote
  #16  
Old September 15th, 2002, 06:17 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Communicating with Access Database

Thanks Nauman,

I tried the "while" coding, and I get two error messages:
Object doesn't support this property or method: 'eof'
Object doesn't support this property or method: 'MoveNext'
Is there something missing from my Microsoft Personal Web Server?

Regards

Derek

Reply With Quote
  #17  
Old September 16th, 2002, 12:22 PM
Matt M  Matt M  is offline
red house painter
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: South east England
Posts: 46  Matt M  User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to  Matt M Send a message via AIM to  Matt M
have you created the recordset object?

problem may also be case sensitivity or ado constants, i noticed you dont have any declared for the cursortype or lock type. this may cause the error.

if you have declared objRS or RS as a variable but not set it as a recordset object then it wont support End of file or move next - they are recordset only functions.

make sure you have:

dim objRS

Set objRS = CreateObject("ADODB.Recordset")

objRS.Open "select * from here", adOpenStatic, adLockReadOnly

if not objRS.EOF then
while objRS.EOF = false
with response
.write trim(objRS("something))
.write "<br>"
end with
wend
else
response.write "no records"
end if

The code above also needs a connection object declaring and provider information - presume you have this either as a DSN or a hardcoded server.mappath url

make sure you close connection objects and recordset objects at the end of each page - not essential but good practice.

i.e.:

objRS.close
set objRS = Nothing

Last edited by Matt M : September 16th, 2002 at 12:25 PM.

Reply With Quote
  #18  
Old September 16th, 2002, 02:27 PM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Communicating with Access Database

Thanks Matt M,

I will recheck my scripting and report back.

Regards

Derek

Reply With Quote
  #19  
Old September 18th, 2002, 06:22 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Communicating with Access Database

Thanks to all Contributors,

I am now able to communicate with my trial database.

Any comments about the following scripting will be welcomed, particularly anything relating to "good scripting practice":

<% @language=VBScript %>
<%
Dim DataConn, StrSQL, rs
Set DataConn = Server.CreateObject("ADODB.Connection")
StrSQL = "SELECT * from icon_database"
DataConn.Open "DSN=icon-ps_trial;UID=;PWD="
set rs = Server.CreateObject("ADODB.recordset")
icon_database = DataConn.Execute(StrSQL)
rs.Open Strsql, DataConn

%>
<body text="#000000" bgcolor="#ff6600" link="#0000ee" vlink="#00ff00"

<%while rs.EOF=false%>
<table border="5" width="100%" bgcolor="#ff9900">
<td align="center">
<tbody>
<tr>

<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<br>
<%wend
rs.close
DataConn.close
%>

Next task I will tackle is to use a Data Form Wizard to create a form which will read and / or amend the database.
Any comments about VB6 in 24 Hours, Hour 15, p263-264 ?
But, is it true that the Data Form Wizard is only available in the full version of VB 6.0, and that it is not included in VB 6.0 trial versions?

Regards

Derek

Last edited by Derek Robertson : September 20th, 2002 at 02:26 AM.

Reply With Quote
  #20  
Old September 20th, 2002, 02:15 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Communicating with Access Database

Hi Again Matt M,

Please see and comment on my posting about successful scripting.

Regards

Derek

Last edited by Derek Robertson : September 20th, 2002 at 02:22 AM.

Reply With Quote
  #21  
Old September 20th, 2002, 02:18 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Re: option explicit

Hi Again Rogier,

Please see and comment on my posting about successful scripting.

Regards

Derek

Last edited by Derek Robertson : September 20th, 2002 at 02:23 AM.

Reply With Quote
  #22  
Old September 20th, 2002, 02:21 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Re: Re: Communicating with an Access Database

Hi Again Nauman,

Please see and comment on my posting about successful scripting.

Regards

Derek

Reply With Quote
  #23  
Old September 20th, 2002, 02:33 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Re: Re: Testing of Active Server Pages scripting

Hi Again asp_man,

Please see and comment on my posting about successful scripting.

Regards

Derek

Reply With Quote
  #24  
Old September 20th, 2002, 02:36 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Communicating with Access Database

Hi Again markerdave,

Please see and comment on my posting about successful scripting.

Regards

Derek

Reply With Quote
  #25  
Old September 20th, 2002, 02:38 AM
Derek Robertson Derek Robertson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: UK
Posts: 16 Derek Robertson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Communicating with Access Database

Hi Again Ben Rowe,

Please see and comment on my posting about successful scripting.

Regards

Derek

Reply With Quote
  #26  
Old October 12th, 2002, 05:42 AM
infamous-online infamous-online is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 403 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 27 m 25 sec
Reputation Power: 17
Re: see abow

Quote:
Originally posted by rdoekes
Hi asp_man,

See above:

ASP runs server side. this means you need to configure your computer as a server. See abow how to download option pack 4 for PWS. You need this to run asp files.

Which browser you use does not matter, again, since asp runs server side.

see here a tutorial on beginning with ASP:
http://www.devguru.com/features/tutorials/ASP/ASP.html



uhmm what do you think IIS and Apache are? they are servers unless i'm missing something here... no need to help me man i'm a pro with this stuff....

Reply With Quote
  #27  
Old October 12th, 2002, 01:36 PM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 17
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
Talking sorry asp_man

Reading the thread back, sorry that I gave you a piece of advice that was clearly not intended for you.

Me bad.

-Rogier

Reply With Quote
  #28  
Old October 12th, 2002, 06:09 PM
infamous-online infamous-online is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 403 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 27 m 25 sec
Reputation Power: 17
Re: sorry asp_man

Quote:
Originally posted by rdoekes
Reading the thread back, sorry that I gave you a piece of advice that was clearly not intended for you.

Me bad.

-Rogier


it's cool no biggie .

Reply With Quote
  #29  
Old October 13th, 2002, 10:20 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 17
Send a message via MSN to aspnewbie
Hi Derek,

I tend to keep all of my connection information together. I put that info in an include file, so that I can reuse it on every asp page I create and not have to retype it. (Alternatively, you can include you connection info in a global.asa file.) That way, if you ever need to change your connection string, you only have to change it in one place.

So I would create a file called connect.asp (don't use inc extension for connection info as that has been found to be insecure). For sake of organization, I put all my include files in an "include" folder. It would simply consist of the following:

Code:
<%

Dim DataConn 
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionString = "DSN=icon-ps_trial;UID=;PWD="
DataConn.Open 
%>



Then at the top of your asp page put:

<!--#include file="include/connect.asp"-->

<%

dim strSQL
dim rs

strSQL = "SELECT * from icon_database"
set rs = DataConn.Execute(StrSQL)

%>
<body text="#000000" bgcolor="#ff6600" link="#0000ee" vlink="#00ff00"

<%while rs.EOF=false%>
<table border="5" width="100%" bgcolor="#ff9900">
<td align="center">
<tbody>
<tr>

<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<br>
<%wend
rs.close
DataConn.close
%>


I always set my variables to nothing, in addition to closing them

so after rs.close, I would write:

Code:
 set rs = nothing 


same with DataConn.

Code:
 set DataConn = nothing 


It also appears that you are combining two methods - SQL and ADO. I indicated above how you would do it with SQL command. For ADO, you would use the following:

Code:
strSQL = "SELECT * from icon_database"
set rs = Server.CreateObject("ADODB.recordset")
rs.Open strSQL, DataConn, 1, 3



Hope this helps.

Last edited by aspnewbie : October 13th, 2002 at 10:32 AM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Testing of Active Server Pages scripting


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap