Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5357

Help with DBBindCol function

$
0
0

Hi, 

 

I'm currently programming a SQL statement with DBBindCol... I'm getting either ASCI characters out or garbage characters. I'm wondering if there anything special I need to do to make sure it reads the right variable I selected in the statement. Are the two pointers just to show the address of the variable I selected. If so, what does DBFetchNext(hstmt) do? I get an error everytime I run it. Thanks!

Below is a sample of what I'm trying to do:

 

hstmt = DBActivateSQL(hdbc, "SELECT TESTINDEX,SESSIONID,OPERATOR,SN,TESTDATE,TEST_TIME,ERRNUM,ERRDES,SYSNUM FROM REG_RESULTSTABLE WHERE SN = 260887");
if(hstmt <= 0)
{
ShowError();
}
int nrec = 0;
nrec = DBNumberOfRecords(hstmt);
if(nrec<=0)
{
ShowError(); /*goto Error;*/
}

resCode = DBBindColInt(hstmt,1,&Test_Index,&T_Index);
if(resCode != DB_SUCCESS)
{
ShowError(); /*goto Error;*/
}

while((resCode = DBFetchNext(hstmt)) == DB_SUCCESS) 

{

sprintf(TI,"%d \t\t\t",Test_Index);

 SetCtrlVal(panelHandle,PANEL_lstregulator,TI);

}


Viewing all articles
Browse latest Browse all 5357

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>