Wrox Programmer Forums
|
Classic ASP Databases 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.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 January 18th, 2005, 07:35 PM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default I think I've gone cross-eyes!

I've created a website that allows a person to register and add/edit a property on my web-site. Everything works fine on my local machine but when I put it on the web it stops at AddListing.asp. I have included a link the the login file. Please feel free to register with what ever test information you would like on this site. It does not include any factual data.

http://www.viewatour.com/LoginMain.asp

Everything else seems to work correctly up until you Add a Property or attempt to edit one.

I've also included the background asp files.

I'm sure it's something simple but I can't seem to figure it out. I would be very greatful if someone would take a look at it.

[u]clssfd.asp</u>



<%
  Dim objConn
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
                 "Data Source=d:\webs\viewat\data\Viewatour.mdb"

  If Session("blnValidUser") = True and Session("ContactID") = "" Then
    Dim rsContactIDCheck
    Set rsContactIDCheck = Server.CreateObject("ADODB.Recordset")
    Dim strSQL
    strSQL = "SELECT ContactID FROM ContactInfo " & _
             "WHERE Email = '" & Session("Email") & "';"
    rsContactIDCheck.Open strSQL, objConn
    If rsContactIDCheck.EOF Then
      Session("blnValidUser") = False
    Else
      Session("ContactID") = rsContactIDCheck("ContactID")
    End If
    rsContactIDCheck.Close
    set rsContactIDCheck = Nothing
  End If
%>


[u]AddListing.asp</u>




<%
  Dim rsItem
  Dim blnNew
  Set rsItem = Server.CreateObject("ADODB.Recordset")
  rsItem.Open "PropertyInfo", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
  If Request("PropertyID") = "" Then
    blnNew = True
    rsItem.AddNew
  Else
    rsItem.Filter = "PropertyID = " & Request("PropertyID")
    blnNew = False
  End If
  rsItem("Status") = Request.Form("Status")
  rsItem("MLSNo") = Request.Form("MLSNo")
  rsItem("ListAmount") = Request.Form("ListAmount")
  rsItem("PropType") = Request.Form("PropType")
  rsItem("ListingType") = Request.Form("ListingType")
  rsItem("StreetAddress") = Request.Form("StreetAddress")
  rsItem("UnitNumber") = Request.Form("UnitNumber")
  rsItem("Floor") = Request.Form("Floor")
  rsItem("City") = Request.Form("City")
  rsItem("State") = Request.Form("State")
  rsItem("Zip") = Request.Form("Zip")
  rsItem("SubDivision") = Request.Form("SubDivision")
  rsItem("Directions") = Request.Form("Directions")
  rsItem("Bedrooms") = Request.Form("Bedrooms")
  rsItem("Baths") = Request.Form("Baths")
  rsItem("HalfBaths") = Request.Form("HalfBaths")
  rsItem("SqFoot") = Request.Form("SqFoot")
  rsItem("Pool") = Request.Form("Pool")
  rsItem("PropertyName") = Request.Form("PropertyName")
  rsItem("Description") = Request.Form("Description")
  rsItem("ContactID") = Session("ContactID")
  If blnNew = True Then
    rsItem("OrderDate") = Now
  Else
    rsItem("LastEdit") = Now
  End If
  rsItem.Update

  rsItem.Close
  Set rsItem = Nothing

  If blnNew = True Then
    Response.Redirect "OrderRcvd.asp"
  Else
    Response.Redirect "ViewMyListings.asp"
  End If
%>

 
Old January 18th, 2005, 08:30 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check if you have write permissions for writing in to MDB file.

Om Prakash
 
Old January 18th, 2005, 09:28 PM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes. This can be checked by registering. Which creates a new record. The problem occurs only with this instance. All other edit/update/add programs work correctly.

Thanks for the suggestion.

 
Old January 20th, 2005, 10:11 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Can you try changing cursor type at the time of adding?
do you get any error message after submitting the data..?


Om Prakash
 
Old January 22nd, 2005, 10:12 AM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Curser type? Please explain.

I don't get any errors until you click the submit button on this page only.

 
Old January 24th, 2005, 05:40 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

By Cursor type i mean "adOpenForwardOnly"

Modify the query as:

Set rsItem = Server.CreateObject("ADODB.Recordset")
  rsItem.Open "select * from PropertyInfo", objConn, adOpenDynamic, adLockOptimistic


Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
cross tab help drachx SQL Server 2000 3 October 24th, 2005 03:26 PM
help with cross tab kondapally Crystal Reports 0 August 25th, 2005 09:11 AM
Cross Tab ? abdusalam Crystal Reports 2 July 25th, 2004 11:44 PM
Cross Platform Help morpheus Classic ASP Basics 2 January 28th, 2004 11:02 AM





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