p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: msmq access database record pushing/pulling


Message #1 by "Karl Fraser" <karl_fraser@h...> on Wed, 09 May 2001 15:33:24
Eventually got to check this out, and it worked.

Thanks for the help
Karl


>From: trooks@r...
>Reply-To: "Code Clinic" <proasp_codeclinic@p...>
>To: "Code Clinic" <proasp_codeclinic@p...>
>Subject: [proasp_codeclinic] Re: msmq access database record 
>pushing/pulling
>Date: Sat, 12 May 2001 18:34:02
>
>Karl,
>
>First you need to place a recordset on the other side of the execute.
>
>The code for this is something like the following:
>
>Dim temprs As Recordset
>Dim sSPName As String
>Dim oStream As ADODB.Stream
>Dim oCmd As ADODB.Command
>Dim lRecordsAffected As Long
>Dim sXML as string
>
>
>     Set oCmd = New ADODB.Command
>     If m_oConn.State = adStateOpen Then
>         Set oCmd.ActiveConnection = m_oConn
>     Else
>         [Place your open connection language here from above]
>         Set oCmd.ActiveConnection = m_oConn
>     End If
>     oCmd.CommandText = [Your SQL String]
>     oCmd.CommandType = adCmdText
>
>     Set temprs = New ADODB.Recordset
>     temprs.CursorLocation = adUseClient
>     temprs.CursorType = adOpenDynamic
>     temprs.LockType = adLockBatchOptimistic
>     Set temprs = oCmd.Execute(lRecordsAffected)
>     Set oCmd.ActiveConnection = Nothing
>     Set oStream = New ADODB.Stream
>This will create an xml string that you can parse or return to a recordset
>It is a create transportation format between servers or processes.
>     temprs.Save oStream, adPersistXML
>     oStream.Position = 0
>     sXML = Trim(oStream.ReadText)
>     temprs.Close
>     Set temprs = Nothing
>     Set oCmd = Nothing
>     m_oConn.close
>
>     Set m_oConn - nothing
>Now you can set your message body to sXML (The xml string) and this can
>then be sent.
>
>If you need the code for the message queue for Windows 2000 please repost
>the request here.
>
>Tracy
>

  Return to Index