Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Edited Issue: Using ADODB recordsets [69]

$
0
0
HI!
How to properly add ADODB.Recordset? Is it possible?
```
static void Main(string[] args)
{
ADODB.Recordset _recordset = new ADODB.Recordset();
_recordset.Fields.Append("Id", ADODB.DataTypeEnum.adInteger);
_recordset.Fields.Append("Name", ADODB.DataTypeEnum.adVarChar, 20);
_recordset.Open(System.Reflection.Missing.Value
, System.Reflection.Missing.Value
, ADODB.CursorTypeEnum.adOpenStatic
, ADODB.LockTypeEnum.adLockOptimistic, 0);
_recordset.AddNew(Type.Missing, Type.Missing);
_recordset.Fields["Name"].Value = "Test";
Microsoft.ClearScript.Windows.VBScriptEngine engine = new Microsoft.ClearScript.Windows.VBScriptEngine();
engine.AllowReflection = true;
engine.AddHostObject("RS", _recordset);
engine.Execute("RS.MoveFirst"); // Ok
engine.Execute("RS.Fields(\"Name\").Value = \"Ok\""); // Error
}
```
Thanks!

Viewing all articles
Browse latest Browse all 2297

Trending Articles



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