Welcome to WebmasterWorld Guest from 23.23.46.20

Forum Moderators: LifeinAsia & httpwebwitch

Calling Multiple Access DB's (sql)

i want to display records from multiple db's

   
11:43 am on May 30, 2002 (gmt 0)

10+ Year Member



Hi,
ive been searching the web, and couldn't find any answers documented. Not even Here.
I'me using a guestbook, forum, and add-url databases (and then some) i would like to show the last db entry's into my main/index page.
I'me starting to think that this can only be done if i merge the db's, this i dont really want to do, since some could get really Big. is there a sollution ?
12:31 pm on May 30, 2002 (gmt 0)

10+ Year Member



You just need to create 3 recordsets - each one querying one database for the information you want.
12:57 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A little more on that...

Make sure you've got a field in the tables that will relate to each other in all the databases and make sure they match. I've got my site set up with about 5 different databases as it's really a drag to add something new when you've got to download and upload something that is 50 megs or more in size. Split it up and it's much more manageable. You can use your autonumber in the "key" database, but you'll have to create a field in the "sub" or non-key database to match in with the field in the key. That way you don't have to create a bunch of empty rows in the event that information isn't added to both tables simultaneously (and makes it so you don't HAVE to update/add records simultaneously).

Good Luck.

G.

2:03 pm on May 30, 2002 (gmt 0)

10+ Year Member



Thanx JuDDeR & Grumpus,

JuDDeR, what would be the correct "code" to do this?;

Set adoCon = Server.CreateObject("ADODB.Connection")
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/guestbook/db1.mdb")
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/forum/db2.mdb")

Grumpus, my db's are not related to each other in any way, is there really a need to connect them ?

Thanx Again

2:51 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope - if they're not related, don't worry about it. :)

You need to change the strCon= to something else in the second string. Matching strings will make the second one get a connection and cancel out the first connection.

G.

3:38 pm on May 30, 2002 (gmt 0)

10+ Year Member



with the risk of making a fool of myself, the following question; you mean i can actually change the strCon= in strCon2= ??

i gave up on this issue, but will start a (new) test-round 2night.

Again, Thanx Again ;)

4:02 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Sure you can have multiple variables in the document.

Just be sure to use the proper connection to open the proper database.

That's why you are setting the connection string to a variable - you can use it throughout the file. With multiple variables, you can open any number of connections.

5:59 pm on May 30, 2002 (gmt 0)

10+ Year Member



till today it was my understanding that setCon= was a absolute command so therefore i couldn't use setCon2= (?)
6:22 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



setCon and strCon are two different things, aren't they? You set your connection to the connection string.

;)

G.

6:26 pm on May 30, 2002 (gmt 0)

10+ Year Member



ah! sh*t, typing error !, thanx all

this is a GooD truely Helping Forum ! :)

6:32 pm on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might also want to check speeds on this, but I've found that using a Jet4.0 driver to connect to an access database is better (faster) than the microsoft drivers. Give it a try and see if there's a difference for you. May not be very noticable until it gets big, though...

G.

8:37 pm on May 30, 2002 (gmt 0)

10+ Year Member



Thanx G., ime using the jet driver at this time, must say it goes smooth (1100records), and i dont display more than 12 records with pictures on each page: 85% pageviews lower/equal 1sec. :)
using background image too ! ;)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month