Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2004, 12:01 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with DreamweaverMX and Stored Procedure input

I'm deep in a project and need help asap with Dreamweaver MX inability to handle input parameters in a Stored Procedure (MSSQL2000).
Here's the start of the SP:
CREATE PROCEDURE dbo.PageBookCheck(
     @Title varchar(75),
     @Comments varchar(75),
     @FiledDate datetime,
     @PageCount int,
     @MapType int,
     @CreateDate datetime)
 AS

When I run the ASP page with the command object behavior, I get the same error message on all paramaters except the two text ones OR it will run just fine for a few times then error out. It's a bug or poorly designed software I'm convinced. Macromedia says to fiddle with converting the data types. I've tried that. Surely you know a better way. How do I use the DMX command object with these input paramaters so the asp page will run? Help. Thanks in advance for a prompt response.

 
Old October 7th, 2004, 01:27 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post the relevant ASP code?

Dreamweaver is not involved at run-time, so the problem must occur somewhere in the ASP code that Dreamweaver has created for you.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 7th, 2004, 03:48 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 Hi Imar,
Here is the main asp code for the Stored Procedure and user input form. I thank you so much for helping. If you need more info, please don't hesitate to ask.
Regards,
Charlie

%>

<%

set spMapType = Server.CreateObject("ADODB.Command")
spMapType.ActiveConnection = MM_MapCon_STRING
spMapType.CommandText = "dbo.MapType"
spMapType.CommandType = 4
spMapType.CommandTimeout = 0
spMapType.Prepared = true
spMapType.Parameters.Append spMapType.CreateParameter("@RETURN_VALUE", 3, 4)
set TT = spMapType.Execute
TT_numRows = 0

%>
<%

Dim spCheckBookPage__Title
spCheckBookPage__Title = ""
if(Request("Title") <> "") then spCheckBookPage__Title = Request("Title")

Dim spCheckBookPage__Comments
spCheckBookPage__Comments = ""
if(Request("Comments") <> "") then spCheckBookPage__Comments = Request("Comments")

Dim spCheckBookPage__FiledDate
spCheckBookPage__FiledDate = ""
if(Request("FiledDate") <> "") then spCheckBookPage__FiledDate = Request("FiledDate")

Dim spCheckBookPage__PageCount
spCheckBookPage__PageCount = ""
if(Request("PageCount") <> "") then spCheckBookPage__PageCount = Request("PageCount")

Dim spCheckBookPage__MapType
spCheckBookPage__MapType = ""
if(Request("MapType") <> "") then spCheckBookPage__MapType = Request("MapType")

Dim spCheckBookPage__CreateDate
spCheckBookPage__CreateDate = ""
if(Request("CreateDate") <> "") then spCheckBookPage__CreateDate = Request("CreateDate")

%>

<%

set spCheckBookPage = Server.CreateObject("ADODB.Command")
spCheckBookPage.ActiveConnection = MM_MapCon_STRING
spCheckBookPage.CommandText = "dbo.PageBookCheck"
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@RETURN_VALUE", 3, 4)
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@Title", 200, 1,75,spCheckBookPage__Title)
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@Comments", 200, 1,75,spCheckBookPage__Comments)
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@FiledDate", 135, 1,8,spCheckBookPage__FiledDate)
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@PageCount", 3, 1,4,spCheckBookPage__PageCount)
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@MapType", 3, 1,4,spCheckBookPage__MapType)
spCheckBookPage.Parameters.Append spCheckBookPage.CreateParameter("@CreateDate", 135, 1,8,spCheckBookPage__CreateDate)
spCheckBookPage.CommandType = 4
spCheckBookPage.CommandTimeout = 0
spCheckBookPage.Prepared = true
spCheckBookPage.Execute()

%>

HERE IS THE FORM

<form name="AddMapForm" id="AddMapForm">
<table width="559" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#EAE9E1">
  <tr>
    <td height="24" colspan="4" bgcolor="#666666"><b>1.
          Add Map Title </b></td>
  </tr>
  <tr>
    <td height="32" colspan="5" nowrap>&nbsp;<b>Title/Name:</b>
        <input name="Title" type="text" id="Title" size="75" maxlength="75">
    </td>
  </tr>
  <tr>
    <td height="32" colspan="5" nowrap bgcolor="#FFFFFF">&nbsp;&nbsp;<b>Comments:</b>
        <input name="Comments" type="text" id="Comments" size="75" maxlength="75">
    </td>
  </tr>
  <tr>
    <td colspan="5" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;<b>File Date:</b>
        <input name="FiledDate" type="text" id="f_date_b" value="" size="10" maxlength="10">&nbsp;<img src="../Images/img.gif" width="20" height="14" align="absmiddle" id="f_trigger_b" style="cursor: pointer; border: 1px solid red;" title="Date selector"
      onMouseOver="this.style.background='red';" onMouseOut="this.style.background=''">&nbsp;&nbsp; &nbsp;&nbsp;

        <b>Map Type:</b> &nbsp;
        <select name="MapType">
          <option value="">Select Type</option>
          <%
While (NOT TT.EOF)
%>
          <option value="<%=(TT.Fields.Item("TT").Value)%>"><%=(TT.F ields.Item("MT").Value)%></option>
          <%
  TT.MoveNext()
Wend
If (TT.CursorType > 0) Then
  TT.MoveFirst
Else
  TT.Requery
End If
%>
        </select>&nbsp;&nbsp;&nbsp;


        <b>Total Pages:
        <input name="PageCount" type="text" id="PageCount" size="2" maxlength="2">
        </b></td>
  </tr>
  <tr>
    <td width="113" nowrap bgcolor="#FFFFFF">&nbsp;</td>
    <td width="89" nowrap bgcolor="#FFFFFF">&nbsp;</td>
    <td width="136" nowrap bgcolor="#FFFFFF">&nbsp;</td>
    <td width="205" align="left" nowrap bgcolor="#FFFFFF">
      <input type="submit" name="Submit" value="Add Map Title">
&nbsp;&nbsp;
 <input type="reset" name="Reset" value="Reset">
<input type="hidden" name="CreateDate" value="<%=Now()%>">

  </tr>
</table>
</form>
<br>
</body>
</html>

 
Old October 8th, 2004, 01:49 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Does this page submit back to itself? If so, how come there is no protection to prevent the update from executing when the page loads first??

I can't find anything odd in your page. The Command object code looks fine; the numbers in the AddParameter method map to the appropriate parameter types in the sproc. So, the only thing I can think of is a mismatch of the data. You may be trying to pass empty values (when the page first loads) or incorrect formats, like an incorrect date format.

You mentioned an error in your previous post. What message do you get?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameterised Input stored procedure fdtoo SQL Server 2000 0 November 7th, 2007 07:11 AM
stored procedure keyvanjan Classic ASP Basics 6 August 1st, 2006 07:42 AM
Help About Stored Procedure zhuge6 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 May 20th, 2005 09:27 AM
stored proc input parameter ttbhandari SQL Server ASP 2 October 14th, 2004 02:47 PM
HELP! Create login with DreamweaverMX/Access 2002 aepling Access ASP 1 January 30th, 2004 12:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.