|
 |
asp_databases thread: DLL registering and connection string
Message #1 by "Pappas Nikos" <pappas@c...> on Fri, 22 Dec 2000 04:28:57 -0800
|
|
Hi all
I have 2 questions
First forgive my English ( not the best you can find )
If in a server there's a dll registered and I make some change in the code
and I replace it with a mew one same name and version , does it have to be
reregistered again?
and a second question:
The dll updates info in an access.mdb 2000
and the folder where the database is stored has assigned users permissions
for the files in it
lets say IUSER for writing to the mdb ,is there a special way to use this
UserID
in the connection string when compiling the dll in VB.6 ?
Is it necessary to use the UserID in the dll's class code or this has to
deal only with ASP code?
I have used
adoConnection.Open connectString,"IUSER",""
or just
adoConnection.Open connectString
but does not work
I use cursor type adOpenDynamic, adLockOptimistic for the recordset.
The dll works fine with both connection Strings in my PWS but not in the
internet server.
Thanks For your time
If anyone can help with some info P L E A S E do
as it is a long time I cant solve this problem
Best wishes for Christmas
Pappas Nikos
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by Stephane_Dattenny@D... on Fri, 22 Dec 2000 01:53:26 -0600
|
|
Hi
1) You don't have to register it again only if you change the code. If you
change properties, methods (parameters or name), delete a method, add a new
one, you break the compatibility (a new CLSID is created for your class).
Then you must register it again. If you use MTS, you must delete the classes
from the package and import them again, or use the mtxreg.....exe in MTS
directory (I don't know how to use it).
2) The connection's username and the file permissions username are 2
different things. The connection's username is important only when you use
Access integrated security (when you define users who can access the
database). If you want to write to you're Access database, you must provide
full access to the directory and the mdb file). If it works on your PWS and
not on IIS (that's what I suppose), maybe a dll is missing on the
IUSR_<SERVER_NAME> doesn't have full access to the DB. What's the error
message ?
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 22 December 2000 13:29
To: ASP Databases
Subject: [asp_databases] DLL registering and connection string
Hi all
I have 2 questions
First forgive my English ( not the best you can find )
If in a server there's a dll registered and I make some change in the code
and I replace it with a mew one same name and version , does it have to be
reregistered again?
and a second question:
The dll updates info in an access.mdb 2000
and the folder where the database is stored has assigned users permissions
for the files in it
lets say IUSER for writing to the mdb ,is there a special way to use this
UserID
in the connection string when compiling the dll in VB.6 ?
Is it necessary to use the UserID in the dll's class code or this has to
deal only with ASP code?
I have used
adoConnection.Open connectString,"IUSER",""
or just
adoConnection.Open connectString
but does not work
I use cursor type adOpenDynamic, adLockOptimistic for the recordset.
The dll works fine with both connection Strings in my PWS but not in the
internet server.
Thanks For your time
If anyone can help with some info P L E A S E do
as it is a long time I cant solve this problem
Best wishes for Christmas
Pappas Nikos
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #3 by "Pappas Nikos" <pappas@c...> on Fri, 22 Dec 2000 15:56:43 -0800
|
|
Dear Stephane
Thank you very much for your response
I tried to say too much in my previous email so here I go again
I have a site hosted somewhere and my host protects the data folder
by using read and write permission for this folder to SOMEUSER.
From ASP side script to update recordsets I use
-----------
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,SOMEUSER,""
-----------
and works fine.
In my Dll's class to compile for making the Dll
----------
Public Function setVisitor(ByVal firstName As Variant, ByVal lastName As
Variant, ByVal Email As Variant) As Variant
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String
Dim objLocalContext As ObjectContext
Dim objServer As ASPTypeLibrary.Server
Set objLocalContext = GetObjectContext()
Set objServer = objLocalContext("Server")
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & objServer.MapPath("../data/Visitors.mdb")
& ";Persist Security Info=False"
Set adoConnection = CreateObject("ADODB.Connection")
Set adoRecordset = CreateObject("ADODB.Recordset")
adoConnection.Open connectString,"SOMEUSER",""
adoRecordset.Open "SELECT * FROM SiteVisitors", adoConnection, _
adOpenDynamic, adLockOptimistic
----------
etc.etc.
I can send the whole code if you like too
it is from Wrox begginning vb6 programming
So if I change the code like
adoConnection.Open connectString,"ADMIN",""
The dll needs to be reregistered?
Is there any other way to use the UserID?
I am very possitive that the connection is the problem.
Can you recommend refferences to my dll?
I use
------------------------------------------------------------
Visual Basic For Applications MSVBVM60.DLL
Visual Basic runtime objects and procedures MSVBVM60.DLL\3
Visual Basic objects and procedures
Microsoft Transaction Server Type Library
Microsoft ActiveX Data Objects 2.1
Microsoft Active Server Pages Object Library
Microsoft Active Server Pages 2.0 ObjectContext Class Type Library
------------------------------------------------------------
The error was
unable to start application the file does not exist or opened exclissively
by annother user
Thanks again Stephanie
Best wishes to everyone for
Christmas and 2001
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Thursday, December 21, 2000 11:53 PM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Hi
1) You don't have to register it again only if you change the code. If you
change properties, methods (parameters or name), delete a method, add a new
one, you break the compatibility (a new CLSID is created for your class).
Then you must register it again. If you use MTS, you must delete the classes
from the package and import them again, or use the mtxreg.....exe in MTS
directory (I don't know how to use it).
2) The connection's username and the file permissions username are 2
different things. The connection's username is important only when you use
Access integrated security (when you define users who can access the
database). If you want to write to you're Access database, you must provide
full access to the directory and the mdb file). If it works on your PWS and
not on IIS (that's what I suppose), maybe a dll is missing on the
IUSR_<SERVER_NAME> doesn't have full access to the DB. What's the error
message ?
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 22 December 2000 13:29
To: ASP Databases
Subject: [asp_databases] DLL registering and connection string
Hi all
I have 2 questions
First forgive my English ( not the best you can find )
If in a server there's a dll registered and I make some change in the code
and I replace it with a mew one same name and version , does it have to be
reregistered again?
and a second question:
The dll updates info in an access.mdb 2000
and the folder where the database is stored has assigned users permissions
for the files in it
lets say IUSER for writing to the mdb ,is there a special way to use this
UserID
in the connection string when compiling the dll in VB.6 ?
Is it necessary to use the UserID in the dll's class code or this has to
deal only with ASP code?
I have used
adoConnection.Open connectString,"IUSER",""
or just
adoConnection.Open connectString
but does not work
I use cursor type adOpenDynamic, adLockOptimistic for the recordset.
The dll works fine with both connection Strings in my PWS but not in the
internet server.
Thanks For your time
If anyone can help with some info P L E A S E do
as it is a long time I cant solve this problem
Best wishes for Christmas
Pappas Nikos
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #4 by Stephane_Dattenny@D... on Fri, 22 Dec 2000 09:22:23 -0600
|
|
1) You don't have to register the dll again (because you only chenged the
code)
2) As I said in my previous mail, there is a difference with security: the
one where the host protects data folder use NT security. The one you use to
access your database use integrated MS Access security; Then you don't have
to specify the username when you open your connection. The problem with your
error message is probably because the database is set in an exclusive mode.
Open the database with MS Access, go to Tools/Options/Advanced. Check
Default Open Mode to SHARED.
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 23 December 2000 00:57
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Dear Stephane
Thank you very much for your response
I tried to say too much in my previous email so here I go again
I have a site hosted somewhere and my host protects the data folder
by using read and write permission for this folder to SOMEUSER.
From ASP side script to update recordsets I use
-----------
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,SOMEUSER,""
-----------
and works fine.
In my Dll's class to compile for making the Dll
----------
Public Function setVisitor(ByVal firstName As Variant, ByVal lastName As
Variant, ByVal Email As Variant) As Variant
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String
Dim objLocalContext As ObjectContext
Dim objServer As ASPTypeLibrary.Server
Set objLocalContext = GetObjectContext()
Set objServer = objLocalContext("Server")
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & objServer.MapPath("../data/Visitors.mdb")
& ";Persist Security Info=False"
Set adoConnection = CreateObject("ADODB.Connection")
Set adoRecordset = CreateObject("ADODB.Recordset")
adoConnection.Open connectString,"SOMEUSER",""
adoRecordset.Open "SELECT * FROM SiteVisitors", adoConnection, _
adOpenDynamic, adLockOptimistic
----------
etc.etc.
I can send the whole code if you like too
it is from Wrox begginning vb6 programming
So if I change the code like
adoConnection.Open connectString,"ADMIN",""
The dll needs to be reregistered?
Is there any other way to use the UserID?
I am very possitive that the connection is the problem.
Can you recommend refferences to my dll?
I use
------------------------------------------------------------
Visual Basic For Applications MSVBVM60.DLL
Visual Basic runtime objects and procedures MSVBVM60.DLL\3
Visual Basic objects and procedures
Microsoft Transaction Server Type Library
Microsoft ActiveX Data Objects 2.1
Microsoft Active Server Pages Object Library
Microsoft Active Server Pages 2.0 ObjectContext Class Type Library
------------------------------------------------------------
The error was
unable to start application the file does not exist or opened exclissively
by annother user
Thanks again Stephanie
Best wishes to everyone for
Christmas and 2001
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Thursday, December 21, 2000 11:53 PM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Hi
1) You don't have to register it again only if you change the code. If you
change properties, methods (parameters or name), delete a method, add a new
one, you break the compatibility (a new CLSID is created for your class).
Then you must register it again. If you use MTS, you must delete the classes
from the package and import them again, or use the mtxreg.....exe in MTS
directory (I don't know how to use it).
2) The connection's username and the file permissions username are 2
different things. The connection's username is important only when you use
Access integrated security (when you define users who can access the
database). If you want to write to you're Access database, you must provide
full access to the directory and the mdb file). If it works on your PWS and
not on IIS (that's what I suppose), maybe a dll is missing on the
IUSR_<SERVER_NAME> doesn't have full access to the DB. What's the error
message ?
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 22 December 2000 13:29
To: ASP Databases
Subject: [asp_databases] DLL registering and connection string
Hi all
I have 2 questions
First forgive my English ( not the best you can find )
If in a server there's a dll registered and I make some change in the code
and I replace it with a mew one same name and version , does it have to be
reregistered again?
and a second question:
The dll updates info in an access.mdb 2000
and the folder where the database is stored has assigned users permissions
for the files in it
lets say IUSER for writing to the mdb ,is there a special way to use this
UserID
in the connection string when compiling the dll in VB.6 ?
Is it necessary to use the UserID in the dll's class code or this has to
deal only with ASP code?
I have used
adoConnection.Open connectString,"IUSER",""
or just
adoConnection.Open connectString
but does not work
I use cursor type adOpenDynamic, adLockOptimistic for the recordset.
The dll works fine with both connection Strings in my PWS but not in the
internet server.
Thanks For your time
If anyone can help with some info P L E A S E do
as it is a long time I cant solve this problem
Best wishes for Christmas
Pappas Nikos
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #5 by "Pappas Nikos" <pappas@c...> on Sat, 23 Dec 2000 00:01:28 -0800
|
|
Best Regards Stephane
your comment helped me clear a few shadows in my knowledge base
many of those still there to clear out but its a great help.
If I change other things like references I suppose I have to reregister.
Updating the mdb from ASP page:
For the connection string in the ASP sidescript if I don't specify
UserID it does not work (writing to the mdb) only this way works
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,IUSER,""
The responce from my host when I asked about security replied
"we checked the files under /DATA ( visitor.mdb) and given IUSER user write
permissions"
you recommend I don't need this IUSER In the Dll code?
Thanks once more
Happy Holidays
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Friday, December 22, 2000 7:22 AM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
1) You don't have to register the dll again (because you only chenged the
code)
2) As I said in my previous mail, there is a difference with security: the
one where the host protects data folder use NT security. The one you use to
access your database use integrated MS Access security; Then you don't have
to specify the username when you open your connection. The problem with your
error message is probably because the database is set in an exclusive mode.
Open the database with MS Access, go to Tools/Options/Advanced. Check
Default Open Mode to SHARED.
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 23 December 2000 00:57
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Dear Stephane
Thank you very much for your response
I tried to say too much in my previous email so here I go again
I have a site hosted somewhere and my host protects the data folder
by using read and write permission for this folder to SOMEUSER.
>From ASP side script to update recordsets I use
-----------
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,SOMEUSER,""
-----------
and works fine.
In my Dll's class to compile for making the Dll
----------
Public Function setVisitor(ByVal firstName As Variant, ByVal lastName As
Variant, ByVal Email As Variant) As Variant
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String
Dim objLocalContext As ObjectContext
Dim objServer As ASPTypeLibrary.Server
Set objLocalContext = GetObjectContext()
Set objServer = objLocalContext("Server")
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & objServer.MapPath("../data/Visitors.mdb")
& ";Persist Security Info=False"
Set adoConnection = CreateObject("ADODB.Connection")
Set adoRecordset = CreateObject("ADODB.Recordset")
adoConnection.Open connectString,"SOMEUSER",""
adoRecordset.Open "SELECT * FROM SiteVisitors", adoConnection, _
adOpenDynamic, adLockOptimistic
----------
etc.etc.
I can send the whole code if you like too
it is from Wrox begginning vb6 programming
So if I change the code like
adoConnection.Open connectString,"ADMIN",""
The dll needs to be reregistered?
Is there any other way to use the UserID?
I am very possitive that the connection is the problem.
Can you recommend refferences to my dll?
I use
------------------------------------------------------------
Visual Basic For Applications MSVBVM60.DLL
Visual Basic runtime objects and procedures MSVBVM60.DLL\3
Visual Basic objects and procedures
Microsoft Transaction Server Type Library
Microsoft ActiveX Data Objects 2.1
Microsoft Active Server Pages Object Library
Microsoft Active Server Pages 2.0 ObjectContext Class Type Library
------------------------------------------------------------
The error was
unable to start application the file does not exist or opened exclissively
by annother user
Thanks again Stephanie
Best wishes to everyone for
Christmas and 2001
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Thursday, December 21, 2000 11:53 PM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Hi
1) You don't have to register it again only if you change the code. If you
change properties, methods (parameters or name), delete a method, add a new
one, you break the compatibility (a new CLSID is created for your class).
Then you must register it again. If you use MTS, you must delete the classes
from the package and import them again, or use the mtxreg.....exe in MTS
directory (I don't know how to use it).
2) The connection's username and the file permissions username are 2
different things. The connection's username is important only when you use
Access integrated security (when you define users who can access the
database). If you want to write to you're Access database, you must provide
full access to the directory and the mdb file). If it works on your PWS and
not on IIS (that's what I suppose), maybe a dll is missing on the
IUSR_<SERVER_NAME> doesn't have full access to the DB. What's the error
message ?
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 22 December 2000 13:29
To: ASP Databases
Subject: [asp_databases] DLL registering and connection string
Hi all
I have 2 questions
First forgive my English ( not the best you can find )
If in a server there's a dll registered and I make some change in the code
and I replace it with a mew one same name and version , does it have to be
reregistered again?
and a second question:
The dll updates info in an access.mdb 2000
and the folder where the database is stored has assigned users permissions
for the files in it
lets say IUSER for writing to the mdb ,is there a special way to use this
UserID
in the connection string when compiling the dll in VB.6 ?
Is it necessary to use the UserID in the dll's class code or this has to
deal only with ASP code?
I have used
adoConnection.Open connectString,"IUSER",""
or just
adoConnection.Open connectString
but does not work
I use cursor type adOpenDynamic, adLockOptimistic for the recordset.
The dll works fine with both connection Strings in my PWS but not in the
internet server.
Thanks For your time
If anyone can help with some info P L E A S E do
as it is a long time I cant solve this problem
Best wishes for Christmas
Pappas Nikos
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #6 by Stephane_Dattenny@D... on Tue, 26 Dec 2000 02:11:03 -0600
|
|
I think IUSER is created in MS Access db.
Anyway, you may have 2 options for a "flexible" connection string:
- you can declare it in your GLOBAL.ASA file in the Application scope
OnApplication_Start
Application("ConnectionString") = "Driver={Microsoft Access
Driver (*.mdb)};Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";"
,IUSER,""
End
Then, when you need to connect to the db, use
Application("ConnectionString") for connection string argument. If you need
to use a dll component, just add the connection string as an argument to
your method that need to connect to the db.
- you can store the connection string in the Windows Registry, but I don't
think your host will allow that !!
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 23 December 2000 09:01
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Best Regards Stephane
your comment helped me clear a few shadows in my knowledge base
many of those still there to clear out but its a great help.
If I change other things like references I suppose I have to reregister.
Updating the mdb from ASP page:
For the connection string in the ASP sidescript if I don't specify
UserID it does not work (writing to the mdb) only this way works
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,IUSER,""
The responce from my host when I asked about security replied
"we checked the files under /DATA ( visitor.mdb) and given IUSER user write
permissions"
you recommend I don't need this IUSER In the Dll code?
Thanks once more
Happy Holidays
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Friday, December 22, 2000 7:22 AM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
1) You don't have to register the dll again (because you only chenged the
code)
2) As I said in my previous mail, there is a difference with security: the
one where the host protects data folder use NT security. The one you use to
access your database use integrated MS Access security; Then you don't have
to specify the username when you open your connection. The problem with your
error message is probably because the database is set in an exclusive mode.
Open the database with MS Access, go to Tools/Options/Advanced. Check
Default Open Mode to SHARED.
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 23 December 2000 00:57
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Dear Stephane
Thank you very much for your response
I tried to say too much in my previous email so here I go again
I have a site hosted somewhere and my host protects the data folder
by using read and write permission for this folder to SOMEUSER.
>From ASP side script to update recordsets I use
-----------
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,SOMEUSER,""
-----------
and works fine.
In my Dll's class to compile for making the Dll
----------
Public Function setVisitor(ByVal firstName As Variant, ByVal lastName As
Variant, ByVal Email As Variant) As Variant
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String
Dim objLocalContext As ObjectContext
Dim objServer As ASPTypeLibrary.Server
Set objLocalContext = GetObjectContext()
Set objServer = objLocalContext("Server")
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & objServer.MapPath("../data/Visitors.mdb")
& ";Persist Security Info=False"
Set adoConnection = CreateObject("ADODB.Connection")
Set adoRecordset = CreateObject("ADODB.Recordset")
adoConnection.Open connectString,"SOMEUSER",""
adoRecordset.Open "SELECT * FROM SiteVisitors", adoConnection, _
adOpenDynamic, adLockOptimistic
----------
etc.etc.
I can send the whole code if you like too
it is from Wrox begginning vb6 programming
So if I change the code like
adoConnection.Open connectString,"ADMIN",""
The dll needs to be reregistered?
Is there any other way to use the UserID?
I am very possitive that the connection is the problem.
Can you recommend refferences to my dll?
I use
------------------------------------------------------------
Visual Basic For Applications MSVBVM60.DLL
Visual Basic runtime objects and procedures MSVBVM60.DLL\3
Visual Basic objects and procedures
Microsoft Transaction Server Type Library
Microsoft ActiveX Data Objects 2.1
Microsoft Active Server Pages Object Library
Microsoft Active Server Pages 2.0 ObjectContext Class Type Library
------------------------------------------------------------
The error was
unable to start application the file does not exist or opened exclissively
by annother user
Thanks again Stephanie
Best wishes to everyone for
Christmas and 2001
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Thursday, December 21, 2000 11:53 PM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Hi
1) You don't have to register it again only if you change the code. If you
change properties, methods (parameters or name), delete a method, add a new
one, you break the compatibility (a new CLSID is created for your class).
Then you must register it again. If you use MTS, you must delete the classes
from the package and import them again, or use the mtxreg.....exe in MTS
directory (I don't know how to use it).
2) The connection's username and the file permissions username are 2
different things. The connection's username is important only when you use
Access integrated security (when you define users who can access the
database). If you want to write to you're Access database, you must provide
full access to the directory and the mdb file). If it works on your PWS and
not on IIS (that's what I suppose), maybe a dll is missing on the
IUSR_<SERVER_NAME> doesn't have full access to the DB. What's the error
message ?
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 22 December 2000 13:29
To: ASP Databases
Subject: [asp_databases] DLL registering and connection string
Hi all
I have 2 questions
First forgive my English ( not the best you can find )
If in a server there's a dll registered and I make some change in the code
and I replace it with a mew one same name and version , does it have to be
reregistered again?
and a second question:
The dll updates info in an access.mdb 2000
and the folder where the database is stored has assigned users permissions
for the files in it
lets say IUSER for writing to the mdb ,is there a special way to use this
UserID
in the connection string when compiling the dll in VB.6 ?
Is it necessary to use the UserID in the dll's class code or this has to
deal only with ASP code?
I have used
adoConnection.Open connectString,"IUSER",""
or just
adoConnection.Open connectString
but does not work
I use cursor type adOpenDynamic, adLockOptimistic for the recordset.
The dll works fine with both connection Strings in my PWS but not in the
internet server.
Thanks For your time
If anyone can help with some info P L E A S E do
as it is a long time I cant solve this problem
Best wishes for Christmas
Pappas Nikos
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #7 by "Pappas Nikos" <pappas@c...> on Tue, 26 Dec 2000 16:22:53 -0800
|
|
Stephanie thanks for the help
you provide
I will do my best to check all the available options.
I have downloaded the mdb from the server and there was nothing there
like users added or perditions so should be NT security for the folder.
Best regards and happy new year
Nikos
-----Original Message-----
From: Stephane_Dattenny@D... [mailto:Stephane_Dattenny@D...]
Sent: Tuesday, December 26, 2000 12:11 AM
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
I think IUSER is created in MS Access db.
Anyway, you may have 2 options for a "flexible" connection string:
- you can declare it in your GLOBAL.ASA file in the Application scope
OnApplication_Start
Application("ConnectionString") = "Driver={Microsoft Access
Driver (*.mdb)};Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";"
,IUSER,""
End
Then, when you need to connect to the db, use
Application("ConnectionString") for connection string argument. If you need
to use a dll component, just add the connection string as an argument to
your method that need to connect to the db.
- you can store the connection string in the Windows Registry, but I don't
think your host will allow that !!
Best regards / Cordialement
Stephane Dattenny
Dell Computers - EMEA IT - VB and Web developer
Phone: +33 (0)4 99 75 49 88
-----Original Message-----
From: Pappas Nikos [mailto:pappas@c...]
Sent: 23 December 2000 09:01
To: ASP Databases
Subject: [asp_databases] RE: DLL registering and connection string
Best Regards Stephane
your comment helped me clear a few shadows in my knowledge base
many of those still there to clear out but its a great help.
If I change other things like references I suppose I have to reregister.
Updating the mdb from ASP page:
For the connection string in the ASP sidescript if I don't specify
UserID it does not work (writing to the mdb) only this way works
DataConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("../data/Visitors.mdb")& ";" ,IUSER,""
The responce from my host when I asked about security replied
"we checked the files under /DATA ( visitor.mdb) and given IUSER user write
permissions"
you recommend I don't need this IUSER In the Dll code?
Thanks once more
Happy Holidays
Nikos
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
|
|
 |