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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command object - Memo field

Status
Not open for further replies.

karenmierkalns

Programmer
May 10, 2001
54
0
0
CA
I am try to execute a simple update stored query (using Access with VB). One of the fields happens to be a memo datatype. What TYPE (DatatypeEnum) can I use for creating the parameter? Do I need to specify a field size? I haven't been able to find examples using memo fields.

I've tried adVarChar, adVariant, adVarWChar, etc. None seem to work, or I am omitting the size (but I don't know what to put in size)..

Here is the basic idea of what I'm working with:


<code snippet>

Dim comEdit As New ADODB.Command

With comEdit
.ActiveConnection = connFinAid
.CommandText = &quot;updateStudent&quot;
.CommandType = adCmdStoredProc

.Parameters.Append .CreateParameter(&quot;Comments&quot;, adVariant, adParamInput, , strComments)
.Execute
End With

Set comEdit = Nothing

</code snippet>

Thanks. - Karen
 
As a follow-up...I found a work-around.

I created parameters in my query (Query-->Parameters).

It will create the parameter, so all you have to do is specify what value is to be passed to it:

comEdit.parameter(0).value = strComment
comEdit.execute

and all is fine!

- Karen
 
Oh sorry..should be:

comEdit.parameters(0).value = strComments - Karen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top