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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top