环境:
win2k server+vc6.0+Sql Server2000企业版现因在vc的程序中需要对远程数据库进行操作我的方案:
调用本地的存储过程"aaa"异地数据库的操作~!我采用的是链接服务器的方法,我用查询分析器执行存储过程"aaa"一切正常,也能对远程数据库进行操作。好了,问题来了。当我在vc的程序中调用dbcmd()函数来执行存储过程"aaa",程序就报错:"SQL Server常规错误,请检查来自SQL Ser的消息"
但是当我用dbcmd()对本地操作的存储过程时,一些正常,而且也能正确操作~!这是什么原因,那为大哥告诉我~!!
解决方案 »
- 怎么知道COM口收到多少字节数据!!!!还有关于serialPort类
- 为什么一打印程序自动关闭?
- post数据后关于session的保持
- 奇怪的问题,CArray竟然没有RemoveAt,InsertAt方法。晕死了
- 请问如何将一个vc6中文工程进行英文版本编译?
- _RecordsetPtr对象使用完毕之后是否需要显式调用Release()函数?
- 小妹来这儿也有一定日子了,在这里给大家拜个早年,感谢大家的帮助!
- WIN2000域用户的添加
- 关于电子网站
- 为什么在debug中明明某个double类型变量a的值是123.4,而表达式a==123.4及a>=123.4都返回false?
- 紧急求助:如何制作浮动面板?
- 基础问题~~!!
Initializes a stored procedure or a remote stored procedure.Syntax
RETCODE dbrpcinit (
PDBPROCESS dbproc,
LPCSTR rpcname,
DBSMALLINT options );Arguments
dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ Microsoft® SQL Server™ process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.
rpcname
Is a pointer to the name of the stored procedure to be invoked.
options
Is a 2-byte bitmask of options for stored procedures. Specify 0 to indicate no options. The following options are available.
Option Description
DBRPCRECOMPILE Recompiles a stored procedure before it is executed.
DBRPCRESET Cancels a single stored procedure or a batch of stored procedures. If rpcname is specified, that new stored procedure is initialized after the cancellation is complete.
Returns
SUCCEED or FAIL.
Call dbrpcparam for each parameter of the stored procedure that does not have a default value.
Repeat steps 1 and 2 for each stored procedure in the batch.
Call dbrpcsend or dbrpcexec to send the entire stored procedure batch to SQL Server.
Call dbsqlok to wait for SQL Server to start returning results.
Call dbresults to process the results from each stored procedure.
If dbresults returns SUCCEED, call dbnextrow until it returns NO_MORE_ROWS to process the normal results from the stored procedure. If dbresults returns NO_MORE_RPC_RESULTS, and you want to retrieve status number and return-parameter information returned by the stored procedure, follow the steps given later. Repeat Step 6 until dbresults returns NO_MORE_RESULTS.
If you want to retrieve status number and return-parameter information returned by the last stored procedure in the batch, follow the steps given later.