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