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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a neat phone list 1

Status
Not open for further replies.

JLSigman

Programmer
Joined
Sep 20, 2001
Messages
261
Location
US
Hi,

In my never-ending work on the personnel directory, I've finally gotten to the phone list. The repeat region part is the simple part... what I'd like to be able to do is format the region so it'll fit on one page, in two or more columns. Can someone point me in the right direction, please? Thanks,

Jennifer Sigman
 
I figured it would be something that simple...

Give me some time to recreate this with VBSCript at the default, since there's some other stuff that's now conflicting (like the ODBC connection line), and I'll come back here if I need more advice/hand-holding. Thanks a ton,

Jennifer Sigman
Code-borrower extraordinaire
"They call us public servants for a reason..."
 
OK, don't forget to mark the thread if you found it heplful Derren
[Mediocre talent - spread really thin]
 
I swear, I need to change (Programmer) to (Programming idiot)

Here's my code:
<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;Connections/Connection_odbc_conn_dsn.asp&quot; -->
<%
set rsPhone = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsPhone.ActiveConnection = MM_Connection_odbc_conn_dsn_STRING
rsPhone.Source = &quot;SELECT FIRST_NAME, PHONE, LAST_NAME FROM DIRECTORY WHERE ROOM_NUM <> 'Dist' ORDER BY USERID ASC&quot;
rsPhone.CursorType = 0
rsPhone.CursorLocation = 2
rsPhone.LockType = 3
rsPhone.Open()
rsPhone_numRows = 0
%>
<%
FileName=&quot;Connection_odbc_conn_dsn.htm&quot;
Type=&quot;ADO&quot;
HTTP=&quot;true&quot;
Catalog=&quot;&quot;
Schema=&quot;&quot;
var MM_connDirectory_STRING = &quot;dsn=Air-DB;&quot;
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<table width=&quot;42%&quot; border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot;>
<tr>
<td width=&quot;60%&quot;><b>NAME</b></td>
<td width=&quot;40%&quot;><b>PHONE</b></td>
<td width=&quot;60%&quot;><b>NAME</b></td>
<td width=&quot;40%&quot;><b>PHONE</b></td>
</tr>
<%
col=1
While NOT rsPhone.EOF
If col=1 then %>
<tr valign=&quot;top&quot;>
<% End if %>
<td width=&quot;60%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;-2&quot;><%=(rsPhone.Fields.Item(&quot;LAST_NAME&quot;).Value)%>, <%=(rsPhone.Fields.Item(&quot;FIRST_NAME&quot;).Value)%></font></td>
<td width=&quot;40%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;-2&quot;><%=(rsPhone.Fields.Item(&quot;PHONE&quot;).Value)%></font></td>
<% If col=2 then %>
</tr>
<% End if
col = col +1
If col = 3 then col =1
rsPhone.movenext()
End if
Wend
%>
</table>
</body>
</html>
<%
rsPhone.Close()
%>


And here's the error I'm getting:
Microsoft VBScript compilation error '800a0400'

Expected statement

/baq/directory/TMP6eo8dtn0qk.asp, line 15

Type=&quot;ADO&quot;
^

I'm new to VBScript, which is probably 9/10ths of my problem. Thanks,
Jennifer Sigman
Code-borrower extraordinaire
&quot;They call us public servants for a reason...&quot;
 
Why do you have the dreamweaver connection tags in the code after the recordset? You aren't using them anywhere else in the file, so strip them out. If you are still having problems with the connection bugger off! No not really! [wink] I couldn't resist!

Rip out the code which is:

Code:
<%
 FileName=&quot;Connection_odbc_conn_dsn.htm&quot;
 Type=&quot;ADO&quot;
 HTTP=&quot;true&quot;
 Catalog=&quot;&quot;
 Schema=&quot;&quot;
var MM_connDirectory_STRING = &quot;dsn=Air-DB;&quot;
%>

and then tell me waht the problem is with your connection.

Oh and change the last few lines of the loop to

If col = 3 then col =1
rsPhone.movenext()
Wend

NOT:

If col = 3 then col =1
rsPhone.movenext()
End if
Wend

Good luck

Derren
[Mediocre talent - spread really thin]
 
WHOOOOOO!!!!!

It works! Now to just clean up and make it pretty.

Thanks a TON. I think I've voted you tipster of the week twice now.

Thanks again! Jennifer Sigman
Code-borrower extraordinaire
&quot;They call us public servants for a reason...&quot;
 
No problem Jennifer. Thanks for the star!

Don't forget to pretend that it was all your work - borrow code, borrow credit! Derren
[Mediocre talent - spread really thin]
 
Well deserved Derren.

Thanks for the interesting dialog, it'll no doubt help others out too.

M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top