TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
li chen
NA
1
4.4k
How to return ADO recordset from a C# dll to Excel VBA.
Aug 14 2014 9:39 PM
I am working on a small project to conver vba class into C# library.
The vba class is a sql database operation one, it connects to database by using ADODB.Connection, return data Recordset in VBA.
Question is how do I return Recordset type in C# library?
public Recordset SqlExecuteQuery(string psSQL)
{
ADODB.Recordset loRs = new ADODB.Recordset();
try
{
loRs.Open(psSQL,conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1);
}
catch (Exception e)
{
throw new Exception("Error " + e.Message + " encountered when executing the following query :" + psSQL);
}
return loRs;
}
but it returns error message in vba.
Error Arguments are of the wrong type, ar out of acceptable range, or are in conflict with one another. encountered when executing the following query: select * from tb*****
Dim loRS As ADODB.Recordset
Set loRS = goDB.SqlExecuteQuery(psSQL)
Reply
Answers (
1
)
How to Bind Dropdownlist using Stored Procedure In MVC 5?
Making POST or GET calls using Angularjs and Breeze .