Connecting Tech Pros Worldwide Help | Site Map

Database linking

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 12:41 PM
That Guy via AccessMonster.com
Guest
 
Posts: n/a
Default Database linking

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.