Hello friends,
I have two doubts.
1.How to create xml file and text files using vb codes?
2.Is it possible to create xml file direcly from sql server for data sending?.How?
Thanks in advance,
Santhosh
Printable View
Hello friends,
I have two doubts.
1.How to create xml file and text files using vb codes?
2.Is it possible to create xml file direcly from sql server for data sending?.How?
Thanks in advance,
Santhosh
Download the MSXMLx parser. Think they're up to version 6
SQL Server 2005 might be able to send xml
Can you be a bit more specific in what you want?
What kind of Database? What kind of XML file? How do you want it to be generated/used?
Lookup For "For XML" keyword in books online.Quote:
Originally Posted by santhoshabraham
[ merged ]
Call the function below like this. . . pass it a recordset and it will create an xml file from of the recordset you pass to it. It also returns the recordset completely detached from its datasource.
Set rsRecordSet = DisconnectRecordSet(rsRecordSet)
Code:Public Function DisconnectRecordSet(rsRecordSetToDisconnect As ADODB.Recordset) As ADODB.Recordset
Dim sPersistedRecordsetFileName As String
On Error GoTo DisconnectRecordSetErrHandler
sPersistedRecordsetFileName = App.Path & "\" & App.EXEName & ".xml"
' wipmove.xml"
If LenB(Dir(sPersistedRecordsetFileName)) <> 0 Then
Kill sPersistedRecordsetFileName
End If
rsRecordSetToDisconnect.Save sPersistedRecordsetFileName, adPersistXML
rsRecordSetToDisconnect.Close
Set rsRecordSetToDisconnect = Nothing
Set rsRecordSetToDisconnect = New ADODB.Recordset
rsRecordSetToDisconnect.CursorLocation = adUseClient
rsRecordSetToDisconnect.LockType = adLockBatchOptimistic
rsRecordSetToDisconnect.Open sPersistedRecordsetFileName
Set DisconnectRecordSet = rsRecordSetToDisconnect
DisconnectRecordSetExitPoint:
On Error Resume Next
Exit Function
DisconnectRecordSetErrHandler:
Select Case Err.Number
Case Else
MsgBox AN_UNEXPECTED_ERROR_OCCURRED_IN & "Globals.DisconnectRecordSet" & vbCrLf & vbCrLf & Err.Description, vbOKOnly + vbExclamation
End Select
Resume DisconnectRecordSetExitPoint
End Function