C++\SQL ODBC:从表中获取行 [英] C++\SQL ODBC: Get row from table
本文介绍了C++\SQL ODBC:从表中获取行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从表 'Account' 中获取 rpw 'AID'.
I'm trying to get the rpw 'AID' from the table 'Account'.
SQLCHAR AID;
wsprintf(String, "select [AID] from [Account] where [UserID] = '%s'", User);
Sql.RetCode = Sql.Execute(String);
Sql.RetCode = Sql.Fetch();
Sql.Clear();
sprintf(String, "Here my result: %s", SQL RETURN!);
MsgBox(String);
How can i get the [AID] from the table [Account] ? (For User 'idohadar')
推荐答案
我看到你使用了一些对象库来调用 ODBC 函数.我不知道这个库,但我使用来自原始"API 的 ODBC 或将它包装在我的类中.
I see that you use some object library to call ODBC function. I do not know this library but I use ODBC from "raw" API or wrap it in my classes.
Raw API 在以下位置有很好的描述:http://www.easysoft.com/developer/languages/c/odbc-tutorial-fetching-results.html
Raw API is very well described on: http://www.easysoft.com/developer/languages/c/odbc-tutorial-fetching-results.html
您必须为值准备缓冲区,然后调用 SQLFetch()
,然后从该缓冲区读取.
You must prepare buffer for values then call SQLFetch()
and then read from that buffer.
这篇关于C++\SQL ODBC:从表中获取行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文