title: OLEDB: Opening the connection does not work in the second time
body: <p>Hello 2 everyone ^_^...</p>
  
  <p>I have a VB code that connects to a sever database and used Virtual Machine as the client (sorry i only have one computer :P).</p>
  
  <p>on the 1st click the select query works, but on the second time it does not work anymore...
  Here is my code:</p>
  
  <p>From the module</p>
  
  <pre><code>Imports System.Data.OleDb
  
  Module oledb
  
      Public conn As OleDbConnection = New OleDbConnection()
      Public comm As OleDbCommand
      Public reader As OleDbDataReader
      Public query As String
  
      Sub connection()
          Try
              conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\vboxsvr\Documents\sampleDB.mdb;User Id=Admin;Password="
          Catch ex As Exception
              MsgBox(ex.ToString)
          End Try
      End Sub
  End Module
  </code></pre>
  
  <p>From the form</p>
  
  <pre><code>Imports System.Data.OleDb
  
  Public Class Form1
  
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          Call connection()
      End Sub
  
      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          Try
              conn.Open()
              query = "select * from sample_tbl"
              comm = New OleDbCommand(query, conn)
              reader = comm.ExecuteReader
  
              While reader.Read
                  ListBox1.Items.Add("Number: " + reader("number").ToString + "Letter: " + reader("letter").ToString)
              End While
              conn.Close()
          Catch ex As Exception
              MsgBox(ex.ToString)
          Finally
              conn.Dispose()
          End Try
      End Sub
  End Class
  </code></pre>
  
  <p>The error is </p>
  
  <blockquote>
    <p>the connectionstring property has not been initialized</p>
  </blockquote>
  
  <p>The line of error is on the form code</p>
  
  <blockquote>
    <p>conn.open</p>
  </blockquote>
  
  <p>Thank you for any help :-)</p>