Click to See Complete Forum and Search --> : Connection Problem and viewing asp page


gmag47
08-18-2005, 08:53 AM
I have been at this for several days now and I still can't get connected to a Access Database, nor view my web page in asp can someone look at my code and tell me where the errors are

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/HCMAP1.asp" -->
<%
Dim QtrlyRptRegs
Dim QtrlyRptRegs_numRows

Set QtrlyRptRegs = Server.CreateObject("ADODB.Recordset")
QtrlyRptRegs.ActiveConnection = MM_HCMAP1_STRING
QtrlyRptRegs.Source = "SELECT * FROM [Qtrly RPt Regs]"
QtrlyRptRegs.CursorType = 0
QtrlyRptRegs.CursorLocation = 2
QtrlyRptRegs.LockType = 1
QtrlyRptRegs.Open()

QtrlyRptRegs_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
' Automatic DataConnection
<%
ScriptName = Request.ServerVariables("SCRIPT_NAME")
tmpScriptName = Mid(ScriptName,2)
intPos = Instr(tmpScriptName,"/")
VirtualDir = Left(tmpScriptName, intPos - 1)
AbsolutePath = Server.MapPath ("/" & VirtualDir)
DBQValue = "DBQ=" & AbsolutePath & "\Qtrly Rpt.mdb"
' the string below is a duplicate string from the DSN file.
Session("DataConn_ConnectionString") = _
"DRIVER=Microsoft Access Driver (HCMAP1.mdb);" & _
"UID=admin;" & _
"UserCommitSync=Yes;" & _
"Threads=3;" & _
"SafeTransactions=0;" & _
"PageTimeout=5;" & _
"MaxScanRows=8;" & _
"MaxBufferSize=512;" & _
"ImplicitCommitSync=Yes;" & _
"FIL=MS Access;" & _
"DriverId=25;" & _
"DefaultDir=;" & _
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Quarterly Reporting Regisitration Form</title>
<style type="text/css">
<!--
.style2 {
font-size: small;
font-weight: bold;
}
.style3 {font-size: small}
-->
</style>
</head>

<body background="Images/3.jpg">
<form name="form1" method="post" action=" ">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
</tr>
</table>


<form action="Qtrly Rpt.mdb" method="post" enctype="multipart/form-data" name="Qtrly Rpt" id="Qtrly Rpt">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<th width="29%" scope="col"><div align="left" class="style2">DEUIDNO</div></th>
<th width="16%" scope="col">&nbsp;</th>
<th width="11%" scope="col"><input type="text" name="Textfield"></th>
<th width="44%" scope="col">&nbsp;</th>
</tr>
<tr>
<th scope="row"><div align="left" class="style3">Name and location of Examining
Office </div></th>
<td>&nbsp;</td>
<td><input name="Textfield" type="text" ></td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">Contact person preparing
report </span></div></th>
<td>&nbsp;</td>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><span class="style2">Phone Number </span></td>
<td>&nbsp;</td>
<td><input name="Textfield" type="text"></td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><strong>Email address </strong></td>
<td>&nbsp;</td>
<td><input name="Textfield" type="text"></td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">FY</span></div></th>
<td><strong>
<input name="radiobutton" type="radio" value="radiobutton">
04&nbsp;
<input name="radiobutton" type="radio" value="radiobutton">
05</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="radiobutton" type="radio" value="radiobutton">
<strong> 06&nbsp;
<input name="radiobutton" type="radio" value="radiobutton">
07</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">Quarter</span></div></th>
<td><input name="radiobutton" type="radio" value="radiobutton">
<strong>01</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="radiobutton" type="radio" value="radiobutton"> <strong> 02</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="radiobutton" type="radio" value="radiobutton"> <strong>03</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><strong>
<input name="radiobutton" type="radio" value="radiobutton">
04</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">1 Number of applicants
processed </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left" class="style3">2 Number of Selections
made </div></th>
<td><input name="TextField" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3"> 3 Number of preference
eligibles selected </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">4 Number of certificates
issued </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">5 Number of certificates
audited </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">6 Number of audited
certificates which had preference eligibles<strong> NOT</strong> at the
top of thelist </span></div></th>
<td><input type="text" name="Textfield"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">7 Number of certificates
Used </span></div></th>
<td><input type="text" name="Textfield"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">8 Number of Certificates
not used </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">9 Number of certificates
unused because of CTAO/ICTAP </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>




<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="Submit" type="SUBMIT" id="Submit" value="SUBMIT" ></td>
<td><input name="Reset" type="reset" id="Reset" value="Reset"></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
' DBQValue is generated on the fly
DBQValue

' End of Automatic DataConnection

<%
DBQValue = "DBQ=" & AbsolutePath & "\DataBase\QtrlyRpt.mdb"
%>
<p>&nbsp;</p>
</body>
</html>
<%
QtrlyRptRegs.Close()
Set QtrlyRptRegs = Nothing
%>

minority
08-18-2005, 10:26 AM
Can you show us the HCMAP1.asp file and the error you getting or we are walkin in the dark

Also if on your home machine have you got IIS enabled. if you on a hosted site are you sure you can get asp......sorry if they dumb questions but you said couldnt see it but you were very very basic in your description.

gmag47
08-18-2005, 10:58 AM
I'm sorry it should be:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/HCMAP1.mdb" -->
<%
Dim QtrlyRptRegs
Dim QtrlyRptRegs_numRows

Set QtrlyRptRegs = Server.CreateObject("ADODB.Recordset")
QtrlyRptRegs.ActiveConnection = MM_HCMAP1_STRING
QtrlyRptRegs.Source = "SELECT * FROM [Qtrly RPt Regs]"
QtrlyRptRegs.CursorType = 0
QtrlyRptRegs.CursorLocation = 2
QtrlyRptRegs.LockType = 1
QtrlyRptRegs.Open()

QtrlyRptRegs_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
' Automatic DataConnection
<%
ScriptName = Request.ServerVariables("SCRIPT_NAME")
tmpScriptName = Mid(ScriptName,2)
intPos = Instr(tmpScriptName,"/")
VirtualDir = Left(tmpScriptName, intPos - 1)
AbsolutePath = Server.MapPath ("/" & VirtualDir)
DBQValue = "DBQ=" & AbsolutePath & "\Qtrly Rpt.mdb"
' the string below is a duplicate string from the DSN file.
Session("DataConn_ConnectionString") = _
"DRIVER=Microsoft Access Driver (HCMAP1.mdb);" & _
"UID=admin;" & _
"UserCommitSync=Yes;" & _
"Threads=3;" & _
"SafeTransactions=0;" & _
"PageTimeout=5;" & _
"MaxScanRows=8;" & _
"MaxBufferSize=512;" & _
"ImplicitCommitSync=Yes;" & _
"FIL=MS Access;" & _
"DriverId=25;" & _
"DefaultDir=;" & _
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Quarterly Reporting Regisitration Form</title>
<style type="text/css">
<!--
.style2 {
font-size: small;
font-weight: bold;
}
.style3 {font-size: small}
-->
</style>
</head>

<body background="Images/3.jpg">
<form name="form1" method="post" action=" ">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
</tr>
</table>


<form action="Qtrly Rpt.mdb" method="post" enctype="multipart/form-data" name="Qtrly Rpt" id="Qtrly Rpt">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<th width="29%" scope="col"><div align="left" class="style2">DEUIDNO</div></th>
<th width="16%" scope="col">&nbsp;</th>
<th width="11%" scope="col"><input type="text" name="Textfield"></th>
<th width="44%" scope="col">&nbsp;</th>
</tr>
<tr>
<th scope="row"><div align="left" class="style3">Name and location of Examining
Office </div></th>
<td>&nbsp;</td>
<td><input name="Textfield" type="text" ></td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">Contact person preparing
report </span></div></th>
<td>&nbsp;</td>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><span class="style2">Phone Number </span></td>
<td>&nbsp;</td>
<td><input name="Textfield" type="text"></td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><strong>Email address </strong></td>
<td>&nbsp;</td>
<td><input name="Textfield" type="text"></td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">FY</span></div></th>
<td><strong>
<input name="radiobutton" type="radio" value="radiobutton">
04&nbsp;
<input name="radiobutton" type="radio" value="radiobutton">
05</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="radiobutton" type="radio" value="radiobutton">
<strong> 06&nbsp;
<input name="radiobutton" type="radio" value="radiobutton">
07</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">Quarter</span></div></th>
<td><input name="radiobutton" type="radio" value="radiobutton">
<strong>01</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="radiobutton" type="radio" value="radiobutton"> <strong> 02</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="radiobutton" type="radio" value="radiobutton"> <strong>03</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><strong>
<input name="radiobutton" type="radio" value="radiobutton">
04</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">1 Number of applicants
processed </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left" class="style3">2 Number of Selections
made </div></th>
<td><input name="TextField" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3"> 3 Number of preference
eligibles selected </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">4 Number of certificates
issued </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">5 Number of certificates
audited </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">6 Number of audited
certificates which had preference eligibles<strong> NOT</strong> at the
top of thelist </span></div></th>
<td><input type="text" name="Textfield"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">7 Number of certificates
Used </span></div></th>
<td><input type="text" name="Textfield"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">8 Number of Certificates
not used </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row"><div align="left"><span class="style3">9 Number of certificates
unused because of CTAO/ICTAP </span></div></th>
<td><input name="Textfield" type="text"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>




<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><input name="Submit" type="SUBMIT" id="Submit" value="SUBMIT" ></td>
<td><input name="Reset" type="reset" id="Reset" value="Reset"></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
' DBQValue is generated on the fly
DBQValue

' End of Automatic DataConnection

<%
DBQValue = "DBQ=" & AbsolutePath & "\DataBase\QtrlyRpt.mdb"
%>
<p>&nbsp;</p>
</body>
</html>
<%
QtrlyRptRegs.Close()
Set QtrlyRptRegs = Nothing
%>
Also I went into the property of IIS and set asp as the default to view, I have a production server as well and still can't view the page.

gmag47
08-18-2005, 11:06 AM
here is the HCMAP!.asp:

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_HCMAP1_STRING
MM_HCMAP1_STRING = "dsn=HCMAP1;"
%>

minority
08-19-2005, 02:22 AM
why not go for a connectionless it is typically faster and alot easier to set up.

set strCon = server.CreateObject ("ADODB.Connection")
Conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Intranet\ncr\database\ncr.mdb;User Id=admin;Password=;"
strCon.open Conn

set strrec = Server.CreateObject("ADODB.Recordset")
strsql = "select * FROM table"

strrec.open strsql, strrec
'all the database action for the table table happens in here.
strrec.close