 |
|
 |
vbgen Level: Moderator
 Registered: 10-10-2002 Posts: 876
|
Re: Doing a post to a browser using VB
here's what i can give you for now...
i'm not so sure i got it with the first one...
but, if you want vb6 programming, and not vbscript, well i'd have to ask... what is the scenario? is it that you want your program to make your preconstructed html page viewable on the webbrowser control in a form? i'll probably wait for your post on this..
for the second, using vbscript to get db info i believe you want this viewed on a site, right?
if so, then you would need a recordset paging asp file, which i can provide for you:
<%@ LANGUAGE = "VBSCRIPT" %>
<% OPTION EXPLICIT %>
<html>
<head><TITLE>Recordset Paging</TITLE>
</head>
<body>
<div align="center">
<table width="600">
<tr>
<td width="450" valign="top"
<%
Dim databaseConnection, openDatabase
Set databaseConnection=Server.CreateObject("ADODB.Connection")
openDatabase="driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("database.mdb")
databaseConnection.Open openDatabase
Dim CurPage, records, RowCount, i, PageChoice
CurPage = Request.QueryString("page")
If CurPage = "" Then CurPage = 1
Set records = Server.CreateObject("ADODB.Recordset")
records.CursorType = 3
PageChoice = Request.QueryString("PageChoice")
If PageChoice = "" Then
records.PageSize = 5
Else
records.PageSize = PageChoice
End If
records.Open "SELECT field1, field2, field3 FROM fields", databaseConnection
records.AbsolutePage = CInt(CurPage)
RowCount = 0
%>
<table border = "1">
<tr>
<td>field1</td>
<td>field2</td>
<td>field3</td>
</tr>
<% WHILE NOT records.EOF and RowCount < records.PageSize %>
<tr>
<td><%= records("field1") %> </td>
<td><%= records("field2") %> </td>
<td><%= records("field3") %> </td>
</tr>
<%
RowCount = RowCount + 1
records.MoveNext
Wend
%>
</table>
<p>Jump to page:
<% For i = 1 to records.PageCount %>
<a href="paging.asp?page=<%=i%>&PageChoice=<% ageChoice%>"><%=i%></a>
<% Next %>
</p>
<form action="paging.asp?page=1" name="rows" method="get">
How many Records per Page? <select name="PageChoice">
<option value="5">5</option>
<option value="7">7</option>
<option value="10">10</option>
</select>
<input type="submit" value="Submit">
</form>
<%
records.Close
Set records = Nothing
databaseConnection.Close
Set databaseConnection = Nothing
%>
</td>
</tr>
</table>
</div>
</body>
</html> |
can you adapt to this code? i hope so.
this code was at this link:
http://www.andreavb.com/forum/viewtopic.php?TopicID=881
okidokie? post back, ayt? and don't worry, isn't happening... yet.
____________________________
Been busy trying to take a second degree <--it's not working out...
|
|
31-01-2003 at 08:22 PM |
|
|
|
|
 |
 |