Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<!-- #include file="adovbs.inc" -->
<!-- #include file="connect.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<%
' open a recordset, select the field in database table
strSQL="SELECT theFieldWanted FROM yourTable;"
objRS.Open strSQL, objConn
' assign a variable (can be any name) to the record value
theFieldWanted = objRS("theFieldWanted")
' Loop through recordset to get all field values if more
' than 1 and write the result to the screen
If objRS.EOF Then
Response.Write "Sorry, no data"
Else
Do While Not objRS.EOF
Response.Write theFieldWanted & "<br>"
objRS.MoveNext
Loop
End If
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</body>
</html>
<%
dim dbpath, dbfile, connstr, conn, rs, SQL, tmpstr
dbpath="_database/" 'dbpath="" is valid if db is in rootdir
dbfile="mydbfile.mdb" 'access filename
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath(""&dbpath&dbfile&"")&";"
SQL="SELECT field1, field2, field3 FROM tablename WHERE field1='"& some_identifying_value &"'"
set conn = server.createobject("adodb.connection")
conn.open connstr
set rs = server.createobject("adodb.recordset")
rs.open SQL, conn, 3, 3
if not rs.eof then
for each field in rs.fields
tmpstr=field.name&"=rs.fields("""&field.name&""")"
execute(tmpstr)
'for testing purposes
'tmpstr="response.write("""&field.name&"=""&field.name&""<br>"")"
'execute(tmpstr)
next
end if
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
'[red]objConn[/red] is your connection object
strEmail = ""
strSQL = "SELECT email from myTable"
Set objRS = [red]objConn[/red].Execute(strSQL)
If NOT objRS.EOF Then
While NOT objRS.EOF
If strEmail = "" Then
strEmail = objRS("email")
Else
strEmail = strEmail & ";" & objRS("email")
End If
objRS.MoveNext
Wend
End If
Set objRS = Nothing
objCDO.Bcc = strEmail