473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB.Net Undeclared Error

Hello,

I am getting the follow error: The variable 'strSQL' is
either undeclared or was never assigned. On the follwing
code:
Dim strSQL As String
Dim strWhatToReplace As String

strSQL = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=0;Jet OLEDB:Database Password=;Data
Source=""C:\northwind.mdb"";Password=test;Jet
OLEDB:Engine Type=" & _
"5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0" ";Jet
OL" & _
"EDB:System database=""C:\northwind.mdw"";Jet
OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:N" & _
"ew Database Password=;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Cop" & _
"y Locale on Compact=False;Jet OLEDB:Compact
Without Replica Repair=False;User ID" & _
"=ttacta_reader;Jet OLEDB:Encrypt Database=False"

Me.OleDbConnection1.ConnectionString = strSQL

The program runs fine even with the error. The Line the
compiler does not like is the last one were I am setting
the connectionstring equal to the string.

Any help would be appreciated.

Thanks!
Nov 20 '05 #1
2 1288
Cor
Hi Brandan,

Where in your program are you using this code.
This seems as something created with the wizard.
The connection is very early made in your program with that.

So changing the connectionstring after that would not have any effect I
think.

Cor
I am getting the follow error: The variable 'strSQL' is
either undeclared or was never assigned. On the follwing
code:
Dim strSQL As String
Dim strWhatToReplace As String

strSQL = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=0;Jet OLEDB:Database Password=;Data
Source=""C:\northwind.mdb"";Password=test;Jet
OLEDB:Engine Type=" & _
"5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0" ";Jet
OL" & _
"EDB:System database=""C:\northwind.mdw"";Jet
OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:N" & _
"ew Database Password=;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Cop" & _
"y Locale on Compact=False;Jet OLEDB:Compact
Without Replica Repair=False;User ID" & _
"=ttacta_reader;Jet OLEDB:Encrypt Database=False"

Me.OleDbConnection1.ConnectionString = strSQL

The program runs fine even with the error. The Line the
compiler does not like is the last one were I am setting
the connectionstring equal to the string.

Nov 20 '05 #2
This is in the system generated code in
Private components As System.ComponentModel.IContainer

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
-----Original Message-----
Hi Brandan,

Where in your program are you using this code.
This seems as something created with the wizard.
The connection is very early made in your program with that.
So changing the connectionstring after that would not have any effect Ithink.

Cor
I am getting the follow error: The variable 'strSQL' is either undeclared or was never assigned. On the follwing code:
Dim strSQL As String
Dim strWhatToReplace As String

strSQL = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=0;Jet OLEDB:Database Password=;Data Source=""C:\northwind.mdb"";Password=test;Jet
OLEDB:Engine Type=" & _
"5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0" ";Jet
OL" & _
"EDB:System database=""C:\northwind.mdw"";Jet
OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:N" & _
"ew Database Password=;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Cop" & _
"y Locale on Compact=False;Jet OLEDB:Compact
Without Replica Repair=False;User ID" & _
"=ttacta_reader;Jet OLEDB:Encrypt Database=False"
Me.OleDbConnection1.ConnectionString = strSQL

The program runs fine even with the error. The Line the compiler does not like is the last one were I am setting the connectionstring equal to the string.

.

Nov 20 '05 #3

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

Similar topics

3
by: Saurabh Aggrawal | last post by:
Hi, if (iter->m_name.compare(pstrName) == 0) { // Provide our object. *ppunkItem = iter->m_pUnknown; // Addref our object... iter->m_pUnknown->AddRef(); break; }
9
by: W. Van Hooste | last post by:
Just starting with C, can somebody explain why this does not work or point me in the right direction? I wrote some tools and did some coding but cant seem to get this one. I DID declare my FILE...
5
by: Marc Gustafson | last post by:
This function is executed when a application file is double-clicked to open in a VC++ application. Specifically, this function is enabled by RegisterShellFileTypes () in the application's...
0
by: Stephanie Doherty | last post by:
Hello World, I am trying to use a _spawnl function like this (and I have included the process.h file): _spawnl(_P_WAIT,iporgfile,iporgfile,NULL); It compiles with the following errors: ...
4
by: Peter Rothenbuecher | last post by:
Hello, when I try to compile the following code: /* This fragment of code is taken from an online tutorial */ #include<stdio.h> #include<fcntl.h> #include<stdlib.h> float bigbuff;
6
by: Peter Rothenbuecher | last post by:
Hello, when I try to compile the following code with g++ -o client client.c #include<sys/socket.h> #include<stdio.h> #include<stdlib.h> #define ADDRESS "mysocket"; #define MAXLEN 200;
7
by: michigaki | last post by:
hello, we are having problems in compiling a 'slightly' altered x264. We are always receiving a 'helloWorld' undeclared (first use this function) error. We may be commiting a very simple error but...
5
by: vmagana | last post by:
First of all I would like to indicate that I am a newbie a programming. I am having a problem compiling a sample source code that I downloaded from microsoft. When I try to build the program I get...
3
by: Anna Smidt | last post by:
Thanks for the help so far. I have some problems left. One of them is an undeclared identifier, but it's unclear to me why the compiler fights with me. It says "iter: undeclared identifier" I...
7
by: Adam01 | last post by:
Im using cygwin to test the code of a server I am writing. I've included sys/types.h, sys/socket.h, netdb.h, and arpa/inet.h. And this is the output.. ../../../sockets.cpp: In constructor...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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,...

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.