How to connect disconnected Recordset to new Jet D

Results 1 to 2 of 2

Thread: How to connect disconnected Recordset to new Jet D

  1. #1

    Default How to connect disconnected Recordset to new Jet D

    &nbsp;<BR>Firstly This isn&#039;t for any production project. I am just trying to solidify my understanding of a few ADO concepts. So if ANYONE can help PLEASE give me a moment. & I respectfully Thank you.<BR><BR>My New database is created utilizing an adox.catalog object. <BR>I could create a table in this format as well. But Should I have to???<BR> I have another "Source" database <BR>whos recordset I have made changes in. I can pass this modified recordset all <BR>around the planet to textboxes XML Streams (Thanks for the help I didnt get with that) <BR>and to disconnected recordsets. I am having a problem setting getting these changes to the new database.<BR> I can set a connection to the new dbs. But I cant pass the modified recordset to it. Updatebatch with <BR>the required locktype doesnt seem to save the data. I am trying to avoid looping through & recreating the <BR>entire changed RS in the new DBS either by opening a stream (ADODB) saved as adpersistxml or loadfromfile.<BR> I cant be on the cutting edge this much.. someone has to know how to pull this off correctly. PLEASE&#062;&#062;<BR><BR><BR>Public Function XMLToADO(sXML As String)<BR> On Error GoTo do_err<BR> &#039;sXMLFile<BR> Dim XRs1 As New ADODB.Recordset<BR> Dim XStr1 As New ADODB.Stream<BR> Dim conn1 As New ADODB.Connection<BR> <BR> Dim XRs2 As New ADODB.Recordset<BR> &#039; Dim XStr2 As New ADODB.Stream<BR> Dim conn2 As New ADODB.Connection<BR> <BR>&#039;**************************************<B R> Call subNewDBT &#039;snewT is resulting new database<BR>&#039;******************************** ******<BR> <BR>XRs1.CursorType = adOpenStatic<BR>XRs1.LockType = adLockBatchOptimistic<BR> &#039;conn1.CursorLocation = adUseClient<BR> &#039;conn1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & sSourceFile<BR> <BR> &#039; "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & sSourceFile<BR><BR>XRs2.CursorType = adOpenStatic<BR>XRs2.LockType = adLockBatchOptimistic<BR> conn2.CursorLocation = adUseClient<BR> conn2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & snewT<BR><BR> <BR>&#039;======================================== ========<BR> With XRs1<BR> &#039;.ActiveConnection = conn1<BR> .CursorType = adOpenKeyset<BR> .LockType = adLockBatchOptimistic<BR> End With<BR> <BR> &#039; sTableName<BR> &#039; "select * from" & " " & sTableName, conn1, adOpenStatic<BR> &#039; sXMLFile, adPersistXML<BR> <BR> sXMLFile<BR> <BR> &#039; sXMLFile<BR> &#039;XStr1.WriteText sXMLFile<BR><BR> XStr1.WriteText sXMLFile<BR> XStr1.Position = 0<BR> &#039; XStr1.SaveToFile sXMLFile, adSaveCreateOverWrite<BR> <BR> <BR> <BR> XStr1, adPersistXML<BR> <BR> With XRs2<BR> .ActiveConnection = conn2<BR> .CursorType = adOpenKeyset<BR> .LockType = adLockBatchOptimistic<BR> End With<BR> <BR>&#039; sXMLFile, , , , adCmdFile<BR> XStr1<BR>XRs2.UpdateBatch<BR><BR>Set XMLToADO = XRs2<BR>&#039;==================================== ============<BR>&#039;Set frmData.Adodc1.Recordset = XRs1<BR>Set frmData.Adodc1.Recordset = XRs2<BR>frmData.DataGrid1.Refresh<BR>Set XRs1 = Nothing<BR>Set XStr1 = Nothing<BR>&#039;Set XRs2 = Nothing<BR>&#039;Set XStr2 = Nothing<BR>&#039;================================= ===============<BR>do_err:<BR><BR> Select Case Err.Number<BR> Case 0<BR> &#039;MsgBox "Friggin Whoo Hoo Now" & vbNewLine _<BR> &#039;& "Where&#039;d it Go to "<BR> Case Is &#060;&#062; 0<BR> MsgBox Err.Description<BR> Exit Function<BR> End Select<BR> <BR>End Function

  2. #2
    Join Date
    Dec 1969

    Default Check your other thread in ASP QA

    You may also want to post this at . The moderators play with this sort of thing much more than most people here do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts