Re: duplicating dbase entries in seperate dbases
A better solution would be to put it all in one database, however you don't
want to do that.
So..... When you insert a record into DB1, also insert into DB2.
Dim cnDB1
Dim cnDB2
cnDB1.Open sConnectionStringToDB1
cnDB2.Open sConnectionStringToDB2
cnDB1.Execute "INSERT INTO etc."
cnDB2.Execute "INSERT INTO etc."
To update from DB1 to DB2 do.....
Dim RS
Set RS=cnDB1.Execute("SELECT [username], [password] from tableInDB1")
Do While not RS.EOF
cnDB2.Execute "INSERT INTO etc..."
RS.MoveNext
Loop
However, if either DB1 or DB2 were SQL server, you'd be better off to use
DTS to import the data.
If either DB1 or DB2 are Access you can Link tables to the other, and do an
append query.
"Alistair" <news@*remove*alistairb.co.uk> wrote in message
news:vvr3l4ihlg6b7a@corp.supernews.com...[color=blue]
> just a quickie before I go away and write some very ugly code that doesn't
> work..
>
> I have a dbase containing login details for 21,000 members. I also have a
> forum that I am about to implement.
>
> When the user gets to the main site, he has to login (this is done by
> checking his credentials against DB1) When he is logged in, all his[/color]
details[color=blue]
> are stored in session variables. Clicking on the forum link will take him[/color]
to[color=blue]
> the forum where he has to log-in or register. Currently, the forum checks
> cookies to see if there is a valid name and password and then checks these
> against it's own DB (herein called DB2) or requires the user to
> login/register
>
> I plan to modify the forum so that the login is bypassed and the forum
> accepts the current session name and password as the login. (This is so[/color]
that[color=blue]
> all names on the site main site, chat, forum etc are uniform, i.e Dave47[/color]
in[color=blue]
> a chat room, is Dave47 in the forum, is Dave47 in the members area etc)
>
>
> so...what I need to do (if you're still with me) is.
>
> When a new user registers on the main site, his details are put into DB1
> *and* DB2. , can I have two data sources open at once?
>
> The reason I need two DBs is that the information in DB1 is a lot less[/color]
than[color=blue]
> is needed by the forum in DB2.
>
> Also how can I copy selected fields from DB1 (name, password for existing
> users) into DB2? like I said..there's 21,000 and to do it manually would
> take forever.
>
>
> hope all that made sense.
>
> many thanks
>
>
>
>
>[/color] |