A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using sql insert with memo field truncates text data



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2004, 02:01 AM
Graham Meredith
external usenet poster
 
Posts: n/a
Default Using sql insert with memo field truncates text data

I'm using ASP to write a load of entries to an Access 2000 db
One of the fields, a memo field, however is getting truncated data - the
description field in the code below.
The description field is always truncated to about 300 chars
The string data in this array varies from nothing to a few thousand
characters and doesn't contain any carriage returns - just text and the odd
html tag

Anyone any ideas? I've seen alot of probs with querying memo fields and
returning truncated values but not while writing them..

Set oDB = Server.CreateObject("ADODB.Connection")
oDB.Open "DSN=ImageLib;UID=;pwd=;"

For n = 1 to numPhotos

SQL = "INSERT INTO PHOTOS (ID,Filename,SeriesID,SectionID,Description)
VALUES ("
SQL = SQL + Trim(CStr( n )) + ", '"
SQL = SQL + photoPAK_Filename(n) + "', "
SQL = SQL + Trim(CStr( photoPAK_SeriesID(n) )) + ", "
SQL = SQL + Trim(CStr( photoPAK_SectionID(n) )) + ", '"
SQL = SQL + photoPAK_Desc(n) + "')"

oDB.Execute SQL
----






  #2  
Old September 1st, 2004, 03:11 AM
GVaught
external usenet poster
 
Posts: n/a
Default

I would use & rather than + in your SQL statements. Ensure you are using
POST rather than GET to send your data to the database. GET string size is
much smaller than POST statements. Search on Google for inserting BLOB data
into an Access database.
--
G Vaught

"Graham Meredith" wrote in message
...
I'm using ASP to write a load of entries to an Access 2000 db
One of the fields, a memo field, however is getting truncated data - the
description field in the code below.
The description field is always truncated to about 300 chars
The string data in this array varies from nothing to a few thousand
characters and doesn't contain any carriage returns - just text and the
odd
html tag

Anyone any ideas? I've seen alot of probs with querying memo fields and
returning truncated values but not while writing them..

Set oDB = Server.CreateObject("ADODB.Connection")
oDB.Open "DSN=ImageLib;UID=;pwd=;"

For n = 1 to numPhotos

SQL = "INSERT INTO PHOTOS (ID,Filename,SeriesID,SectionID,Description)
VALUES ("
SQL = SQL + Trim(CStr( n )) + ", '"
SQL = SQL + photoPAK_Filename(n) + "', "
SQL = SQL + Trim(CStr( photoPAK_SeriesID(n) )) + ", "
SQL = SQL + Trim(CStr( photoPAK_SectionID(n) )) + ", '"
SQL = SQL + photoPAK_Desc(n) + "')"

oDB.Execute SQL
----








 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Images in a database Franz General Discussion 10 October 7th, 2004 09:35 AM
Enter data in 1 text form field & have multiple locations filled i James General Discussion 4 August 12th, 2004 10:02 PM
Vanishing data in form field of memo type MargaretM New Users 12 July 14th, 2004 03:50 PM
Text field causing trouble in query (continued) KaiRich Running & Setting Up Queries 2 May 28th, 2004 01:03 PM
Chart Source Data Ranges Changing when Data Sheet updated from text file source. Tekn0 Charts and Charting 3 January 8th, 2004 05:45 PM


All times are GMT +1. The time now is 03:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.