Guest User

Untitled

a guest
May 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Try
  2. conexion.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source = C:\temp\Nwind2.MDB"
  3. conexion.Open()
  4. Dim line As String = "select distinct p.ProductName,s.CompanyName,c.CategoryName,o.UnitPrice from Products p,Suppliers s,Categories c,OrderDetails o where " _
  5. & " and p.SupplierID=s.SupplierID and p.CategoryID=c.CategoryID and p.ProductID=o.ProductID "
  6. Dim comando As New OleDbCommand
  7. comando.CommandType = CommandType.Text
  8. comando.CommandText = line
  9.  
  10.  
  11. Me.SaveFileDialog1.InitialDirectory = "C:"
  12. Me.SaveFileDialog1.Filter = "Text Files (*.txt)|*.txt"
  13. Me.SaveFileDialog1.ShowDialog()
  14. Dim sw As New IO.StreamWriter(Me.SaveFileDialog1.FileName)
  15. Dim sr As OleDbDataReader = comando.ExecuteReader
  16.  
  17. sw.WriteLine(line)
  18.  
  19.  
  20.  
  21.  
  22. sw.Close()
  23. Catch ex As Exception
  24.  
  25. End Try
Add Comment
Please, Sign In to add comment