0

Edit MY goal is this, I need to do read data from a Remedy Database using a VB .Net app. /Edit I am trying to read data from the AR System ODBC driver in a VS 2010 VB windows form. I have added a connection in the data connections via , a system dsn, connection string pulled from a working excel data pull, and built a connection string based via the wizard. I can test connection, and it comes back 'test connection succeeded'. When I click ok and the Data connection goes to my server explorer, it expands to tables, view, and procedures and viewing/refreshing those causes errors such as: Column 'Table_Cat' does not belong to table Tables. Error [im00][ar system odbc driver] not supported

I am aware there is the api out there, however this has a problem in that the api acts like a login session from the client, which limits you to one login session. This not feasible for the task at hand as the user needs to remain logged into remedy, and the app I'm writing will be read only for data.

The goal is a billboard app that will display certain tickets, kind of like a stock ticker. There will be no editing of ticket data from remedy, I just need to read the tickets and provide tallies and alerts for our helpdesk.

It seemed so easy when I sat down, but now 4 hours later and a mind numbing amount of irrelevant google results, I'm almost wondering if I'm going to have to report back that it cannot be done with out the api and creating more remedy accounts. Not having to create additional remedy accounts was part of of the request put to me. Tags: Visual Studio 2010 BMC AR System Remedy ODBC VB.NET

Update So I have done the code by hand and now seem a few steps forward, but still blind.

Ok, so if i export my excel query it looks like this from the dqy file export.dqy

DRIVER={AR System ODBC Driver};ARServer=xxxxxx;ARServerPort=xxxxx;UID=xxxx;PWD=xxxx;ARAuthentication=;SERVER=NotTheServer
SELECT "EN:HelpDesk"."Company Name", "EN:HelpDesk"."Call Status", "EN:HelpDesk"."Caller Region", "EN:HelpDesk"."Next Action", "EN:HelpDesk"."Detailed Description(FTS)", "EN:HelpDesk".Device, "EN:HelpDesk"."Submitted-by", "EN:HelpDesk".Impact, "EN:HelpDesk"."Arrival Time", "EN:HelpDesk"."Call Id", "EN:HelpDesk".Market  FROM "EN:HelpDesk" "EN:HelpDesk"  WHERE ("EN:HelpDesk"."Call Status"<>'Closed') AND ("EN:HelpDesk"."Submitted-by"<>'nis') AND ("EN:HelpDesk".Impact='High') AND ("EN:HelpDesk".Market='DCIN') AND ("EN:HelpDesk"."Caller Region"<>'UK')

First off, these quotes look wrong to me, but it seems to work because if I leave them, executing the command doesn't fail, however it doesn't return data to my data grid view in vb. Second the EN:Helpdesk looks odd to me but again same results as the quotes. I have tried changing the quotes to brackets [ ] but receive errors once I do.

Here is my code:

VB Code

Imports SystemM My goal 
Imports System.Data
Imports System.Data.Odbc
Imports System.Data.SqlClient

Sub Main()

    Dim sql As String

    Dim connectionString As String = "DRIVER={AR System ODBC Driver};ARServer=xxx;ARServerPort=xxx;UID=xxx;PWD=xxx;ARAuthentication=;SERVER=NotTheServer"

    sql = "SELECT ""EN:HelpDesk"".""Company Name"", ""EN:HelpDesk"".""Call Status"", ""EN:HelpDesk"".""Caller Region"", ""EN:HelpDesk"".""Next Action"", ""EN:HelpDesk"".""Detailed Description(FTS)"", ""EN:HelpDesk"".Device, ""EN:HelpDesk"".""Submitted-by"", ""EN:HelpDesk"".Impact, ""EN:HelpDesk"".""Arrival Time"", ""EN:HelpDesk"".""Call Id"", ""EN:HelpDesk"".Market  FROM EN:HelpDesk WHERE (""EN:HelpDesk"".""Call Status""<>'Closed') AND (""EN:HelpDesk"".""Submitted-by""<>'nis') AND (""EN:HelpDesk"".Impact='High') AND (""EN:HelpDesk"".Market='DCIN') AND (""EN:HelpDesk"".""Caller Region""<>'UK')"

    Dim bindingSource1 As New BindingSource()

    Me.SQLDS_reportresults.DataSource = bindingSource1

    Dim myAdapter = New OdbcDataAdapter(sql, connectionString)

    Dim commandBuilder As New OdbcCommandBuilder(myAdapter)

    Dim table As New DataTable()

    table.Locale = System.Globalization.CultureInfo.InvariantCulture

    myAdapter.Fill(table)

    bindingSource1.DataSource = table

    Me.SQLDS_reportresults.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader)

End Sub

Project is a windows forms with a button to activate main(), a textbox (textbox1) and a datagridview(SQLDS_reportresults).

As the code stands, this causes no errors, but my datagridview never populates. Since there are no errors, I'm inclined to think my connection is working , and that my command is being executed,making my problem lay in code, however given the funky use of quotes and en:helpdesk in the sql command, I'm also concerned that is malformed and causing the where portion to return no results.

Anyone have any suggestions / ideas?

I need a way to display these results in app, and right now I don't care how just as long as I can see some data at all.

I've been googling and looked at the vb examples in the api zip but that is not related to opening a odbc connection and I found that of little help in my research.

I almost feel like I'm missing something simple or obvious.

When i run odbcad32.exe my ar system odbc driver shows 7.00.01.02 which is what I assume is installed on everyones machines as I used the remedy install set provided to me by the IT/Software admins to build this dev box.

4

0 回答 0