VB 6.0 - ODBC Problem - Asked By Prabal Mukherjee on 16-May-01 12:38 AM

I want to set up an ODBC DSN in run time by checking existing drivers after distributing my application.

Is this a desktop app? - Asked By Robbe Morris on 16-May-01 03:28 PM

...If so, I'll try to dig through my old oracle desktop app code and see if I can find this because there is a way to do it.  If not, why not use a DSNless connection.  There's a sample in the Tips & Tricks section in Search Content.
However, a DSNless connection should work as long as the user has SQL Plus installed on the desktop.

Haven't worked on an Oracle desktop app in a little over a year so I'll need to look it up in the Robbe archives.

rdoRegisterDataSource Method (Remote Data) - Asked By Abhijit Devale on 18-Jul-14 01:09 PM

The rdoRegisterDataSource Method may be used to do this. I am putting some extracts from MSDN Help edition. you can find more about it there. Please see if this suffices ur problem.
rdoRegisterDataSource Method enters connection information for an ODBC data source into the Windows Registry.

The following example illustrates use of the rdoRegisterDataSource method to create a new ODBC data source entry.

Private Sub RegisterDataSource()
Dim en As rdoEnvironment
Dim cnTest As rdoConnection
Dim strAttribs As String
' Build keywords string.
strAttribs = "Description=" _
        & "SQL Server on server SEQUEL" _
  & Chr$(13) & "OemToAnsi=No" _
  & Chr$(13) & "SERVER=SEQUEL" _
  & Chr$(13) & "Network=DBNMPNTW" _
  & Chr$(13) & "Database=WorkDB" _
  & Chr$(13) & "Address=\\SEQUEL\PIPE\SQL\QUERY"
' Create new registered DSN.
rdoEngine.rdoRegisterDataSource "Example", _
         "SQL Server", True, strAttribs
' Open the database.
Set en = rdoEngine.rdoEnvironments(0)
Set cnTest = en.OpenConnection( _
  dsname:="Example", _
  Prompt:=rdDriverNoPrompt, _

End Sub

Reply - Asked By Prabal Mukherjee on 18-Jul-14 01:09 PM

but the matter is I want to get the content of strAttribs
variable if i am using MS Access as backend.
the MSDN refernede fails to give me the right direction
to build the string for Access.
Check out the Tips & Tricks on the home page. - Asked By Robbe Morris on 24-May-01 08:58 AM
...For a sample DSNLess connection to MS Access.
Screw the DSN.  It's overhead you really don't need and will have a small performance hit over using a DSNLess connection.