/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Maybe a stupid question ??
Fra : Dag Eriksen


Dato : 16-01-03 13:43

This might be very simple, but it is a large problem for me :

I have 2 Access MDB files on a Web server (using Frontpage 2002) in a folder
called /fpdb.
I am trying to create a query in one of the MDB's using data from the other
MDB,
but I can't make this work. I think I have tried almost everything.

I can be solved by only using one MDB file, but this is not a good solution
to me.

If anyone knows the answer to this, I will be most greatful.

Dag Eriksen





 
 
Jakob Andersen (16-01-2003)
Kommentar
Fra : Jakob Andersen


Dato : 16-01-03 14:04

Dag Eriksen wrote:
> I have 2 Access MDB files on a Web server (using Frontpage 2002) in a folder
> called /fpdb.
> I am trying to create a query in one of the MDB's using data from the other
> MDB,
> but I can't make this work. I think I have tried almost everything.

It hard to figure otu what your problem is but basically you need to
make a connectionobject to each database.

--
Jakob Andersen


Jesper Stocholm (16-01-2003)
Kommentar
Fra : Jesper Stocholm


Dato : 16-01-03 14:54

Jakob Andersen <jakob@effectus.dk> skrev:
>Dag Eriksen wrote:
>> I have 2 Access MDB files on a Web
>>server (using Frontpage 2002) in a folder
>> called /fpdb.
>> I am trying to create a query in one
>>of the MDB's using data from the other
>> MDB,
>> but I can't make this work. I think
>>I have tried almost everything.
>
>It hard to figure otu what your
>problem is but basically you need to
>make a connectionobject to each database.

it should also be possible to make a connection from one Access-
database to the other. The access to the other resources in the
other database would be transparent and work as if accessing a
table or query directly.

I am not sure, though, if this requires physical access to the
server in question.



--
Jesper Stocholm
http://stocholm.dk
Mangler du en ingeniør-bog, så kig på http://usedbooks.dk


TH (16-01-2003)
Kommentar
Fra : TH


Dato : 16-01-03 14:58

Hi,

"Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
news:_NxV9.11514$CG6.204221@news4.e.nsc.no...

> If anyone knows the answer to this, I will be most greatful.

Why not just open one DB in Access? Make a link to the other DB's table and
you're off in ASP...no problems.

Regards,
TH



TH (19-01-2003)
Kommentar
Fra : TH


Dato : 19-01-03 02:08

Hi,

"TH" <th@cogito.dk> skrev i en meddelelse
news:3e26ba5b$0$128$edfadb0f@dtext02.news.tele.dk...

> Why not just open one DB in Access? Make a link to the other DB's table
and
> you're off in ASP...no problems.

Heres what I mean, given 2 Access DB's:

1. Open DB1 in Access.
2. Right-click in the "tables" view.
3. Choose "Link tables" or something like that (not import)
4. Choose DB2 and then the Tabel in question.
5. Specify a table name.

Now you have a table in DB1 that "points" to DB2. The data is still in DB2,
ie, if you change or update the table in DB2 the data is automatically
changes in DB1 and vice versa.

You can adress the table via ASP in DB1 as any other table.

Hope this brings you further,
/TH


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 11-01-2003



Jesper Stocholm (19-01-2003)
Kommentar
Fra : Jesper Stocholm


Dato : 19-01-03 12:32

TH wrote :

> Hi,
>
> "TH" <th@cogito.dk> skrev i en meddelelse
> news:3e26ba5b$0$128$edfadb0f@dtext02.news.tele.dk...
>
>> Why not just open one DB in Access? Make a link to the other DB's
>> table
> and
>> you're off in ASP...no problems.
>
> Heres what I mean, given 2 Access DB's:
>
> 1. Open DB1 in Access.
> 2. Right-click in the "tables" view.
> 3. Choose "Link tables" or something like that (not import)
> 4. Choose DB2 and then the Tabel in question.
> 5. Specify a table name.
>
> Now you have a table in DB1 that "points" to DB2. The data is still in
> DB2, ie, if you change or update the table in DB2 the data is
> automatically changes in DB1 and vice versa.
>
> You can adress the table via ASP in DB1 as any other table.

the problem wirh this approach - at least it was when I tried it last -
is that Access uses the specific path to the other db instead of just
using a relevant path. This means that there will be no problems when
doing this on the webserver itself. but if it is done locally - and then
the DBs are uploaded to the webserver, the specific path does no longer
validate - and the relations become useless.



--
Jesper Stocholm - http://stocholm.dk
www.asp-faq.dk: FAQ for dk.edb.internet.webdesign.serverside.asp
www.usenet.dk/netikette/citatteknik.html: Skriv under det du svarer på
Svar venligt til gruppen og ikke til mig privat !

TH (19-01-2003)
Kommentar
Fra : TH


Dato : 19-01-03 17:20

Hi,

"Jesper Stocholm"
<er.det.virkeligt.nødvendigt.at.medtage.min.emailadresse.i.svar.på.mine.indl
æg?@stocholm.invalid> skrev i en meddelelse

> the problem wirh this approach - at least it was when I tried it last -
> is that Access uses the specific path to the other db instead of just
> using a relevant path. This means that there will be no problems when
> doing this on the webserver itself. but if it is done locally - and then
> the DBs are uploaded to the webserver, the specific path does no longer
> validate - and the relations become useless.

Good point...I didnt know that....Hope you are following Dag, because this
is quite important :)

You can however specify another path (relative or absolute) after you have
linked the table. Choose to see system-objects in the "options"->"show"
dialog of Access....

You will then see a couple of system (hidden) tables. In these tables access
saves all specific information about well...everything actually :) Open the
"MSysObjects" table and inthere you will find the path to DB2....change it
to suit your needs on the webserver...

:)

/TH


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003



Dag Eriksen (20-01-2003)
Kommentar
Fra : Dag Eriksen


Dato : 20-01-03 08:50

Hello again !
It seems like were getting to the core of the problem.
I can not find "Choose to see system-objects in the "options"->"show"
> dialog of Access...." . Where are this menu alternatives ?
Regards,

Dag



"TH" <th@cogito.dk> skrev i melding
news:3e2ad015$0$144$edfadb0f@dtext02.news.tele.dk...
> Hi,
>
> "Jesper Stocholm"
>
<er.det.virkeligt.nødvendigt.at.medtage.min.emailadresse.i.svar.på.mine.indl
> æg?@stocholm.invalid> skrev i en meddelelse
>
> > the problem wirh this approach - at least it was when I tried it last -
> > is that Access uses the specific path to the other db instead of just
> > using a relevant path. This means that there will be no problems when
> > doing this on the webserver itself. but if it is done locally - and then
> > the DBs are uploaded to the webserver, the specific path does no longer
> > validate - and the relations become useless.
>
> Good point...I didnt know that....Hope you are following Dag, because this
> is quite important :)
>
> You can however specify another path (relative or absolute) after you have
> linked the table. Choose to see system-objects in the "options"->"show"
> dialog of Access....
>
> You will then see a couple of system (hidden) tables. In these tables
access
> saves all specific information about well...everything actually :) Open
the
> "MSysObjects" table and inthere you will find the path to DB2....change it
> to suit your needs on the webserver...
>
> :)
>
> /TH
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003
>
>



TH (20-01-2003)
Kommentar
Fra : TH


Dato : 20-01-03 08:58

Hi,

"Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
news:2UNW9.17799$Rc7.252390@news2.e.nsc.no...

> I can not find "Choose to see system-objects in the "options"->"show"
> > dialog of Access...." . Where are this menu alternatives ?

First of all...Do you have a "options"->"show" dialog?
It should be there...What version of Access are you using?

/TH



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003



Dag Eriksen (20-01-2003)
Kommentar
Fra : Dag Eriksen


Dato : 20-01-03 09:15

I found it !
So far so good, but trying to change it I got a message that this is not
allowed to change
this parameter. Any more tips ??

`Regards
Dag

"TH" <th@cogito.dk> skrev i melding
news:3e2babe8$0$121$edfadb0f@dtext02.news.tele.dk...
> Hi,
>
> "Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
> news:2UNW9.17799$Rc7.252390@news2.e.nsc.no...
>
> > I can not find "Choose to see system-objects in the "options"->"show"
> > > dialog of Access...." . Where are this menu alternatives ?
>
> First of all...Do you have a "options"->"show" dialog?
> It should be there...What version of Access are you using?
>
> /TH
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003
>
>



TH (20-01-2003)
Kommentar
Fra : TH


Dato : 20-01-03 09:37

Hi,

"Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
news:TeOW9.17805$Rc7.252522@news2.e.nsc.no...

> So far so good, but trying to change it I got a message that this is not
> allowed to change
> this parameter. Any more tips ??

In the menu "options" you have a sub-menu called "security". There you will
find antoher sub-menu called "user and group permissions" or something like
that. There you can see that "administrator" needs read/write access to the
MSystemObjects-database.

Dag: Make a copy of your Access database before altering this table :)

/TH




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003



Dag Eriksen (20-01-2003)
Kommentar
Fra : Dag Eriksen


Dato : 20-01-03 10:07

Even with changing the parameters as you describe, I am not able to change
the data.
("The control can not be edited. It is locked to replicationsystemcolumn
"Database") ???

Regards

Dag



"TH" <th@cogito.dk> skrev i melding
news:3e2bb51a$0$121$edfadb0f@dtext02.news.tele.dk...
> Hi,
>
> "Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
> news:TeOW9.17805$Rc7.252522@news2.e.nsc.no...
>
> > So far so good, but trying to change it I got a message that this is not
> > allowed to change
> > this parameter. Any more tips ??
>
> In the menu "options" you have a sub-menu called "security". There you
will
> find antoher sub-menu called "user and group permissions" or something
like
> that. There you can see that "administrator" needs read/write access to
the
> MSystemObjects-database.
>
> Dag: Make a copy of your Access database before altering this table :)
>
> /TH
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003
>
>



TH (20-01-2003)
Kommentar
Fra : TH


Dato : 20-01-03 11:11

Hi,

Well you got me thinking now...
Afaik there are only 2 ways to change this...1) via the Link-manager 2) via
Code.

Ad 1)
the link manager is not installed pr default. Run the Office/Access
installation again and you should be able to installa this.

Ad 2)
1. Make a new module. (eg "module1")
2. Insert the following 2 functions:

Function CheckAttachedTable(strTable As String, strNewPath As String) As
Integer

' Checks the named table and attempts to reattach it if
' it's not attached properly.
'
' In:
' strTable - table to check
' strNewPath - path to connect to if test fails
' Out:
' Return Value - True if successful, False otherwise.

Dim db As Database
Dim rst As Recordset

Set db = DBEngine.Workspaces(0).Databases(0)

On Error Resume Next
Set rst = db.OpenRecordset(strTable, DB_OPEN_DYNASET)

' Check for failure. If the OpenRecordSet failed, then
' attempt to reattach the table.
If Err <> 0 Then
If Not ReAttachTable(strTable, strNewPath) Then
MsgBox "Could not reattach table '" & strTable & "'"
CheckAttachedTable = False
End If
Else
rst.Close
CheckAttachedTable = True
End If
On Error GoTo 0
End Function

Private Function ReAttachTable(strTable As String, strNewPath As String) As
Integer

' Reattaches the named table to the named path
' In:
' strTable - table to reattach
' strNewPath - path to attach to
' Out:
' Return value: True if successful, False otherwise

Dim db As Database
Dim tdf As TableDef

' Assume success.
ReAttachTable = True

Set db = DBEngine.Workspaces(0).Databases(0)
Set tdf = db.TableDefs(strTable)

' If Connect is blank, it's not an attached table
If Len(tdf.Connect) > 0 Then
tdf.Connect = ";DATABASE=" & strNewPath

' The RefreshLink might fail if the new path
' isn't OK. So trap errors inline.
On Error Resume Next
tdf.RefreshLink
ReAttachTable = (Err = 0)
On Error GoTo 0
End If
End Function




3. Call "CheckAttachedTable(strTable As String, strNewPath As String)"
somewhere...eg a new button in a form. something like this:

Dim testInt as Integer
testInt = CheckAttachedTable("linkedname", "c:\blabla\db2.mdb")


Well...If this doesnt help you im kinda lost....
Try searching the web for "access edit msysobjects" or something like
that...there should be lots of routines outthere to deal with this
issue...:)

I have read your original post again, and to be honest....the quick method
is to adress both databases/tables in ASP...I would do it that way....and
just ignore the last 5-6 postings here :)

You know that you use eg: "set conn=....." in ASP right? Then just make a
new connection at the same time to DB2....like this "set conn2=....."

?

/TH






"Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
news:G%OW9.17811$Rc7.252659@news2.e.nsc.no...
> Even with changing the parameters as you describe, I am not able to change
> the data.
> ("The control can not be edited. It is locked to replicationsystemcolumn
> "Database") ???
>
> Regards
>
> Dag
>
>
>
> "TH" <th@cogito.dk> skrev i melding
> news:3e2bb51a$0$121$edfadb0f@dtext02.news.tele.dk...
> > Hi,
> >
> > "Dag Eriksen" <erjo-as@online.no> skrev i en meddelelse
> > news:TeOW9.17805$Rc7.252522@news2.e.nsc.no...
> >
> > > So far so good, but trying to change it I got a message that this is
not
> > > allowed to change
> > > this parameter. Any more tips ??
> >
> > In the menu "options" you have a sub-menu called "security". There you
> will
> > find antoher sub-menu called "user and group permissions" or something
> like
> > that. There you can see that "administrator" needs read/write access to
> the
> > MSystemObjects-database.
> >
> > Dag: Make a copy of your Access database before altering this table :)
> >
> > /TH
> >
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003
> >
> >
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10-01-2003



Søg
Reklame
Statistik
Spørgsmål : 177560
Tips : 31968
Nyheder : 719565
Indlæg : 6408946
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste