Alter datasource/connection string when opening a VB form 
Author Message
 Alter datasource/connection string when opening a VB form

Quote:

>I thought just doing a <Ado Data Control>.ConnectionString = "<connection
>info>" in the Form_Initalize would change the database path before anything
>happened with the data on the form.

For ADO, you must follow the new connection string with a refresh of the
recordset:
VisProfiles!datPrimaryRS.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source="
& strDBPath
 VisProfiles!datPrimaryRS.Refresh

For DE, you open the control following specification of the new connect
string:
DataEnvironment1.VisFile3.ConnectionString = strConnect1 & strDBPath
DataEnvironment1.rsNameVis.Open (strRS1Select & strDBSort)

Hope this helps,

Eldon



Thu, 22 Mar 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Alter ADO Connection String..........URGENT

2. Connection Open command without setting up a ODBC user datasource

3. Forms Collection: Using it to Open Forms by Passing the Form Name as a String Variable

4. Opening a Form when form name is a text string

5. opening a form using a string containing form name

6. Opening a Form when form name is a text string

7. How do I open a form by passing the Name of the form as a string

8. How to open form when all I have is name of form in a string

9. view report from VB with two datasource connections

10. Opening the connection string.

11. connection string.open error

12. open connection string error

 

 
Powered by phpBB® Forum Software