I want to use the GPConnNet.dll library to be able to connect to the database
but I am missing some values in the configuration, mainly in the following sentence
"
Dim cn As New System.Data.Odbc.OdbcConnection
Dim cmd As New System.Data.Odbc.OdbcCommand
Dim rst As System.Data.Odbc.OdbcDataReader
Dim resp As Integer
Dim GPConnObj As Microsoft.Dexterity.GPConnection
'Call Startup
resp = Startup()
'Create the connection object
GPConnObj = New Microsoft.Dexterity.GPConnection
'Initialize
GPConnObj.Init("<Key1>", "<Key2>")
'Make the connection. Use the connection string to set default
'database.
cn.ConnectionString = "DATABASE=TWO"
GPConnObj.Connect(cn, "LocalServer", "LESSONUSER1", "access")
'Check the return code
If (GPConnObj.ReturnCode And ReturnCodeFlags.SuccessfulLogin) = _
ReturnCodeFlags.SuccessfulLogin Then
'Specify the command to execute - Retrieve all customers
cmd.Connection = cn
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select * From RM00101"
rst = cmd.ExecuteReader
rst.Read()
'Display the name of the first customer
MsgBox(rst.Item(1).ToString())
'Close the connection
cn.Close()
Else
MsgBox("Login failed.")
End If
'Dispose of the connection object
GPConnObj = Nothing
'Call Shutdown
resp = Shutdown()
End Sub
", What keys do I need for this DLL to Work?
the version of GP that I am using is GP2016 with Sqlserver Version 2012 R2