Very new to ASP

Reply

Join Date: Sep 2004
Posts: 3
Reputation: orionm is an unknown quantity at this point 
Solved Threads: 0
orionm orionm is offline Offline
Newbie Poster

Very new to ASP

 
0
  #1
Sep 29th, 2004
Hi,

I am very very new to ASP. So far i have been able to connect to the SQL database using dreamweaver mx 2004 but im not sure where to go from here.

I have a support databse that i have setup with a few records.
The table structure looks something like this

Client
-ClientID
-Client
-Address
-PhoneNumber

How do i go about showing the list of clients on the ASP page?

Any help or links would be GREAT :c) im stuck and i cant seem to find anything at all!!!

cheers,
Orion
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: Very new to ASP

 
0
  #2
Sep 29th, 2004
A couple of really good places to start are www.w3schools.com, www.4guysfromrolla.com, www.asp101.com

There are heaps of tutorials and sample scripts out there. Have a search around, try some out and if you get stuck hit the forums and ask away.:cheesy:

Good luck
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 3
Reputation: orionm is an unknown quantity at this point 
Solved Threads: 0
orionm orionm is offline Offline
Newbie Poster

Re: Very new to ASP

 
0
  #3
Sep 29th, 2004
ok - well i have now spent a day on this, no luck. I have been to all those sites as well and i just cant get it

Basically i want to pull basic info from my SQL DB and display it on the ASP page. I have tried so many things but all i get is errors. Lately i have actually resolved the errors but nothing is written to the screen!!

Arghh this is driving me nuts.

Can anyone tell me how to write up the results from a SQL BD to a plain ASP file?

I have the DB connection done and its working.

Cheers,
Orion
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: Very new to ASP

 
0
  #4
Sep 29th, 2004
It's going to be easier to help you if you can post the code you are trying and we can work through that and fix whatever problems there may be.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 10
Reputation: Cyber-SEO is an unknown quantity at this point 
Solved Threads: 0
Cyber-SEO Cyber-SEO is offline Offline
Newbie Poster

Re: Very new to ASP

 
0
  #5
Sep 29th, 2004
orionm>

There are tones of tutorials on google about stuff like this. For now here is the answer you were looking for.

  1. 'After you open your connection
  2. SQL = "SELECT * FROM Client"
  3. Set rsMaster = objConnection.Execute(SQL)
  4.  
  5. If rsMaster.EOF = False Then
  6. Do Until rsMaster.EOF
  7. 'To make it easier on your self you should make your primary key ID instead of ClientID
  8. Response.Write("Client ID: " & rsMaster("ClientID") & "<br>")
  9. Response.Write("Client: " & rsMaster("Client") & "<br>")
  10. Response.Write("Address: " & rsMaster("Address") & "<br>")
  11. Response.Write("Phone Number: " & rsMaster("PhoneNumber") & "<br>")
  12. Response.Write("<hr>")
  13. rsMaster.MoveNext
  14. Else
  15. Response.Write("No records in table")
  16. End If
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 3
Reputation: orionm is an unknown quantity at this point 
Solved Threads: 0
orionm orionm is offline Offline
Newbie Poster

Re: Very new to ASP

 
0
  #6
Sep 29th, 2004
Hahaha *crazy laugh* - ok ive tired that code and no luck.

I must be doing something wrong.

The error reads

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/newcall.asp, line 111


Line 111 being "Set rsMaster = objConnection.Execute(SQL)"

Does this mean i have not set my connection properly?

for the connection i have the collowing code

  1. <%@LANGUAGE="VBSCRIPT"%>
  2. <!--#include file="Connections/support.asp" -->
  3. <%
  4. Dim Client
  5. Dim Client_numRows
  6.  
  7. Set Client = Server.CreateObject("ADODB.Recordset")
  8. Client.ActiveConnection = MM_Support_STRING
  9. Client.Source = "SELECT * FROM dbo.Client"
  10. Client.CursorType = 0
  11. Client.CursorLocation = 2
  12. Client.LockType = 1
  13. Client.Open()
  14.  
  15. Client_numRows = 0
  16. %>
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 2
Reputation: vree is an unknown quantity at this point 
Solved Threads: 0
vree vree is offline Offline
Newbie Poster

Re: Very new to ASP

 
0
  #7
Oct 2nd, 2004
Originally Posted by orionm
Hi,

I am very very new to ASP. So far i have been able to connect to the SQL database using dreamweaver mx 2004 but im not sure where to go from here.

I have a support databse that i have setup with a few records.
The table structure looks something like this

Client
-ClientID
-Client
-Address
-PhoneNumber

How do i go about showing the list of clients on the ASP page?

Any help or links would be GREAT :c) im stuck and i cant seem to find anything at all!!!

cheers,
Orion
On your asp page you will need to connect to your db some way. Example:
oConn.Open "Driver={SQL Server};" & _
"Server=MyServerName;" & _
"Database=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
then you will need your SELECT statement:

SELECT ClientID,Client, Address, City FROM Clients

*Check out this tutorial
http://www.w3schools.com/ado/default.asp

then use <%Response.write("Client")%>

this is a very incomplete simple example. I am new too. Hope it helps
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 34
Reputation: VSBrown is an unknown quantity at this point 
Solved Threads: 0
VSBrown's Avatar
VSBrown VSBrown is offline Offline
Light Poster

Re: Very new to ASP

 
0
  #8
Feb 21st, 2005
There are great ASP Tutorials at Web Wiz Guide which can always be of help also.

Web Wiz Guide : http://www.webwizguide.info/asp/tutorials/default.asp
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 86
Reputation: dexterz is an unknown quantity at this point 
Solved Threads: 3
dexterz dexterz is offline Offline
Junior Poster in Training

Re: Very new to ASP

 
0
  #9
Feb 26th, 2005
I know this connection is generated from Dreamweaver UltraDev or MX.
Do you know how to use the repeat region in UltraDev or MX? It's fairly easy.

Here is my sample, no response.write use to confuse non programmers.
<%
Dim Client
Dim Client_numRows

Set Client = Server.CreateObject("ADODB.Recordset")
Client.ActiveConnection = MM_Support_STRING
Client.Source = "SELECT * FROM Client" ' assume your table name is Client
Client.CursorType = 0
Client.CursorLocation = 2
Client.LockType = 1
Client.Open()
Client_numRows = 0
%>

<%
Dim Repeat2__numRows
Repeat2__numRows = 10 ' Display how many records. In this sample we set 10 records
Dim Repeat2__index
Repeat2__index = 0
Client_numRows = Client_numRows + Repeat2__numRows
%>

<html>
<head>
<title>Test</title>
<body>
<table>
<tr>
<td>
' All records are display inside one table. If you want alternate color for each cell, you need to create another table and put the "While ((Repeat2__numRows <> 0) AND (NOT Client.EOF)) " outside the table.

<%
While ((Repeat2__numRows <> 0) AND (NOT Client.EOF))
%>
Client ID: <%=Client("ClientID")%><br>
Client: <%=Client("Client")%<br>
Address: <%=Client("Address")%><br>
Phone Number: <%=Client("PhoneNumber")%><br>
<hr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
Client.MoveNext()
Wend
%>
</td>
</tr>
</table>

<%If Client.EOF Then%>
No records in table
<%
End If
%>
<%
Client.Close ' Close connection
Set Client = Nothing ' Kill and free up memory
%>
</body>
</html>

www.ex-designz.net
Dexter
Dexter Zaf
Ex-designz.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC