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

    My New database is created utilizing an adox.catalog object. I could creste a table in this format as well. I have another "Source" database whos recordset I have made changes in. I can pass this modified recordset all around the planet to textboxes XML Strerams (Thanks for the help I didnt get with that) abd to discnnected recordsets. I am having a problem setting getting these changes to the new database. I can set a connection to the new dbs. But I cant pass the modified recordset to it. Updatebatch with the required locktype doesnt seem to save the data. I am trying to avoid looping through recreating the 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<BR>

  2. #2
    Join Date
    Dec 1969

    Default Am I missing something?

    Seems like you do a lot of processing that isn&#039;t necessary.<BR><BR>

Posting Permissions

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