public Sub server()
Dim NewQueue As New
System.Messaging.MessageQueue(".\Private$\jk")'"FORMATNAME:
PUBLIC=3d3dc813-c555-4fd3-8ce0-79d5b45e0d75"'与指定计算机中的消息队列建立连接,
Dim m As System.Messaging.Message
'查看消息队列中的消息
m = NewQueue.Receive
m.Formatter = New System.Messaging.XmlMessageFormatter(New String()
{"System.String,mscorlib"})
Dim st As String
st = m.Body'消息队列中消息的消息内容。既sql语句
Dim con As New OleDb.OleDbConnection("输入自己的数据库连接字符串")
con.Open()
Dim com As New OleDb.OleDbCommand(st, con)'执行消息中的sql语句
com.ExecuteNonQuery()
con.Close()
End Sub
|