General discussion

Locked

VB6 and ADODC Object/Controls

By setivi ·
I am developing an application which comprises of many VB6 forms with many ADO objects/controls.
My current development server is SQLDEV. The connecting strings and recordsources for the ADO controls refer to SQLDEV. Each time I want to test the application on the production server, SQLPROD, I have to manually locate all the ADO controls on each form and reset the connecting strings and recordsources to point to SQLPROD and change them back to SQLDEV if there is an error or the application did not meet specs.
Is there an easier way of avoiding this tedious way of assigning servers to apps and controls?
Will an INI file do, if yes how?

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB6 and ADODC Object/Controls

by Bristar In reply to VB6 and ADODC Object/Con ...

How about a global variable? Change all of your server assignments to the variable name and then just change the variable assignment when needed.

Collapse -

VB6 and ADODC Object/Controls

by setivi In reply to VB6 and ADODC Object/Con ...

will not accomplish my goal, .ini file preferred

Collapse -

VB6 and ADODC Object/Controls

by MadestroITSolutions In reply to VB6 and ADODC Object/Con ...

My dear friend, simply make a system DSN by going to the control panel > administrative tools > Data Sources (ODBC). Then set the recordsets to use this ODBC connection by going to properties > [Tab] General > Use ODBC Data Source Name, and selecting the ODBC you just created... and thats it. Create this connection on both servers, and simply change the name of the server it points to, for example, create a connection called MyProgram:

- Open ODBC Data Sources in Administrative tools
- Select the System DSN TAB
- Click [Add]
- Select SQL Server Driver
- Enter "MyProgram" as the name for your connection (replace it with anything u want)
- Enter a description (optional)
- Select the SQL Server instance it connects to
- Set your login configuration
- Set startup options
- Set SQL Server settings
- Click [finish]
- Click [Test Data Source] to make sure it works

and thats it!

enjoy

any questions or comments, if you are unsure of how to do this, please, DO NOT REJECT THE ANSWER, it hurts my rating, simply e-mail me at: juanja01@optonline.net, I will be more than glad to help u out!

Good Luck!

Collapse -

VB6 and ADODC Object/Controls

by setivi In reply to VB6 and ADODC Object/Con ...

The question was auto-closed by TechRepublic

Collapse -

VB6 and ADODC Object/Controls

by RRV In reply to VB6 and ADODC Object/Con ...

If you have too many controls in many forms and all in working condition (!!!) do not change logic to use global variable or DSN.

Open your forms (*.frm) using a text editor. Search and replace the connection string to your requirement. For example word editor uses Ctrl+H as search replacement shortcut.

This should definitely give you an immediate solution unless you go ahead reengineering the code with one global connection object etc.

RV

Collapse -

VB6 and ADODC Object/Controls

by setivi In reply to VB6 and ADODC Object/Con ...

The question was auto-closed by TechRepublic

Collapse -

VB6 and ADODC Object/Controls

by setivi In reply to VB6 and ADODC Object/Con ...

This question was auto closed due to inactivity

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums