mysterious-connection string "disappears" from source code (bug ??

G

Guest

I am really confused !
- Form1 uses an openfiledialoag to get a public strfilename.
- Forms 2 and 3 both connect to the database specified in the file name.
The connection string is shown below.

Intermittently, the connection string disappears from either Form2, Form3,
or both.
When I get an error, either in debug or running a build, I go back to
inspect the source code and, sure enough, one or both connection strings have
evaporated !
Even stranger, even the comment lines surrounding the string are gone. See
below:

''********************************************************************
''OleDbConnection1
''
Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial
Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=" + strfilename + ";Jet OLEDB:Engine
Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist sec" & _
"urity info=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:Encrypt Dat" & _
"abase=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User
ID=Admin;Jet" & _
" OLEDB:Global Bulk Transactions=1"
 
L

Larry Lard

HarryMangurian said:
I am really confused !
- Form1 uses an openfiledialoag to get a public strfilename.
- Forms 2 and 3 both connect to the database specified in the file name.
The connection string is shown below.

Intermittently, the connection string disappears from either Form2, Form3,
or both.
When I get an error, either in debug or running a build, I go back to
inspect the source code and, sure enough, one or both connection strings have
evaporated !

Just as a quick check, you're not editing code in Private Sub
InitializeComponent are you ?
 
G

Guest

No......I have now been told that this can happen if you use the wizard to
set up your connection and you subsequently modify the wizard generated
connection string.

M$ should warn about this somewhere.
Who woulda' thunk that source code can evaporate ex post wizardo !
 

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