Using ADO Command object and Access PROCEDURE to insert Memo/Binary fields 
Author Message
 Using ADO Command object and Access PROCEDURE to insert Memo/Binary fields

/*
This is the Access PROCEDURE
Works w/Jet engine
DataType in Access table is Memo
*/
PARAMETERS m_rsp Binary;
INSERT INTO Responses ( xmlResponse )
VALUES (m_rsp);

'Use this in a VB form.
Private Sub cmdInsRsp_Click()
    On Error GoTo ErrorHandler

    Dim oConn As ADODB.Connection
    Dim oCmd As ADODB.Command

    Dim m_xmlResp As String
    m_xmlResp = xmlDOM.xml
    Set xmlDOM = Nothing

    Set oConn = New ADODB.Connection
    With oConn
        .ConnectionString = "Memo"
        .ConnectionTimeout = 10
        .Open
    End With

    Set oCmd = New ADODB.Command
    With oCmd
        .ActiveConnection = oConn
        .CommandText = "InsertResp"
        .Parameters.Append .CreateParameter("m_rsp", adLongVarWChar,
adParamInput, 63000, m_xmlResp)
        .Execute
    End With

    Exit Sub

ErrorHandler:

    Debug.Print Err.Description
End Sub



Wed, 28 Jan 2004 08:48:59 GMT  
 Using ADO Command object and Access PROCEDURE to insert Memo/Binary fields
Nigel

Try

With oCmd
        .ActiveConnection = oConn
        .CommandType =adCmdStoreProc
        .CommandText = "InsertResp"
        .Parameters.Append .CreateParameter("m_rsp", adLongVarWChar,
adParamInput, 63000, m_xmlResp)
        .Execute
    End With

Sukesh


Quote:
> /*
> This is the Access PROCEDURE
> Works w/Jet engine
> DataType in Access table is Memo
> */
> PARAMETERS m_rsp Binary;
> INSERT INTO Responses ( xmlResponse )
> VALUES (m_rsp);

> 'Use this in a VB form.
> Private Sub cmdInsRsp_Click()
>     On Error GoTo ErrorHandler

>     Dim oConn As ADODB.Connection
>     Dim oCmd As ADODB.Command

>     Dim m_xmlResp As String
>     m_xmlResp = xmlDOM.xml
>     Set xmlDOM = Nothing

>     Set oConn = New ADODB.Connection
>     With oConn
>         .ConnectionString = "Memo"
>         .ConnectionTimeout = 10
>         .Open
>     End With

>     Set oCmd = New ADODB.Command
>     With oCmd
>         .ActiveConnection = oConn
>         .CommandText = "InsertResp"
>         .Parameters.Append .CreateParameter("m_rsp", adLongVarWChar,
> adParamInput, 63000, m_xmlResp)
>         .Execute
>     End With

>     Exit Sub

> ErrorHandler:

>     Debug.Print Err.Description
> End Sub



Wed, 28 Jan 2004 11:53:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Updating Memo Fields in MS Access using ADO Parameter / Stored Procedures

2. Updating Memo Fields in MS Access using ADO Parameter / Stored Procedures

3. ADO Update (using VB) of Memo fields in Access 97 DB

4. Insert Text into a memo field using SQL

5. inserting html code into access memo-field

6. ADO & SQL - inserting a binary object

7. Unable to retrieve a memo field using ADO

8. Using ADO GetString with MSHFlexgrid - problem with memo field

9. Save a 'Memo' Field Using ADO

10. Using the ADO Command Object to send an Execute command

11. ADO, VB and Access MEMO field problem

12. VB6/ADO Can't access VFP 5 Memo fields

 

 
Powered by phpBB® Forum Software