469,322 Members | 1,130 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

AdoDc control peculiar problem

I have a form with an AdoDc control associated to a datagrid.
The AdoDC uses a "ConnectionString" such as
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source=..."

this is where the problem begins. The data source will not be known until
the user selects the database.

What is really weird is that if the source is not placed during design time,
during run time the form upon loading will generate an error ("Failed to
authenticate"). This error seems to be untrappable since it doesn't occur in
the Form Load or Activate event (I have tried to catch it there).

Of course once the error is ignored and the datasource is set in the form
load, everything works OK.

Anyone has any idea how this error can be trapped or eliminated?

Thanks in advance for your time.
Jan 10 '06 #1
4 5763

"Raoul Watson" <Wa*****@IntelligenCIA.com> wrote in message
news:wOEwf.1807$JT3.1534@trndny06...
I have a form with an AdoDc control associated to a datagrid.
The AdoDC uses a "ConnectionString" such as
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source=..."

this is where the problem begins. The data source will not be known until
the user selects the database.

What is really weird is that if the source is not placed during design time,
during run time the form upon loading will generate an error ("Failed to
authenticate"). This error seems to be untrappable since it doesn't occur in
the Form Load or Activate event (I have tried to catch it there).

Of course once the error is ignored and the datasource is set in the form
load, everything works OK.

You should be able to start the app without an error if the connection string
property of the ADODC control is completely blank. Then set the entire
connection string in code, including the part about "Provider=" etc.
Jan 10 '06 #2
The error is not thrown that's why you are not seeing it there it is
displayed by the adodc

put this in the adodc_error event thandler

fCancelDisplay = True

and it will stop the error being displayed

"Steve Gerrard" <my********@comcast.net> wrote in message
news:fs********************@comcast.com...

"Raoul Watson" <Wa*****@IntelligenCIA.com> wrote in message
news:wOEwf.1807$JT3.1534@trndny06...
I have a form with an AdoDc control associated to a datagrid.
The AdoDC uses a "ConnectionString" such as
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source=..."

this is where the problem begins. The data source will not be known until
the user selects the database.

What is really weird is that if the source is not placed during design
time,
during run time the form upon loading will generate an error ("Failed to
authenticate"). This error seems to be untrappable since it doesn't occur
in
the Form Load or Activate event (I have tried to catch it there).

Of course once the error is ignored and the datasource is set in the form
load, everything works OK.

You should be able to start the app without an error if the connection
string property of the ADODC control is completely blank. Then set the
entire connection string in code, including the part about "Provider="
etc.

Jan 10 '06 #3

"Steve Gerrard" <my********@comcast.net> wrote in message
news:fs********************@comcast.com...

"Raoul Watson" <Wa*****@IntelligenCIA.com> wrote in message
news:wOEwf.1807$JT3.1534@trndny06...
I have a form with an AdoDc control associated to a datagrid.
The AdoDC uses a "ConnectionString" such as
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source=..."

this is where the problem begins. The data source will not be known until the user selects the database.

What is really weird is that if the source is not placed during design time, during run time the form upon loading will generate an error ("Failed to
authenticate"). This error seems to be untrappable since it doesn't occur in the Form Load or Activate event (I have tried to catch it there).

Of course once the error is ignored and the datasource is set in the form load, everything works OK.
You should be able to start the app without an error if the connection

string property of the ADODC control is completely blank. Then set the entire
connection string in code, including the part about "Provider=" etc.


Thanks.. but remember I have a grid with a datasource pointing to AdoDC so
if I marked ConnectionString and leave it blank, I'll get an error
"[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified." upon form load (again, untrappable)
Jan 11 '06 #4
T H A N K S !! John. I appreciate it very much.
I didn't know how to completely discard the error,
your solution is perfect for my problem. thanks again.

"John Smith" <so*****@microsoft.com> wrote in message
news:43***********************@news.optusnet.com.a u...
The error is not thrown that's why you are not seeing it there it is
displayed by the adodc

put this in the adodc_error event thandler

fCancelDisplay = True

and it will stop the error being displayed

"Steve Gerrard" <my********@comcast.net> wrote in message
news:fs********************@comcast.com...

"Raoul Watson" <Wa*****@IntelligenCIA.com> wrote in message
news:wOEwf.1807$JT3.1534@trndny06...
I have a form with an AdoDc control associated to a datagrid.
The AdoDC uses a "ConnectionString" such as
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data
Source=..."

this is where the problem begins. The data source will not be known until the user selects the database.

What is really weird is that if the source is not placed during design
time,
during run time the form upon loading will generate an error ("Failed to authenticate"). This error seems to be untrappable since it doesn't occur in
the Form Load or Activate event (I have tried to catch it there).

Of course once the error is ignored and the datasource is set in the form load, everything works OK.

You should be able to start the app without an error if the connection
string property of the ADODC control is completely blank. Then set the
entire connection string in code, including the part about "Provider="
etc.


Jan 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by News Central | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.