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 July 17th, 2004, 09:51 AM
Authorized User
 
Join Date: Jul 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Populating memos in Access problem

Hi,

I am using the following piece of code to populate a DB from a form.

dim intCounter
For intCounter = 1 To Request.Form.Count
    Dim sFormElementName
    sFormElementName = Request.Form.key(intCounter)
    Dim sFormElementValue
    sFormElementValue = Server.HTMLEncode(Request.Form.item(sFormElementNa me))
    If sFormElementValue <> "" And sFormElementValue <> "No Answer" And sFormElementName <> "Submit" And sFormElementName <> "page" Then
        oRSallUsers(sFormElementName) = sFormElementValue
    End If
    oRSallUsers.Update
Next


For some reason it won’t populate fields in the DB of ‘memo’ type, but works just fine on all other data types. I’m using an Access DB. Any help would be much appreciated.

Thanks, Mischa


 
Old July 17th, 2004, 10:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you do a response.write of sFormElementValue and see if the memo field values get stored into this properly?

Code:
FOR...
...
response.write sFormElementValue & "<BR>"
...
Loop
Are you using a <textarea>in your form for getting the memo field value? Can you post that html code too?

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 18th, 2004, 08:05 AM
Authorized User
 
Join Date: Jul 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vijay,

I actually had a “Response.Write” like this in the code, but I removed as it wasn’t directly involved with the DB issue. It writes the value just fine, so the “memo fields” are being stored properly.


Sure, html code from form:

<form action="signUp.asp" method="post" name="signUpInfo" id="signUpInfo">
    â€¦.
<textarea name="DescribeYourSelf" cols="50" rows="4" id="DescribeYourSelf"></textarea>
….
</form>


Thanks, M


 
Old July 18th, 2004, 08:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Mischa,

Just noticed. You are using this code within your FOR loop. Anyways I don't think that would be the cause for not getting your memo field values in the DB.

oRSallUsers.Update

Can you move that outside the FOR loop? because this tries to update the DB for every field and hits the DB many times which can be done at the end after storing all the values in the recordset.

Also I believe you are just doing an update, as I don't see an ADDNEW() method there before the FOR loop.

Can you post some sample data that you are trying to update in the memo field. I would like to take a look at it if that could give us some clue.

Just a thought, why don't you construct an SQL statement for UPDATE and run that from you ASP page and see if that too fails to do the job?

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 19th, 2004, 02:02 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi
 access this link to have an idea of accessing memo fields

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=138



 
Old July 19th, 2004, 10:49 AM
Authorized User
 
Join Date: Jul 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Magically this started working again! I mean it – like magic. I ran it again with the field as ‘memo’ and it got correctly populated. Tried it a bunch more times: no problem. Maybe I was working too long yesterday – started to lose it.

Anyway, thanks, gents


 
Old July 19th, 2004, 09:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Mischa,

Glad, that it works. But wondering if there was any change made to get that worked.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating TreeView Control using Access Database dotnetDeveloper ADO.NET 0 November 18th, 2008 12:58 PM
problem in populating datasheet ...... sms Access 4 June 1st, 2008 03:47 AM
Problem populating DataGridView MacDevv C# 2005 0 May 6th, 2008 08:50 AM
using memos of ms-access b100dh0und Pro JSP 0 January 29th, 2006 10:30 AM
Problem with Populating ListView Brian_Leigh65 VB Databases Basics 3 August 2nd, 2004 08:19 AM





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