带有 SQL Server Compact Edition 3.5 的经典 ASP ADODB 在命令参数中不起作用
我是 SQL CE 新手。我正在使用经典 ASP 进行编程,使用 ADODB.Connection 连接 SQL CE。我已经创建了表并尝试从 ASP 插入数据。我尝试了3种方式。
- 内联插入语句 [例如 INSERT INTO tblName(col1, col2) VALUES(1,2)] (已完成)
- 参数化插入语句 [例如 INSERT INTO tblName(Col1) VALUES(?)] (已完成) )。我添加了命令参数并提供了值。
- 带有多个参数的参数化插入语句(失败)
我不知道多个参数有什么问题。当 Cmd.Execute 语句运行时,它向我抛出未处理的错误。
“远程过程调用失败且未执行。”
我进行了大量的 Google 搜索以找出问题所在。但没有用。我没有得到任何线索。
请帮我解决这个问题
-Ganesh
I'm new to SQL CE. I'm programming in Classic ASP, connecting the SQL CE using ADODB.Connection. I have created the table and trying to insert data from the ASP. I tried in 3 ways.
- The inline insert statement [e.g. INSERT INTO tblName(col1, col2) VALUES(1,2)] (WORKED)
- The parameterized insert statement [e.g. INSERT INTO tblName(Col1) VALUES(?)] (WORKED). I added the Command Parameter and supplied the value.
- The parameterized insert statement with more than one param ( FAILED)
I dont know what wrong with multiple parameters. It throwing me the unhandled error when the Cmd.Execute statement runs.
"The remote procedure call failed and did not execute."
I did lots of Google to find out the issue. But no use. I didn't get any clues.
Please help me to solve this issue
-Ganesh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否将 Command 对象的 CommandType 属性设置为 adCmdText ?
我就是这样做的:
have you set the CommandType property of the Command object to adCmdText?
thats how i do this:
我想用我自己的示例代码来补充这个问题,该代码也失败了,所以我也在寻找相同的答案。请注意,此示例是用 C++ 编写的,因此,虽然我不能直接质疑 ulluoink 发布的答案,但 VB 答案对我和(我怀疑)OP 不起作用。
我希望有人可以提供一个解决方案,或者明确地确认由于某些 ADO/CE 限制它根本无法工作。
I would like to supplement this question with my own sample code, which also fails and so I too am looking for the same answer. Note that this sample is in C++ and so, while I cannot directly dispute the answer posted by ulluoink, a VB answer won't work for me and (I suspect) the OP.
I hope someone can offer a solution, or categorically confirm that it simply won't work because of some ADO/CE limitation.