| |
ballsup
Posts: 1
Score: 0
Joined: 7/2/2002
From:
Status: offline
|
I have the following VB6 code i am trying to convert to VBScript but i am having problems with the XML stream, can any pass over any ideas. Heres the origional VB6 Code followed by my conversion so far...: Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Sub cmdGo_Click() Dim rs As New ADODB.Recordset Dim stm As New ADODB.Stream Dim xml As New MSXML.XMLHTTPRequest Const WEBHOST = "http://localhost/test"; ' Show Hourglass: Screen.MousePointer = vbHourglass ' Open the recordset: rs.CursorLocation = adUseClient rs.Open WEBHOST & "/titlesrecordsetxml.asp" ' Make some mods (an update, a delete, and an insert): ' Update: 'rs.Fields("Title") = rs.Fields("Title") & "1" 'rs.Update ' Delete: 'rs.MoveNext 'rs.Delete ' Insert: rs.AddNew rs.Fields("job_id") = "4" rs.Fields("URL") = "http://testing123"; rs.Fields("Status") = "0" rs.Update ' Send the Recordset back to the server: rs.save stm, adPersistXML xml.Open "POST", WEBHOST & "/roundtrip.asp", False Dim szXML As String szXML = stm.ReadText xml.send szXML ' Clear Hourglass: Screen.MousePointer = vbNormal ' Bring up the HTML file in a browser:administrator ShellExecute Me.hwnd, "open", WEBHOST & "/titlesrecordsetxml.asp", "", CurDir$, 1& End Sub ----------------------------------------------------
|
|