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

Commented 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!
Comments: Fixed in [Version 5.4.1](https://clearscript.codeplex.com/SourceControl/changeset/c2200cbd6b77300484927906517035caef3ae323).

Viewing all articles
Browse latest Browse all 2297