Declaration Expected

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've an error in code I got from a walkthrough that should work just fine. I
added a reference to DMO that shows up in the references properly. The Dim
line shows no errors but the initialized object shows an 'Declaration
Expected' error. What could be happening?

Dim oSQLServer As New SQLDMO.SQLServer
oSQLServer.Connect("(local)", "myServer", "myPassword")
 
I immediately tried your recommendation. It resulted in exactly the same
problem. After typing the SQLDMO., I am prompted with the class members and
both SQLServer and SQLServerClass are visible. Selecting either of these
seems to work on the Dim line but gives me the error when I try to use the
object. I'm using VB.NET 2003 from VS.
 
It's working in my VS. Delete SQLDMO reference and add it again. Have u got
option strict set to on?
 
Back
Top