Solved

VB SQL Server

Posted on 2002-03-18
3
177 Views
Last Modified: 2010-05-02
Hello Experts:

I am currently working on an application that stores large blocks of text into a Sql 7.0 database.  The text being stored is a property description which can be several thousand characters long.  I have set up the column in Sql to be a Text datatype, which, from my understanding, stores large blocks of text.

The problem is, when the large blocks of text are stored in the database, the column displays <long text> and I can't retrieve this information from the database?  Any ideas?

VB 6.0 Sql 7
0
Comment
Question by:escheider
3 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 6877222
Look for online help references to handling memo fields.

Hint: GetChunk
0
 
LVL 18

Accepted Solution

by:
mdougan earned 25 total points
ID: 6877268
In SQL Server, you can define a varchar field of up to 8000 bytes, and not need to do any special recordset processing.  If you need to store more than 8000 characters, then you need to use the SQL Server Text datatype, but then whenever you open the recordset and move to a new record, you'll have to issue the RS.GetChunk method.

Basically, you tell it how many bytes to get at a time, and then you append the results to some program variable until the number of bytes actually gotten is less than the number of bytes that you requested, then you know you have received the whole field.

Likewise, when you go to update that column in the recordset, you have to AppendChunk block after block until you've appended the whole contents, and then, I believe that you need to issue an RS.UpdateBatch instead of an RS.Update (at least I've had to do that in some code samples that were updating Image fields...)
0
 
LVL 4

Author Comment

by:escheider
ID: 6886449
Thanks for the input guys, seemed to fix the problem
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Check Disk (CHKDSK) on all volumes and fix if needed. 8 178
VB error "Type mismatch" 2 49
How to debug this code 7 56
Excel VBA, find a string in a column, update a cell 7 65
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now