Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connect to sql database

Status
Not open for further replies.

nat35

Programmer
Nov 10, 2002
86
AU
Hi,
I am a new to asp.I am creating a webside for intranet
I've created a asp in FP2000.
when i preview in browser i can see my code only.
How do i know if it is working and how i can debug.
what are my steps? do i need pws on my computer?
here is my simple code
<%

Dim cnnSimple
Dim rstSimple

Set cnnSimple = server.CreateObject(&quot;ADODB.Connection&quot;)
cnnSimple.Open &quot;driver=SQL Server;server=10.1.1.50;uid = sa; password = '';database=intranet;&quot;<BR>
Set rstSimple = cnnSimple.Execute(&quot;SELECT * From tbl_department&quot;)<BR>%&gt;<BR>
%>
<table border=&quot;1&quot; height=&quot;18&quot;>
<%
Do While Not rstSimple.EOF
%>
<tr>
<td height=&quot;12&quot;><%= rstSimple.Fields(&quot;dep_id&quot;).Value %></td>
<td height=&quot;12&quot;><%= rstSimple.Fields(&quot;s_name&quot;).Value %></td>
<td height=&quot;12&quot;><%= rstSimple.Fields(&quot;name_ref&quot;).Value %></td>

</tr>
<%
rstSimple.MoveNext
Loop
%>
</table>
<%
rstSimple.Close
Set rstSimple = Nothing
cnnSimple.Close
Set cnnSimple = Nothing

%>
thank you in advance

 
Hi there,

the first thing you should know is that there is no easy way to 'debug' asp. The best way to do it i have found is to insert Response.write expressions in places to see what varibles look like etc ...

The other thing is, do you have IIS running?

Transcend
 
Transcend,
yes i do have iis running
what is my next step
nat
what is my next step
 
Hi again,

ok it seems you have a few bits of code missing ...

for a start <%@ Language=VBScript %> should be at the top of your page,

secondly you don't seem to have all the html code that you need ... the only html I can see there is the table creation. You are missing the
<html>
<head>
</head>
<body>
</body>
</html> tags which should appear in your code ...

you need to place the code which you have pasted above between the <body> and </body> tags

Hope this helps

Transcend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top