Connecting Tech Pros Worldwide Help | Site Map

Database linking

  #1  
Old November 13th, 2005, 01:41 PM
That Guy via AccessMonster.com
Guest
 
Posts: n/a
Public Sub ShipmentRequest_Click()

I am trying to be able to access records from another database table, from
the one that I am currently in. This is the code that I have so far that
allows me to change the recordset to the one that I need, but What I need to
know is how to change it back. I have tried using the same code to change it
back with a different strSQL name(the table name of the data I originally
used) but that does not seem to work. I am not opposed to getting the data
from the second table a different way, but I am at a loss for ideas as
nothing seems to work well.

Thanks in advance


Dim cnnCustomerdbnew As New ADODB.Connection
Dim customerdbnew As New ADODB.Recordset
Dim strSQL As String

With cnnCustomerdbnew
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "\\Backup\hosted files\CustomerDatabase\customerdbnew.mdb",
"admin"
End With

strSQL = "customerdbnew"
With customerdbnew
Set .ActiveConnection = cnnCustomerdbnew
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strSQL
End With
Set Me.Recordset = customerdbnew

(or if you know of any way were I don't set the recordset, but I still can
access the fields inside the new table that would also work (better if
possible))


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Linking Soulspike answers 10 January 31st, 2008 11:25 PM
Database Linking (DBF) ekcunha answers 4 September 26th, 2007 09:30 PM
Database linking Bryan via AccessMonster.com answers 1 November 13th, 2005 01:41 PM
DataBase linking Bryan via AccessMonster.com answers 18 November 13th, 2005 01:38 PM
DataBase linking Bryan via AccessMonster.com answers 0 November 13th, 2005 01:38 PM