Try to open the connection to the Server. If it causes an exception you know.
Using oSqlConnection As New SqlConnection("ConnectionString")
oSqlConnection.Open()
End Using
)
To check for a table.
SELECT *
FROM INFORMATION_SCHEMA.TABLES T
WHERE T.TABLE_NAME LIKE '%MY_TABLE%'
Putting it all together in VB.
Using oSqlConnection As New SqlConnection(My.Settings.ProductTraxConnectionString)
oSqlConnection.Open()
Using oQuery As New SqlCommand(
"SELECT COUNT(*) " &
"FROM INFORMATION_SCHEMA.TABLES T " &
"WHERE T.TABLE_NAME LIKE @LookupTable", oSqlConnection)
oQuery.Parameters.AddWithValue("@LookupTable", "%MY_TABLE%")
Dim oResult as object = oQuery.ExecuteScalar()
End Using
End Using