If you're asking me what is wrong with this function, I'd say:
1. The connection string isn't quoted correctly and looks incomplete
myConn.ConnectionString = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
2. There is no return statement, so the example given shouldn't even compile because it's declared as a function rather than a sub
3. The use of a MsgBox strongly couples the function to a windows forms application, you wouldn't be able to use this in ASP.net for example
4. "IsConnected" is a totally misleading name for the function as it doesn't actually tell you if you're connected or not. It looks like it runs SQL statements.
5. The following code:
If ver = False Then
myDR = myCmd.ExecuteReader() For reading query
Else
myCmd.ExecuteNonQuery() For updating query
End If
should be simplified to:
If ver Then
myCmd.ExecuteNonQuery() For updating query
Else
myDR = myCmd.ExecuteReader() For reading query
End If
because you're evaluating a boolean in the
If