2

I am trying to select some fields from .tps file but I am getting the following error: enter image description here

This is my Code:

 privatevoidbutton1_Click(objectsender,EventArgse)
{
stringcon=ConfigurationManager.AppSettings["WinDSS_Connection"];
try
{
OdbcConnectionconn=newOdbcConnection(con);
OdbcCommandcmd=newOdbcCommand();
OdbcDataAdapterda=newOdbcDataAdapter();
DataTabledt=newDataTable();
conn.Open();
cmd=conn.CreateCommand();
cmd.CommandType=CommandType.Text;
cmd.CommandText="SELECT Store_No,Store_Name,Store_City,Store_State FROM SYSMST";
da.SelectCommand=cmd;
da.Fill(dt);
dgv1.DataSource=dt;
conn.Close();

}
catch(Exceptionex)
{
MessageBox.Show(ex.Message.ToString());
}
}

My app.config

<appSettings>
<addkey="WinDSS_Connection"value="DRIVER=SoftVelocityTopspeeddriver(*.tps);DBQ=T:\Rambo\Store231WinDss\windss\DATA;Extension=tps;Oem=N;NullEmptyStr=N;"/>
</appSettings>

how I have my driver configured on ODBC data source administrator

enter image description here

When I use Top Scan and look at the same table there is one record in it, so why is it not displaying that result on the datagridview and what is this ISAM Table please help me out as I am out of options here.

CodeMan
  • 133
  • 3
  • 19

1 Answers1

0

I will try to help you with my experience first, there is a lot of things strange with this driver and very few information on the net, and i have lost a lot of time to figure how to work.

your sql is: SELECT Store_No,Store_Name,Store_City,Store_State FROM SYSMST

My hints:

  1. Be sure do configured the driver in 32bit and not 64bit of the ODBC, it´s not work on 64 bits, also C# need be compiled in 32bits, try to test the ODBC with other tools just to make sure it´s work like Excel import table from ODBC, it´s help me a lot to find how to work with this TopSpeed Driver.

  2. Do you have an SYSMST.tps file on the path T:\Rambo\Store231WinDss\windss\DATA ?, When you use sql like "FROM AAA" the AAA is the name of the tps and not the table of the DCT of Clarion the driver just know files not DCT.

  3. What the data type of the fields Store_No,Store_Name,Store_City and Store_State because the driver have problems with some datatype, try to make you sql with one field each time to find witch field have a problem (for example byte,short,date,array make problem), try to avoid "Select *" because the fields data types(some tables will work fine but the most and the big tables it´s hard).

  4. Try to make this select just to see if it´s work "SELECT Store_Name FROM SYSMST" because of string work fine

  5. Don´t compare TPS ODBC SQL language with other´s famous SQL systems like SQL-Server, because here will got a lot of errors no clear and hard to figure why.

  6. Even when some code that I wrote on C# with error handling the code was on try and catch, but the C# exe is crashed (without catching the error) on my tries.

Just hoping that I helped you. The last things, A lot of trying and a lot of good luck.

Y. M.
  • 107
  • 9