
Data environment designer problem
Hi,
How can I provide the connection string to the data environment designer
without getting a prompt first???
I have a VB project with a connection to an Access 2000 db in the Data
Environment designer. Works fine.
Before distributing the project, I would like to make sure the application
can handle a changing database path.
I have a procedure that looks for the database path in an .ini file. It lets
the user select a database if no correct path is found and shuts down the
application if no database can be bound to the application.
Major problems implementing this: I have cleared the database path in the
database designer (the connection property that is left is
"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False"). So when
running the project, it looks for a provider and database BEFORE the form
load, so I can't use that to set the connection. I guess I need the
WillConnect event of the connection to set the database path. When I put:
Private Sub cnnCodeLib_WillConnect(ConnectionString As String, UserID As
String, Password As String, Options As Long, adStatus As
ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection)
ConnectionString = gsHandleConnection
End Sub
"gsHandleConnection" will insert "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & dbPath & ";Persist Security Info=False".
I STILL get a prompt for the data source (Ms Jet OLE DB initialisation
prompt).
Help greatly appreciated.
waldo