tables missing form odbc connection in visual studio 2013

we are on mas100-2016 advanced,  sp2, in excel the odbc tables show up. I have tried all types of odbc connections in visual studio 2013 and there is nothing listed under the tables so there is no way to write queries and such, can someone please explain how to fix this. i have attached to access with no problem and the odbc woorks in excel and in crystal and I am using admin rights for the connection, thank you, Tj 

  • 0
    32bit vs 64bit problem?
  • 0 in reply to 49153
    I have tried both versions 32 bit odbc and 64 bit odbc with no difference, thank you for the thought, Tj
  • 0
    Have you tried to write SQL Pass Through Queries in Access and then connect to the Access database with visual studio?
  • 0 in reply to BigLouie
    Hi Louie
    I have have directly connected to the sql server with no problem but in this project I need to have up to date information
  • 0
    Are you trying to use Visual Studio's server explorer functionality?

    If so, have you instead tried connecting to the db directly with Microsoft's ODBC library and running hand-written queries?

    For example:

    ...
    queryString = "SELECT * from BM_BillDetail";

    using (OdbcConnection connection = new OdbcConnection(Dsn))
    {
    OdbcCommand command = new OdbcCommand(queryString, connection);

    connection.Open();
    ...
  • 0 in reply to IT4Metallics
    If you write SQL Specific Pass Through Queries and then connect Visual Studio to that database the data will be live and up to date.
  • 0 in reply to Dandar
    when I right click on the odbc connection to run a query I get an error (module could not be found) and I believe it is caused by not seeing the tables, is there another way?
  • 0 in reply to IT4Metallics

    Some other folks in the forums may have a better solution; but I always just hand-write my queries and connect "manually" using Microsoft's ODBC .NET Managed Provider.

    Here is my simple function (written in C#) which executes a raw SQL query (queryString) on a Sage 100 database and returns the result as a DataTable:

    ...

    using System.Data.Odbc;

            public DataTable GetTableSqlQuery(string queryString)
            {

                DataTable table = new DataTable();

                using (OdbcConnection connection = new OdbcConnection(Dsn))
                {
                    OdbcCommand command = new OdbcCommand(queryString, connection);

                    connection.Open();

                    try
                    {
                        OdbcDataReader reader = command.ExecuteReader();
                        // set column names
                        for (int i = 0; i < reader.FieldCount; i++)
                            table.Columns.Add(reader.GetName(i));

                        // add data
                        while (reader.Read())
                        {
                            DataRow row;
                            row = table.NewRow();

                            for (int i = 0; i < reader.FieldCount; i++)
                                row[reader.GetName(i)] = reader[i].ToString();

                            table.Rows.Add(row);

                        }
                        reader.Close();

                    }
                    catch (OdbcException e)
                    {
                        throw e;
                    }
                }
                return table;
            }

    Is this what you're trying to accomplish?