Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 12-31-2003, 04:09 PM   #1
Member (10 bit)
 
CorruptedSanitY's Avatar
 
Join Date: Jul 2002
Location: Columbia, SC
Posts: 567
Question connect between databases

My friends and I are currently working with 2 databases that are joined together by information. I guess you can say that the databases are each owned by seperate entities. But are joined by "foriegn key ". Information from both sides that are linked together.


We need a Java or VB or some type of code that when the foriegn key is clicked, it permits us to view the other databases's schedule or info.

For example, lets say one database containspersonal information about a person, such as his phoine number, address , DOB and so on. In this first database, the primary key of this person is his ID number. The other database has nothing to do with the first database, the only thing in common is the ID number of that person.

Now we want some type of code that permits us to view that person's personal information by simply clicking on his ID number in the 2nd database ( the one that does not have his personal info ).

I guess we shouldl ask if in the beggining is this available thru Database ?


If not,

Can we do it using any type of code like VB or Java or other code to do the above.
__________________
AMD Athlon 64 X2 Dual @ 6000+
Zalman CNPS9700 NT Heat Sink
Asus M2N-Plus SLI Vista Edition motherboard
Corsair XMS2 DHX twin pack - 2x2gb @ 800mhz
Windows XP Pro SP2 32 bit
GigaByte Nvidia 8600GT 512 video card
Seagate 100 GB Sata 8mb HD
Seagate 320 GB Sata 8mb HD

1394B (aka Firewire 800) PCI card

-[ et tu Brutus ? ]-

Last edited by CorruptedSanitY; 12-31-2003 at 04:12 PM.
CorruptedSanitY is offline   Reply With Quote
Old 12-31-2003, 04:18 PM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
What database program are you using?
doctorgonzo is offline   Reply With Quote
Old 01-01-2004, 03:06 AM   #3
Member (10 bit)
 
CorruptedSanitY's Avatar
 
Join Date: Jul 2002
Location: Columbia, SC
Posts: 567
doctorgonzo thanks for taking time to reply!..

We are using Access!
CorruptedSanitY is offline   Reply With Quote
Old 01-01-2004, 10:18 AM   #4
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Yes, then you can easily view another database's info. Do you know any Visual Basic? Are you more familiar with ADO or DAO?
doctorgonzo is offline   Reply With Quote
Old 01-02-2004, 02:01 AM   #5
Member (10 bit)
 
CorruptedSanitY's Avatar
 
Join Date: Jul 2002
Location: Columbia, SC
Posts: 567
Doctor, we are relatively familiar with VB.
CorruptedSanitY is offline   Reply With Quote
Old 01-02-2004, 05:11 AM   #6
Member (10 bit)
 
CorruptedSanitY's Avatar
 
Join Date: Jul 2002
Location: Columbia, SC
Posts: 567
We dont know what ADO nor DAO
CorruptedSanitY is offline   Reply With Quote
Old 01-02-2004, 10:35 AM   #7
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
How much VB you need to know will depend on how sophisticaed you want everything to be. I don't think I can just give you the code, because it will depend very much on what you want to do. I would suggest looking through the Access help system for information on recordsets, connections, and opening them.
doctorgonzo is offline   Reply With Quote
Old 01-02-2004, 02:35 PM   #8
Member (10 bit)
 
CorruptedSanitY's Avatar
 
Join Date: Jul 2002
Location: Columbia, SC
Posts: 567
Dr.Gonzo, couldnt you like give us a general code and then we can work with it?
CorruptedSanitY is offline   Reply With Quote
Old 01-02-2004, 02:48 PM   #9
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Here are some ADO connection strings, used to open an ADODB.Connection object:

http://www.able-consulting.com/MDAC/...orMicrosoftJet

Once you have the connection open, you can pass it to a ADODB.Recordset object:

http://www.scit.wlv.ac.uk/appdocs/ch...pen_method.htm

What you do with the recordset is then up to you. You can walk through it, use it as a recordsource on a form, or pretty much whatever you want.

To use these objects, you have to have "Microsoft ActiveX Data Objects 2.X library" checked in the References section of the VB editor.
doctorgonzo is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:44 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2