Deploying ADO Data bound controls / changing connection string 
Author Message
 Deploying ADO Data bound controls / changing connection string

I''m writing an application that will be tested on two different SQL
servers and put into production on a third. I'm using SQL 7.0 and VB 6
Enterprise with SP3.

My problem is figuring out how to change the server name in the
connection string of my ADO data controls I use for the data source for
my data bound controls (data grids and combo boxes).

For the ADO connections I do in my code, it's no problem. I just read a
registry entry with the server name and use that in the connection
string. However, I can't figure out what to do with the data bound
controls.

I've played with this for a while now trying to put the code in
different places, however, it always seems to try to evaluate the
design-time connection string first. I tried taking out the server name
at design-time, but now I get "General network error" instead of a bad
SQL server message.

I spent the day digging through Deja and MSDN and it looks like you
might be able to use DSN or UDL for the connection string although I
only found hints of this.

Can someone point me in the right direction? Does DSN or UDL work? Can I
distribute the DSN or UDL file or create/modify it in my program? Some
of the users are coming from a UNIX menu-driven system and the rest have
no computer experience. I don't think I can get them to do any setup
work beyond clicking setup and typing the server name into the install.

If all else fails I guess I could just keep changing it and recompiling
:-(

Thanks for your help,
  Sharon



Tue, 25 Dec 2001 03:00:00 GMT
 Deploying ADO Data bound controls / changing connection string

Hi Sharon:



Quote:
> I''m writing an application that will be tested on two different SQL
> servers and put into production on a third. I'm using SQL 7.0 and VB 6
> Enterprise with SP3.

> My problem is figuring out how to change the server name in the
> connection string of my ADO data controls I use for the data source for
> my data bound controls (data grids and combo boxes).

> For the ADO connections I do in my code, it's no problem. I just read a
> registry entry with the server name and use that in the connection
> string. However, I can't figure out what to do with the data bound
> controls.

> I've played with this for a while now trying to put the code in
> different places, however, it always seems to try to evaluate the
> design-time connection string first. I tried taking out the server name
> at design-time, but now I get "General network error" instead of a bad
> SQL server message.

...well, you migth try this trick: prior to compile set the connection
property to blank.
--
SALUD,
Jess
*******

*******


Mon, 31 Dec 2001 03:00:00 GMT
 Deploying ADO Data bound controls / changing connection string
Thanks Jesus. You're idea gave me a hint in the right direction.

I ended up setting the connection string and the record source properties
blank. Then in the form load I set the properties and did a refresh. Then in
the form unload I set the properties to blank.

Thanks for the help.
    Sharon Freas

Quote:

> Hi Sharon:



> > I''m writing an application that will be tested on two different SQL
> > servers and put into production on a third. I'm using SQL 7.0 and VB 6
> > Enterprise with SP3.

> > My problem is figuring out how to change the server name in the
> > connection string of my ADO data controls I use for the data source for
> > my data bound controls (data grids and combo boxes).

> > For the ADO connections I do in my code, it's no problem. I just read a
> > registry entry with the server name and use that in the connection
> > string. However, I can't figure out what to do with the data bound
> > controls.

> > I've played with this for a while now trying to put the code in
> > different places, however, it always seems to try to evaluate the
> > design-time connection string first. I tried taking out the server name
> > at design-time, but now I get "General network error" instead of a bad
> > SQL server message.

> ...well, you migth try this trick: prior to compile set the connection
> property to blank.
> --
> SALUD,
> Jess
> *******

> *******



Tue, 08 Jan 2002 03:00:00 GMT
 Deploying ADO Data bound controls / changing connection string
Hi again, Sharon:



Quote:
> Thanks Jesus. You're idea gave me a hint in the right direction.

> I ended up setting the connection string and the record source properties
> blank. Then in the form load I set the properties and did a refresh. Then
in
> the form unload I set the properties to blank.

> Thanks for the help.

...well, I think you don't need further help with this item: you did it:  I
usually bound visual components with datasources by code, just the way you
do: on form load (depending what I want, maybe later) setting datasource,
datamember, recordset or whatever, and setting to blank prior to unload the
form/set to nothing data components...
Still, specially working with two layer apps, it would be great not to take
care of that (more or less the same with design time/run time properties for
user/password).  Sigh
--
SALUD,
Jess
*******

*******


Wed, 09 Jan 2002 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. ADO Bound Controls & Connections Strings

2. Changing the ADO control connection string at run time

3. Data bound controls using Adodc and ADO connection object

4. How to bind ADO data bound controls in Visual C++

5. ADO Data Controls Connection string

6. ADO Data Control and Bound Controls

7. ADO control works while ADO Connection String fails

8. ADO Data control bind to ADO DataGrid

9. Bind an ado recordset directly to an ado data control (adodc)

10. First Cell Empty in Data Grid bound to ADO Data Control

11. Data-Bound Vs. Non-Data-Bound Controls

12. Data-Bound Vs. Non-Data-Bound Controls


 
Powered by phpBB® Forum Software