cancel
Showing results for 
Search instead for 
Did you mean: 

help connecting visual basic with sql server

Former Member
0 Kudos

Hello

i need to connect a visual basic 2010 express application with the sql server database which runs our business one application, any ideas how i do this?

thanks

dave

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dave,

you can use the most generic connection object ODBC.

This is an example from MS to connect to a dataset by code

' Visual Basic

    Public Sub ConnectToOdbc()

        Dim conn As New System.Data.Odbc.OdbcConnection

        ' TODO: Modify the connection string and include any

        ' additional required properties for your database.

        conn.ConnectionString = & _

            "FIL=MS Access;DSN=valid data source name"

        Try

            conn.Open()

            ' Insert code to process data.

        Catch ex As Exception

            MessageBox.Show("Failed to connect to data source")

        Finally

            conn.Close()

        End Try

    End Sub

But you'll typically NEVER EVER connect to productive SAP system's database directly. No one would allow that.

There are "official" ways to gather data out of the SAP systems like SAP NetWeaver Gateway as an generic approach.

Best regards,

Matthias

Former Member
0 Kudos

thanks

this is something i am working on against a developement database to "prove" it could be done, but clearly wouldn't do this to a production system

cheers

dave

Answers (0)