Hi Al!
Well, when you go into the SQLExcel_LoadMainFormtoGetSQLStatement like that
Dim oSQLExcel As Object
sConnectionString = "provider=SQLOLEDB.1;server=OEBFASRV02;Trusted_Connection=Yes;Database=pubs"
sSQLStatement = "Select * From employee"
Debug.Print "Original Connection String = " & sConnectionString
Debug.Print "Original SQL Statement = " & sSQLStatement
Set oSQLExcel = CreateObject("SqlExcel.Connect"
If oSQLExcel.SQLExcel_LoadMainFormtoGetSQLStatement(sConnectionString, sSQLStatement) Then
Debug.Print "New Connection String = " & sConnectionString
Debug.Print "New SQL Statement = " & sSQLStatement
Else
Debug.Print "GetSQLStatementFromSQLExcel returned False: Function Failed"
End If
Set oSQLExcel = Nothing
there is no way to execute the passed "Select * from employee" inside sql-excel, except changing the profile to the "pubs" profile, losing the query doing that. This doesn't work
as well for other connection strings like "provider=MSDASQL.1;Driver={SQL Server};server=OEBFASRV02;Trusted_Connection=Yes;Database=pubs"
When trying to paste or embed immediately, the form gives the message "There is no active connection open !", so I basically can't do anything without connecting to another profile....
I'm also quite sure that it's not good to have paste/embed available when being invoked by SQLExcel_LoadMainFormtoGetSQLStatement, as it offers an inconsistent way of leaving the form and - alas - already found anm inconsistency: When connecting to another profile after the invocation (which makes paste/embed possible) and changing the query to something else, then pressing paste returns to the caller of SQLExcel_LoadMainFormtoGetSQLStatement, however passing the original query, NOT the changed one..
Concerning the ADODB connection string changing issue, I'd really strongly suggest to use the workaround (storing the "true" connection string somewhere else), as the strangely modified connection string makes it very hard to reuse that connection string somewhere else. For the lookup of the profile, that doesn't have to be as long as connecting to the passed connection string works properly (see above).
Sorry, but I can't offer any more help...
I've also tested the newest version (from 29. june), the error message on startup (when having no profiles set) is gone, thanks for that, there is however still the err message (probably falling into the same category as the "execute immediately after invocation" issues), when hitting the execute button: "Index out of valid bounds (GetDataStringFromConnectionsArray" plus the already known err message right after that: "Operation not allowed on a closed object (CommandExecute_Click)"
-regards,
Roland