VB.Net Undeclared Error

B

Brandan

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!
 
C

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
 
B

Brandan

This is in the system generated code in
Private components As System.ComponentModel.IContainer
 

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

Top