homepage Welcome to WebmasterWorld Guest from 54.166.255.168
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Professional Webmaster Business Issues
Forum Library, Charter, Moderators: LifeinAsia & httpwebwitch

Professional Webmaster Business Issues Forum

    
Calling Multiple Access DB's (sql)
i want to display records from multiple db's
HoMeR

10+ Year Member



 
Msg#: 391 posted 11:43 am on May 30, 2002 (gmt 0)

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 ?

 

JuDDer

10+ Year Member



 
Msg#: 391 posted 12:31 pm on May 30, 2002 (gmt 0)

You just need to create 3 recordsets - each one querying one database for the information you want.

Grumpus

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 391 posted 12:57 pm on May 30, 2002 (gmt 0)

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.

HoMeR

10+ Year Member



 
Msg#: 391 posted 2:03 pm on May 30, 2002 (gmt 0)

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

Grumpus

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 391 posted 2:51 pm on May 30, 2002 (gmt 0)

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.

HoMeR

10+ Year Member



 
Msg#: 391 posted 3:38 pm on May 30, 2002 (gmt 0)

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 ;)

txbakers

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



 
Msg#: 391 posted 4:02 pm on May 30, 2002 (gmt 0)

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.

HoMeR

10+ Year Member



 
Msg#: 391 posted 5:59 pm on May 30, 2002 (gmt 0)

till today it was my understanding that setCon= was a absolute command so therefore i couldn't use setCon2= (?)

Grumpus

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 391 posted 6:22 pm on May 30, 2002 (gmt 0)

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

;)

G.

HoMeR

10+ Year Member



 
Msg#: 391 posted 6:26 pm on May 30, 2002 (gmt 0)

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

this is a GooD truely Helping Forum ! :)

Grumpus

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 391 posted 6:32 pm on May 30, 2002 (gmt 0)

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.

HoMeR

10+ Year Member



 
Msg#: 391 posted 8:37 pm on May 30, 2002 (gmt 0)

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 ! ;)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Professional Webmaster Business Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved