Open a disconnected ADO Recordset in C++ -


I am trying to clone an ADO Reconcert Clone with a database query in the disconnected Recordset. The CIT code is based on the functioning function which I use in classic ASP and cloning work. Unless I try to open a new recordcase, I get an error message that does not allow connection to be used. ("Die Verbindunga Cannes Knit Works Varden, Um Deseen Wergeng Oszufueran. SIT antidar Grasloson Oder in Desamenman Hang Uniglitie.")

Since it works in VBSPT, I have to reproduce the simple VBSP code code > R. Open without any arguments in c ++

What would be the correct syntax for opening this disconnected record, which was created without a connection in the database?

_RecordsetPtr DataService :: CloneRecordset (_RecordsetPtr rs, bool withValues) {_RecordsetPtr newRs; HRESULT hr = newR Create (__Undoff (Recorcet)); If (FAILED (HR)) return nullptr; NewRs-> Cursor location = adUseClient; Try (for long periods of time; i rs- & gt; field-> calculation; ++ i) {FieldPtr f = rs- & gt; Fields- & gt; GetItem (i); Longer qualities = adFldIsNullable | AdFldMayBeNull | AdFldUpdateable; If (F-> Attributes and Adfold columns) Features. = AdFldKeyColumn; NewRs-> Field- & gt; Attachments (f-> Name, F-> Type, F-> Defined Size, (Field Attendance) Attributes); } If (with values) {newRs-> putref_Source (NULL); // throws error newRs-> Open (vtMissing, vtMissing, adOpenUnspecified, adLockUnspecified, adCmd not specified); Copyrecrescate (RS, NRS); NewRs- & gt; UpdateBatch (adAffectAll); } New returns; } Catch (_com_error & CE) {ShowComErrorMessageBox (CE, newRs); } Hold (...) {AF message box ("unknown error has occurred."); } Return nullptr; }

The described error message appears, neither the connection nor the source nor the Fields are correctly defined. The initialization of variable long m is missing in the code above.

To change it, for (long I = 0; i field-> calculation; ++ i) it works And line newRs-> gt; Putref_Source (NULL);


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -