Home All Groups Group Topic Archive Search About

Connecting to non SQL database

Author
30 Mar 2005 4:29 PM
Jake
When i try to connect to an old UniVerse database (using their ODBC drivers)
visual studio (vc# standard) gives me an error saying something to the effect
that this version can only connect to Access/SQL databases.  What version of
visual c# or visual studio do I need to connect to any ODBC complient
database?

Author
30 Mar 2005 5:40 PM
Mark Rae
"Jake" <J***@discussions.microsoft.com> wrote in message
news:A0500797-3912-4DDD-8225-71D832B0D8BA@microsoft.com...

> When i try to connect to an old UniVerse database (using their ODBC
> drivers)
> visual studio (vc# standard) gives me an error saying something to the
> effect
> that this version can only connect to Access/SQL databases.  What version
> of
> visual c# or visual studio do I need to connect to any ODBC complient
> database?

Nothing to do with Visual Studio per se. I would suggest that you ditch ODBC
and use OleDb instead. The following link should assist:

http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForUniDataAndUniVerse
Author
30 Mar 2005 6:33 PM
Paul Clement
On Wed, 30 Mar 2005 08:29:05 -0800, "Jake" <J***@discussions.microsoft.com> wrote:

¤ When i try to connect to an old UniVerse database (using their ODBC drivers)
¤ visual studio (vc# standard) gives me an error saying something to the effect
¤ that this version can only connect to Access/SQL databases.  What version of
¤ visual c# or visual studio do I need to connect to any ODBC complient
¤ database?

The Server Explorer in the Standard version is somewhat limited, however you can still use code to
create your connections. If you have an ODBC driver you should be able to use the
Microsoft.Data.ODBC namespace. There is an example below:

   Public Sub ConnectToOracleODBC()

        Dim ODBCConnection As New Microsoft.Data.Odbc.OdbcConnection


        ODBCConnection.ConnectionString = "DRIVER={Microsoft ODBC for Oracle};" & _
                                            "SERVER=ServerName;" & _
                                            "UID=userID;PWD=password;"

        ODBCConnection.Open()

    '...
    '...
    '...

        ODBCConnection.Close()

    End Sub


Paul
~~~~
Microsoft MVP (Visual Basic)

AddThis Social Bookmark Button