I am trying to find out the size of a Microsoft Access Table in VB. I am using the following code.
Dim cnn2 As OleDbConnection = New OleDbConnection()
Dim cmd As OleDbCommand = New OleDbCommand()
cnn2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\file\News.mdb"
cmd.CommandText = "select count(*) as c1 from Headline"
cmd.CommandType = CommandType.Text
newrow = cmd.ExecuteNonQuery()
and getting the following error
System.InvalidOperationException: ExecuteNonQuery: Connection property has not been initialized.
Is there another way of doing this or am I on the right lines