<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - Classic ASP Databases</title>
		<link>http://p2p.wrox.com</link>
		<description>Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 09:32:43 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - Classic ASP Databases</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>Retrieve error desription for SQL Stored Procedure</title>
			<link>http://p2p.wrox.com/classic-asp-databases/77022-retrieve-error-desription-sql-stored-procedure.html</link>
			<pubDate>Fri, 13 Nov 2009 19:16:45 GMT</pubDate>
			<description>is it possible to retrieve an error message from sql server stored prodedure and read it in my asp code? 
 
for example, if i try to enter a dup key,...</description>
			<content:encoded><![CDATA[<div>is it possible to retrieve an error message from sql server stored prodedure and read it in my asp code? <br />
 <br />
for example, if i try to enter a dup key, can i pass the following stock SQL error message to asp from sql:<br />
 <br />
Server: Msg 547, Level 16, State 1, Procedure procReenrollmentContractHistoryAddUpdate, Line 50<br />
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_reenrollmentContractHistory_reenrollmentContra  ctTypeMaster'. The conflict occurred in database 'cmProd', table 'reenrollmentContractTypeMaster', column 'contractType'.<br />
The statement has been terminated.<br />
 <br />
If i am executing one insert statement in my stored procedure and there's a problem, my asp WILL get this error message. However, i'm having a problem when I execute a select statement (which runs fine) and then execute an update statement which fails with a dup key. For some reason, my asp does not get the dup key message (probably b/c the select statement completed successfully).<br />
 <br />
See below. this is the code i'm having trouble with: (note that when i run it as is and force a dup key error, my asp shows no error.  however when i comment out the exec procUpdateGetVariousNumbers2 statement, I DO receive a sql error in asp),<br />
 <br />
BEGIN TRANSACTION<br />
set @logStatus = 'ADD'<br />
exec procUpdateGetVariousNumbers2 'reenrollmentContractHistoryID', @logUser, @reenrollmentContractHistoryRecID output <br />
 <br />
insert reenrollmentContractHistory<br />
select <br />
@reenrollmentContractHistoryRecID,<br />
@contractType, <br />
@academicYear, <br />
null, --paymentOption, <br />
null, --tuitionRefundPlanYN, <br />
null, --lunchPlanOption, <br />
null, --tuitionAmount, <br />
null, --tuitionDepositAmount, <br />
null, --faAwardAmount, <br />
null, --faScholarshipName, <br />
null, --faScholarshipAmount, <br />
null, --faDepositAmount, <br />
null, --lunchAmount, <br />
@contractText, <br />
null, --@cshAdminUpdateName, <br />
null, --@cshAdminUpdateDateTime, <br />
null, --@cshAdminUpdateExplanation, <br />
null, --@cshAdminApprovaleSignature, <br />
null, --@cshAdminApprovaleSignatureDateTime, <br />
parentID, <br />
PrimaryAddressee, <br />
PrimarySalutation, <br />
NamePrefix, <br />
FirstName, <br />
MiddleName, <br />
LastName, <br />
NameSuffix, <br />
reenrollmentStudentGrade, <br />
reenrollmentStudentReenrollmentStatus, <br />
reenrollmentStudentType, <br />
constituentStatus, <br />
@logUser, <br />
@logDateTime, <br />
@logStatus</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-databases-62/">Classic ASP Databases</category>
			<dc:creator>srotondo</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-databases/77022-retrieve-error-desription-sql-stored-procedure.html</guid>
		</item>
		<item>
			<title>Error In ASP Code</title>
			<link>http://p2p.wrox.com/classic-asp-databases/77021-error-asp-code.html</link>
			<pubDate>Fri, 13 Nov 2009 16:47:15 GMT</pubDate>
			<description><![CDATA[<!-- #include file="Connectionstring.asp" -->
<%

' variables
dim dcnDB       'Connection String
dim rsQuery     'Record Set 
dim FacultyID  ...]]></description>
			<content:encoded><![CDATA[<div>&lt;!-- #include file=&quot;Connectionstring.asp&quot; --&gt;<br />
&lt;%<br />
<br />
' variables<br />
dim dcnDB       'Connection String<br />
dim rsQuery     'Record Set <br />
dim FacultyID   'Faculty Id For Faculty Members<br />
dim Password    'Password For Faculty Members<br />
dim Department  'Department Of The Faculty Members<br />
dim FullName    'Name of The Faculty Members<br />
<br />
<br />
<br />
'store form input into variables<br />
FacultyID = Request.Form(&quot;FacultyID&quot;)<br />
Password = Request.Form(&quot;Password&quot;)<br />
Department=Request.Form(&quot;Department&quot;)<br />
FullName=Request.Form(&quot;FullName&quot;)<br />
<br />
' Code To Handle Error Code <br />
<br />
<br />
' execute sql and open as recordset<br />
<br />
Set dcnDB = Server.CreateObject(&quot;ADODB.Connection&quot;)<br />
<br />
dcnDB.ConnectionString = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; server.MapPath (&quot;DATABASE\Database.mdb&quot;)<br />
dcnDB.Open<br />
<br />
Set rsQuery = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br />
<br />
rsQuery.open &quot;SELECT * FROM FacultyRecord&quot;,_<br />
 dcnDB,3,3<br />
			<br />
'Check if facultyid doesn't already exist<br />
	do while not rsQuery.EOF<br />
		if rsQuery(&quot;FacultyID&quot;)=FacultyID then<br />
			set rsQuery=nothing<br />
			set dcnDB=nothing<br />
			Response.Redirect(&quot;create.asp&quot;)<br />
		end if<br />
		rsQuery.MoveNext<br />
	loop  <br />
' Opens the returned values from the SQL as a recordset, ready for iteration by ASP<br />
'set rcSet = cnStr.Execute(sqlStr)<br />
<br />
rsQuery.Addnew<br />
<br />
rsQuery (&quot;FacultyID&quot;)= Request.Form(&quot;FacultyID&quot;)<br />
rsQuery (&quot;Password&quot;)= Request.Form(&quot;Password&quot;)<br />
rsQuery (&quot;Department&quot;)= Request.Form(&quot;Department&quot;)<br />
rsQuery (&quot;FullName&quot;)= Request.Form(&quot;FullName&quot;)<br />
<br />
rsQuery.Update<br />
<br />
<br />
' validate variables against database<br />
If (not  rsQuery.BOF) and (not rsQuery.EOF) then<br />
<br />
Response.cookies(&quot;FacultyID&quot;) = FacultyID<br />
Response.cookies(&quot;FullName&quot;) = FullName<br />
<br />
<br />
Response.write(&quot;&lt;font size='5'&gt;WELCOME&lt;/font&gt; &quot;)<br />
response.write(&quot;&amp;nbsp;&quot;)<br />
Response.write(&quot;&lt;font size='5'&gt;&quot;)<br />
response.write  rsQuery.fields(&quot;FullName&quot;) &amp; &quot;&amp;nbsp;&quot;<br />
response.write(&quot;&lt;br/&gt;&quot;)<br />
<br />
response.write(&quot;FacultyID&quot;)<br />
response.write(&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;:&amp;nbsp;&quot;)<br />
response.write  rsQuery.fields(&quot;FacultyID&quot;) &amp; &quot;&lt;br/&gt;&quot;<br />
<br />
response.write(&quot;Department&quot;)<br />
<br />
response.write(&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbs  p;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;:&amp;nbsp;&quot;)<br />
response.write  rsQuery.fields(&quot;Department&quot;) &amp; &quot;&lt;br/&gt;&quot;<br />
<br />
else<br />
response.write &quot;Incorrect FacultyID and/or Department and/or FullName&quot;<br />
end if<br />
<br />
rsQuery .close<br />
dcnDB.close<br />
%&gt;                     <br />
<br />
In the code above I have got the follwing error<br />
<br />
Microsoft JET Database Engine (0x80040E09)<br />
Cannot update. Database or object is read-only.<br />
/szone/welcome.asp, line 236</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-databases-62/">Classic ASP Databases</category>
			<dc:creator>DeepakAryan</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-databases/77021-error-asp-code.html</guid>
		</item>
		<item>
			<title>Search String?</title>
			<link>http://p2p.wrox.com/classic-asp-databases/76731-search-string.html</link>
			<pubDate>Fri, 23 Oct 2009 16:42:28 GMT</pubDate>
			<description><![CDATA[Hello,
I need a complete script or function for search into string,
I have a query for oracle suppose 
RecordSet_Object= "Select Col1,Col2 From...]]></description>
			<content:encoded><![CDATA[<div><font face="Comic Sans MS"><font color="blue">Hello,</font></font><br />
<font face="Comic Sans MS"><font color="#0000ff">I need a complete script or function for search into string,</font></font><br />
<font face="Comic Sans MS"><font color="#0000ff">I have a query for oracle suppose </font></font><br />
<font face="Comic Sans MS"><font color="#0000ff">RecordSet_Object= &quot;Select Col1,Col2 From Schema.ViewName &quot;</font></font><br />
<font face="Comic Sans MS"><font color="#0000ff">Now i want a function to pass value/parameter which extract direct ViewName/TableName from Query</font></font><br />
 <br />
<font face="Comic Sans MS"><font color="#0000ff">Thanks</font></font></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-databases-62/">Classic ASP Databases</category>
			<dc:creator>S Shirani</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-databases/76731-search-string.html</guid>
		</item>
	</channel>
</rss>
