Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2004, 03:25 AM
Registered User
Join Date: Feb 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Modifying long text in a long field

Hi All

I am developing a website using asp and access. I have some pages in which user can type very long text in a textarea and submit it. The long text is saved in a memo field. When text is small (e.g. 1000 characters), it is saved (as well modified) successfully. But when I try to submit very long data (e.g. 4000 characters), it generates following error:

[Microsoft][ODBC Microsoft Access Driver] Could not save; currently locked by user 'admin' on machine 'ABC'.

and the error number is 2147467259.

My code is:

ProductID = request("Product ID")


mySQl= "select * from Product where idProduct='"&ProductID&"'"
call getfromdatabase(mySQL, rsModifyProduct ,"EditProduct")

rsModifyProduct("DetailedDescription"=DetailDesc 'Memo Field


Database Manupulation Functions

sub openDb()
if varType(connTemp)=0 or varType(connTemp)=1 then

  ' create the connection
  set connTemp = server.createObject("adodb.connection")

  connTemp.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Projects\MyProject\Database\MyProject.md b;"

end if
end sub

sub getFromDatabase(mySQL, rstemp, scriptName)

  call openDb()

  set rstemp = server.createObject("adodb.recordset")

  rstemp.open mySQL,connTemp,3,2

end sub

sub updateDatabase(mySQL, rstemp, scriptName)

call openDb()

set rstemp=connTemp.execute(mySQL)

end sub
Reply With Quote
  #2 (permalink)  
Old February 20th, 2004, 12:36 PM
Friend of Wrox
Join Date: Sep 2003
Location: Minneapolis, MN, USA.
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post

Try this...

ProductId = request("ProductId")
Category = request("Category")

cn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=F:\Projects\MyProject\Database\MyProject.md b;"

set rs = server.createobject("adodb.recordset")
sql = "select * from Product where idProduct = '" & ProductId & "'"
rs.open sql, cn, 3, 3
if rs.eof then
end if
    rs("Description") = Desc
    rs("Category") = Category
    rs("ShortDetails") = ShortDesc
    rs("DetailedDescription") = DetailDesc

This code will add the ProductId if it doesn't exist and modify it if it does. This is also provided that your ProductId is an alpha-numeric value rather than a number. If your ProductId is a number then you must not have it enclosed within apostrophes. Forget the function 'getfromdatabase()'. Make sure your memo field is last in the update. Not sure if it matters with an update, but it does matter when you include memo fields within your criteria so it might apply here too. Let me know if this helps.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
long text field SKhna SQL Language 1 June 6th, 2008 12:43 PM
Long Long int to bin walid C# 0 January 23rd, 2007 12:47 PM
Reading field of 'Long' datatype from binary file peri C# 0 January 2nd, 2005 08:50 AM
string to "long long" without using atoll sarraju C++ Programming 2 August 4th, 2004 07:19 AM
Long text irfan4 ASP.NET 1.0 and 1.1 Basics 1 July 27th, 2004 09:30 AM

All times are GMT -4. The time now is 10:46 AM.

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