473,956 Members | 5,767 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Declaration Expected

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.SQLServe r
oSQLServer.Conn ect("(local)", "myServer", "myPassword ")
--
Steve King
Jan 23 '06 #1
3 3402
Dim oSQLServer As New SQLDMO.SQLServe rClass
--
Milosz Skalecki
MCP, MCAD
"Steve King" wrote:
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.SQLServe r
oSQLServer.Conn ect("(local)", "myServer", "myPassword ")
--
Steve King

Jan 23 '06 #2
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.
--
Steve King
"Milosz Skalecki" wrote:
Dim oSQLServer As New SQLDMO.SQLServe rClass
--
Milosz Skalecki
MCP, MCAD
"Steve King" wrote:
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.SQLServe r
oSQLServer.Conn ect("(local)", "myServer", "myPassword ")
--
Steve King

Jan 23 '06 #3
It's working in my VS. Delete SQLDMO reference and add it again. Have u got
option strict set to on?

--
Milosz Skalecki
MCP, MCAD
"Steve King" wrote:
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.
--
Steve King
"Milosz Skalecki" wrote:
Dim oSQLServer As New SQLDMO.SQLServe rClass
--
Milosz Skalecki
MCP, MCAD
"Steve King" wrote:
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.SQLServe r
oSQLServer.Conn ect("(local)", "myServer", "myPassword ")
--
Steve King

Jan 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

83
6601
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in C. It can cause very ugly errors,like this: epsilon=0 S=0 while epsilon<10: S=S+epsilon
1
16371
by: Ammar_ace | last post by:
Can Somebbody pls help me out here. i am new to .net programming, i am trying to connect to an access database and read, but i get the error message 'BC30188 Declaration Expected' this is what i did 'create the connection object Dim objConn As New System.Data.OLEDB.Connection() .. .. ..
9
5051
by: D. Shane Fowlkes | last post by:
Still learning ASP.NET....(and I was getting so good with classic ASP too!). I'm trying to connect to a SQL Server using a simple connection script. I've checked 2 different books and looked at www.asp.net and still cannot get past this "error". Can anyone see the error? This <script> example is almost line by line from the Sams ASP.NET Unleashed Book. The error is on line 8. Thanks.
2
1235
by: Simon Harris | last post by:
Hi All, I'm trying to the the following code working in VS.Net, when I add the lines noted with '<<<<<' VS tells me declaration is expected for 'SPDOleDbConnection' Public Class DBConnect Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader Dim SPDOleDbConnection As New OleDb.OleDbConnection
3
50507
by: gamehack | last post by:
Hi all, Here's the error which I'm getting when trying to compile some code: boxmanager.h:16: error: ISO C++ forbids declaration of 'vector' with no type boxmanager.h:16: error: expected ';' before '<' token boxmanager.h:17: error: ISO C++ forbids declaration of 'vector' with no type
1
1922
by: INeedADip | last post by:
What is the difference between: function setupGrid( param ){......} and setupGrid = function( param ){......} Are there any advantages to doing one over the other?
7
9446
by: Florian Haag | last post by:
Hello, I'm trying to compile a programme which compiles fine under Linux; I'm trying it with MinGW G++ 3.4.2: Component.h: #ifndef COMPONENT_H_ #define COMPONENT_H_
8
7892
by: aneuryzma | last post by:
Hello, I'm merging an OpenCV app with an Ogre3d app. I'm on a mac, I'm using xCode. When I add #include "openCVApp.h" I got the following error:
6
14739
by: samsneelam | last post by:
Hi.. This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob.. I am having two files .. one is mpcplib.h it contains the follwing declerations.... #include <queue> #include <vector> #include <string> class database { queue<delayTP> delayThrouput;
1
2675
by: shekhardotnet | last post by:
below testing code gives an error "declaration expected" please suggest Imports System.Data.SqlClient Public Class Form1 Inherits System.Windows.Forms.Form 'Create ADO.NET objects. Private myConn As SqlConnection Private myCmd As SqlCommand
0
10029
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11652
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11261
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11436
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10745
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8323
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7485
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
3604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.