Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

memo fields and variables?

Status
Not open for further replies.

Fursten

Programmer
Dec 27, 2000
403
PT
I have an SQL String "SELECT Memo field FROM..." and i can't associate the Memo field comming from the ADO RecordSet to a variable, but i can show the result set on the screen. Do you know how to put it in a variable ? On the other hand, the same SELECT puted in an Arrray i will only be able to put it in a variable and not to show it up, and i need to display it. Do you know how to fix this ?

Many tx
 
Code:
theVariableName = theRecordset("memoFieldName")

I think that's what you want???

Paul Prewett
 
The problem is that the type of that field in SQLServer is text type (like memo type). I think that that kind of field cannot be associated with a variable... Is this correct? Or there is a way to solve this?

This is the error I get:


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.


 
No, the default variable type in vbScript is variant, which basically means that any type of variable can be stored in a vbScript variable...

I'm not sure I know what that error means...

:-(
p
 
You may be having a similar problem that we had in our devleopment. The error we have when attempting to assign text fields to variables is that fields remaining PAST the text field cannot be assigned.

For example:

Set MyArray = MyDatabase.Execute("select integer, Memo, integer2, string")

The array would come back with valid items for the integer field and MAYBE the Memo field, but the other two fields would not hold anything and produce an error if acted upon.

We resolved this problem by moving the memo field to the end of the query, and if more than one was involved, produce it in an additional query.

--M
 
Actually the problem you are having is because MEMO fields, like LONG and RAW data fields can not be accessed and put into variables directly.

You need to use
variable = rs.fields("memofield").getChuck(rs.fields("memofield").actualsize) in order to get the memo field into a variable.

To put data into a memo field you need to use .AppendChunk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top