Ask a Question related to ASP Database, Design and Development.
-
Grahammer #1
Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
For some reason I am getting an error when trying to open a recordset on an
Access database on my Win2K3 machine from my INDEX.ASP page, but the same
code accesses the database fine when coming from the GLOBAL.ASA page. I'm
using a DSN to connect to the database.
The error I'm getting is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
/index.asp, line 14
My code looks like:
dim objConn
set objConn= server.CreateObject("ADODB.Connection")
objConn.Open "DNS=SparesDB.dsn"
dim objRS
set objRS = server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM tblUsers WHERE UserName='" &
request.form("txtuser") & "' AND Password='" & request.form("txtPass") &
"';", objConn, ,3
if objRS.recordcount=1 then
...some code
The error occurs in 'set objRS = server.CreateObject("ADODB.Recordset")'
The DSN has no username/password. I have both disabling and enabling
anonymous access to the web site. Disabling access forces me to enter a
valid domain username/password combination when GLOBAL.ASA is executed, but
I still get the same error in my INDEX.ASP page.
My files are located as follows:
- D:\Internet\mypage.com\web holds my web pages (ASP, HTML, CSS, images,
etc.)
- D:\Internet\mypage.com\db holds my MS Access database (I will eventually
migrate the database to a proper MS SQL server)
- My DSN is named "SparesDB.dsn", has no password and points to my Access
file.
Since my DB folder is at the same level as my WEB folder, I shouldn't need
to specify a username or password... At least this is what I found online:
"With DSN and User ID/Password (NOTE: a user/pass is NOT needed if you place
your database in the /database directory on the same level as the public
/html directory so this is rarely used)" Is it necessary to actually name
the folders "html" and "database" ???
Any assistance is appreciated!!!
Grahammer Guest
-
HELP SQL Update syntax error in windows2003 but works fine in NT4???
We upgraded our production server to windows 2003 and have been seeing this error when trying to update the database through a cfquery tag: ODBC... -
Error after creating second recordset
I'm working on creating a web application with data from an Access database. The first project is an inser record form which displays just fine... -
Object Reference Error on ADODB.RecordSet Fields
One of my developers is working on a .Net web app that has a wee bit o legacy code in Page_Onload: .... Dim MySelect as String = "SELECT User... -
Vb6 object returning ADO Recordset - Error in .NET
Hi, My C#, ASP.NET application uses com-interop to call a vb6 method which returns a ADO 2.6 recordset. I can successfully call the COM... -
global.asa error 'The object has an invalid ProgID...'
win2k adv serv, iis5.0 trying to activate ado constants etc, once in the global.asa file to be efficient about that with <!--METADATA... -
Grahammer #2
Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
For some reason I am getting an error when trying to open a recordset on an
Access database on my Win2K3 machine from my INDEX.ASP page, but the same
code accesses the database fine when coming from the GLOBAL.ASA page. I'm
using a DSN to connect to the database.
The error I'm getting is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
/index.asp, line 14
My code looks like:
dim objConn
set objConn= server.CreateObject("ADODB.Connection")
objConn.Open "DNS=SparesDB.dsn"
dim objRS
set objRS = server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM tblUsers WHERE UserName='" &
request.form("txtuser") & "' AND Password='" & request.form("txtPass") &
"';", objConn, ,3
if objRS.recordcount=1 then
...some code
The error occurs in 'set objRS = server.CreateObject("ADODB.Recordset")'
The DSN has no username/password. I have both disabling and enabling
anonymous access to the web site. Disabling access forces me to enter a
valid domain username/password combination when GLOBAL.ASA is executed, but
I still get the same error in my INDEX.ASP page.
My files are located as follows:
- D:\Internet\mypage.com\web holds my web pages (ASP, HTML, CSS, images,
etc.)
- D:\Internet\mypage.com\db holds my MS Access database (I will eventually
migrate the database to a proper MS SQL server)
- My DSN is named "SparesDB.dsn", has no password and points to my Access
file.
Since my DB folder is at the same level as my WEB folder, I shouldn't need
to specify a username or password... At least this is what I found online:
"With DSN and User ID/Password (NOTE: a user/pass is NOT needed if you place
your database in the /database directory on the same level as the public
/html directory so this is rarely used)" Is it necessary to actually name
the folders "html" and "database" ???
Any assistance is appreciated!!!
Grahammer Guest
-
Ken Schaefer #3
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
The problem is this line:
objConn.Open "DNS=SparesDB.dsn"
Instead, use:
objConn.Open "DSN=SparesDB"
(note DSN is misspelt, and you don't need the extension if you have a system
DSN, since the information is stored in the registry).
That said you should probably use the Jet OLEDB Provider instead.
Cheers
Ken
"Grahammer" <postmaster@127.0.0.1> wrote in message
news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
: For some reason I am getting an error when trying to open a recordset on
an
: Access database on my Win2K3 machine from my INDEX.ASP page, but the same
: code accesses the database fine when coming from the GLOBAL.ASA page. I'm
: using a DSN to connect to the database.
:
: The error I'm getting is:
: Microsoft OLE DB Provider for ODBC Drivers error '80004005'
: [Microsoft][ODBC Driver Manager] Data source name not found and no
: default driver specified
: /index.asp, line 14
:
: My code looks like:
: dim objConn
: set objConn= server.CreateObject("ADODB.Connection")
: objConn.Open "DNS=SparesDB.dsn"
: dim objRS
: set objRS = server.CreateObject("ADODB.Recordset")
: objRS.Open "SELECT * FROM tblUsers WHERE UserName='" &
: request.form("txtuser") & "' AND Password='" & request.form("txtPass") &
: "';", objConn, ,3
: if objRS.recordcount=1 then
: ...some code
:
: The error occurs in 'set objRS = server.CreateObject("ADODB.Recordset")'
:
: The DSN has no username/password. I have both disabling and enabling
: anonymous access to the web site. Disabling access forces me to enter a
: valid domain username/password combination when GLOBAL.ASA is executed,
but
: I still get the same error in my INDEX.ASP page.
:
: My files are located as follows:
: - D:\Internet\mypage.com\web holds my web pages (ASP, HTML, CSS, images,
: etc.)
: - D:\Internet\mypage.com\db holds my MS Access database (I will
eventually
: migrate the database to a proper MS SQL server)
: - My DSN is named "SparesDB.dsn", has no password and points to my Access
: file.
:
: Since my DB folder is at the same level as my WEB folder, I shouldn't need
: to specify a username or password... At least this is what I found online:
: "With DSN and User ID/Password (NOTE: a user/pass is NOT needed if you
place
: your database in the /database directory on the same level as the public
: /html directory so this is rarely used)" Is it necessary to actually name
: the folders "html" and "database" ???
:
: Any assistance is appreciated!!!
:
:
Ken Schaefer Guest
-
Ken Schaefer #4
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
The problem is this line:
objConn.Open "DNS=SparesDB.dsn"
Instead, use:
objConn.Open "DSN=SparesDB"
(note DSN is misspelt, and you don't need the extension if you have a system
DSN, since the information is stored in the registry).
That said you should probably use the Jet OLEDB Provider instead.
Cheers
Ken
"Grahammer" <postmaster@127.0.0.1> wrote in message
news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
: For some reason I am getting an error when trying to open a recordset on
an
: Access database on my Win2K3 machine from my INDEX.ASP page, but the same
: code accesses the database fine when coming from the GLOBAL.ASA page. I'm
: using a DSN to connect to the database.
:
: The error I'm getting is:
: Microsoft OLE DB Provider for ODBC Drivers error '80004005'
: [Microsoft][ODBC Driver Manager] Data source name not found and no
: default driver specified
: /index.asp, line 14
:
: My code looks like:
: dim objConn
: set objConn= server.CreateObject("ADODB.Connection")
: objConn.Open "DNS=SparesDB.dsn"
: dim objRS
: set objRS = server.CreateObject("ADODB.Recordset")
: objRS.Open "SELECT * FROM tblUsers WHERE UserName='" &
: request.form("txtuser") & "' AND Password='" & request.form("txtPass") &
: "';", objConn, ,3
: if objRS.recordcount=1 then
: ...some code
:
: The error occurs in 'set objRS = server.CreateObject("ADODB.Recordset")'
:
: The DSN has no username/password. I have both disabling and enabling
: anonymous access to the web site. Disabling access forces me to enter a
: valid domain username/password combination when GLOBAL.ASA is executed,
but
: I still get the same error in my INDEX.ASP page.
:
: My files are located as follows:
: - D:\Internet\mypage.com\web holds my web pages (ASP, HTML, CSS, images,
: etc.)
: - D:\Internet\mypage.com\db holds my MS Access database (I will
eventually
: migrate the database to a proper MS SQL server)
: - My DSN is named "SparesDB.dsn", has no password and points to my Access
: file.
:
: Since my DB folder is at the same level as my WEB folder, I shouldn't need
: to specify a username or password... At least this is what I found online:
: "With DSN and User ID/Password (NOTE: a user/pass is NOT needed if you
place
: your database in the /database directory on the same level as the public
: /html directory so this is rarely used)" Is it necessary to actually name
: the folders "html" and "database" ???
:
: Any assistance is appreciated!!!
:
:
Ken Schaefer Guest
-
Grahammer #5
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
Do I feel like an idiot!
I stared at that thing for an HOUR!
I appreciate it muchly!
BTW... I'm quite new to this. What is involved in using the Jet OLEDB
provider?
Thanks!
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:uGYaCpxZDHA.2072@TK2MSFTNGP10.phx.gbl...a system> The problem is this line:
>
> objConn.Open "DNS=SparesDB.dsn"
>
> Instead, use:
>
> objConn.Open "DSN=SparesDB"
>
> (note DSN is misspelt, and you don't need the extension if you have> DSN, since the information is stored in the registry).
>
> That said you should probably use the Jet OLEDB Provider instead.recordset on> "Grahammer" <postmaster@127.0.0.1> wrote in message
> news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
> : For some reason I am getting an error when trying to open athe same> an
> : Access database on my Win2K3 machine from my INDEX.ASP page, butpage. I'm> : code accesses the database fine when coming from the GLOBAL.ASAno> : using a DSN to connect to the database.
> :
> : The error I'm getting is:
> : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> : [Microsoft][ODBC Driver Manager] Data source name not found and> : default driver specified
> : /index.asp, line 14
Grahammer Guest
-
Grahammer #6
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
Do I feel like an idiot!
I stared at that thing for an HOUR!
I appreciate it muchly!
BTW... I'm quite new to this. What is involved in using the Jet OLEDB
provider?
Thanks!
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:uGYaCpxZDHA.2072@TK2MSFTNGP10.phx.gbl...a system> The problem is this line:
>
> objConn.Open "DNS=SparesDB.dsn"
>
> Instead, use:
>
> objConn.Open "DSN=SparesDB"
>
> (note DSN is misspelt, and you don't need the extension if you have> DSN, since the information is stored in the registry).
>
> That said you should probably use the Jet OLEDB Provider instead.recordset on> "Grahammer" <postmaster@127.0.0.1> wrote in message
> news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
> : For some reason I am getting an error when trying to open athe same> an
> : Access database on my Win2K3 machine from my INDEX.ASP page, butpage. I'm> : code accesses the database fine when coming from the GLOBAL.ASAno> : using a DSN to connect to the database.
> :
> : The error I'm getting is:
> : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> : [Microsoft][ODBC Driver Manager] Data source name not found and> : default driver specified
> : /index.asp, line 14
Grahammer Guest
-
Ken Schaefer #7
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
strConnect = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\database\myDatabase.mdb;"
If you don't know the physical path to your database, you can use the
Server.Mappath() function to return the physical path.
The latest Jet Provider is available here:
[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;282010&[/url]
Cheers
Ken
"Grahammer" <webmaster@127.0.0.1> wrote in message
news:e%23mB4cyZDHA.2024@TK2MSFTNGP12.phx.gbl...
: Do I feel like an idiot!
:
: I stared at that thing for an HOUR!
:
: I appreciate it muchly!
:
: BTW... I'm quite new to this. What is involved in using the Jet OLEDB
: provider?
:
: Thanks!
:
:
: "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
: news:uGYaCpxZDHA.2072@TK2MSFTNGP10.phx.gbl...
: > The problem is this line:
: >
: > objConn.Open "DNS=SparesDB.dsn"
: >
: > Instead, use:
: >
: > objConn.Open "DSN=SparesDB"
: >
: > (note DSN is misspelt, and you don't need the extension if you have
: a system
: > DSN, since the information is stored in the registry).
: >
: > That said you should probably use the Jet OLEDB Provider instead.
:
: > "Grahammer" <postmaster@127.0.0.1> wrote in message
: > news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
: > : For some reason I am getting an error when trying to open a
: recordset on
: > an
: > : Access database on my Win2K3 machine from my INDEX.ASP page, but
: the same
: > : code accesses the database fine when coming from the GLOBAL.ASA
: page. I'm
: > : using a DSN to connect to the database.
: > :
: > : The error I'm getting is:
: > : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
: > : [Microsoft][ODBC Driver Manager] Data source name not found and
: no
: > : default driver specified
: > : /index.asp, line 14
:
:
Ken Schaefer Guest
-
Ken Schaefer #8
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
strConnect = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\database\myDatabase.mdb;"
If you don't know the physical path to your database, you can use the
Server.Mappath() function to return the physical path.
The latest Jet Provider is available here:
[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;282010&[/url]
Cheers
Ken
"Grahammer" <webmaster@127.0.0.1> wrote in message
news:e%23mB4cyZDHA.2024@TK2MSFTNGP12.phx.gbl...
: Do I feel like an idiot!
:
: I stared at that thing for an HOUR!
:
: I appreciate it muchly!
:
: BTW... I'm quite new to this. What is involved in using the Jet OLEDB
: provider?
:
: Thanks!
:
:
: "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
: news:uGYaCpxZDHA.2072@TK2MSFTNGP10.phx.gbl...
: > The problem is this line:
: >
: > objConn.Open "DNS=SparesDB.dsn"
: >
: > Instead, use:
: >
: > objConn.Open "DSN=SparesDB"
: >
: > (note DSN is misspelt, and you don't need the extension if you have
: a system
: > DSN, since the information is stored in the registry).
: >
: > That said you should probably use the Jet OLEDB Provider instead.
:
: > "Grahammer" <postmaster@127.0.0.1> wrote in message
: > news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
: > : For some reason I am getting an error when trying to open a
: recordset on
: > an
: > : Access database on my Win2K3 machine from my INDEX.ASP page, but
: the same
: > : code accesses the database fine when coming from the GLOBAL.ASA
: page. I'm
: > : using a DSN to connect to the database.
: > :
: > : The error I'm getting is:
: > : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
: > : [Microsoft][ODBC Driver Manager] Data source name not found and
: no
: > : default driver specified
: > : /index.asp, line 14
:
:
Ken Schaefer Guest
-
Grahammer #9
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
Thanks Ken!
I'll look into it.
At the moment, portability is more important that performance.
This system MAY move to a MSSQL server, MySQL or possibly Oracle. If I
read correctly the ODBC connection provided by the DSN provides a
common interface to these databases.
I will do some more digging though.
Thanks!
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:uVpXJo4ZDHA.2136@TK2MSFTNGP10.phx.gbl...the> strConnect = _
> "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=c:\database\myDatabase.mdb;"
>
> If you don't know the physical path to your database, you can useOLEDB> Server.Mappath() function to return the physical path.
>
> The latest Jet Provider is available here:
> [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;282010&[/url]
>
> Cheers
> Ken
>
> "Grahammer" <webmaster@127.0.0.1> wrote in message
> news:e%23mB4cyZDHA.2024@TK2MSFTNGP12.phx.gbl...
> : Do I feel like an idiot!
> :
> : I stared at that thing for an HOUR!
> :
> : I appreciate it muchly!
> :
> : BTW... I'm quite new to this. What is involved in using the Jethave> : provider?
> :
> : Thanks!
> :
> :
> : "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
> : news:uGYaCpxZDHA.2072@TK2MSFTNGP10.phx.gbl...
> : > The problem is this line:
> : >
> : > objConn.Open "DNS=SparesDB.dsn"
> : >
> : > Instead, use:
> : >
> : > objConn.Open "DSN=SparesDB"
> : >
> : > (note DSN is misspelt, and you don't need the extension if youinstead.> : a system
> : > DSN, since the information is stored in the registry).
> : >
> : > That said you should probably use the Jet OLEDB Providerbut> :
> : > "Grahammer" <postmaster@127.0.0.1> wrote in message
> : > news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
> : > : For some reason I am getting an error when trying to open a
> : recordset on
> : > an
> : > : Access database on my Win2K3 machine from my INDEX.ASP page,GLOBAL.ASA> : the same
> : > : code accesses the database fine when coming from theand> : page. I'm
> : > : using a DSN to connect to the database.
> : > :
> : > : The error I'm getting is:
> : > : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> : > : [Microsoft][ODBC Driver Manager] Data source name not found> : no
> : > : default driver specified
> : > : /index.asp, line 14
> :
> :
>
>
Grahammer Guest
-
Grahammer #10
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
Thanks Ken!
I'll look into it.
At the moment, portability is more important that performance.
This system MAY move to a MSSQL server, MySQL or possibly Oracle. If I
read correctly the ODBC connection provided by the DSN provides a
common interface to these databases.
I will do some more digging though.
Thanks!
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:uVpXJo4ZDHA.2136@TK2MSFTNGP10.phx.gbl...the> strConnect = _
> "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=c:\database\myDatabase.mdb;"
>
> If you don't know the physical path to your database, you can useOLEDB> Server.Mappath() function to return the physical path.
>
> The latest Jet Provider is available here:
> [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;282010&[/url]
>
> Cheers
> Ken
>
> "Grahammer" <webmaster@127.0.0.1> wrote in message
> news:e%23mB4cyZDHA.2024@TK2MSFTNGP12.phx.gbl...
> : Do I feel like an idiot!
> :
> : I stared at that thing for an HOUR!
> :
> : I appreciate it muchly!
> :
> : BTW... I'm quite new to this. What is involved in using the Jethave> : provider?
> :
> : Thanks!
> :
> :
> : "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
> : news:uGYaCpxZDHA.2072@TK2MSFTNGP10.phx.gbl...
> : > The problem is this line:
> : >
> : > objConn.Open "DNS=SparesDB.dsn"
> : >
> : > Instead, use:
> : >
> : > objConn.Open "DSN=SparesDB"
> : >
> : > (note DSN is misspelt, and you don't need the extension if youinstead.> : a system
> : > DSN, since the information is stored in the registry).
> : >
> : > That said you should probably use the Jet OLEDB Providerbut> :
> : > "Grahammer" <postmaster@127.0.0.1> wrote in message
> : > news:efAeAPxZDHA.2284@TK2MSFTNGP12.phx.gbl...
> : > : For some reason I am getting an error when trying to open a
> : recordset on
> : > an
> : > : Access database on my Win2K3 machine from my INDEX.ASP page,GLOBAL.ASA> : the same
> : > : code accesses the database fine when coming from theand> : page. I'm
> : > : using a DSN to connect to the database.
> : > :
> : > : The error I'm getting is:
> : > : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> : > : [Microsoft][ODBC Driver Manager] Data source name not found> : no
> : > : default driver specified
> : > : /index.asp, line 14
> :
> :
>
>
Grahammer Guest
-
Bob Barrows #11
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
Grahammer wrote:
That reasoning makes no sense.> Thanks Ken!
>
> I'll look into it.
>
> At the moment, portability is more important that performance.
>
> This system MAY move to a MSSQL server, MySQL or possibly Oracle. If I
> read correctly the ODBC connection provided by the DSN provides a
> common interface to these databases.
>
> I will do some more digging though.
>
> Thanks!
>
>
If the database server name does not change when the app is ported, the
connection string does not have to change. If the database server name can
be different, the DSN would have to change as well when the app is ported..
There really is no advantage to using a DSN. In fact, MS recommends against
it:
[url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated.asp[/url]
(see the section that talks about MSDASQL )
ADO communicates with ODBC (DSN) via the MSDASQL provider.
Bob Barrows
Bob Barrows Guest
-
Bob Barrows #12
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
Grahammer wrote:
That reasoning makes no sense.> Thanks Ken!
>
> I'll look into it.
>
> At the moment, portability is more important that performance.
>
> This system MAY move to a MSSQL server, MySQL or possibly Oracle. If I
> read correctly the ODBC connection provided by the DSN provides a
> common interface to these databases.
>
> I will do some more digging though.
>
> Thanks!
>
>
If the database server name does not change when the app is ported, the
connection string does not have to change. If the database server name can
be different, the DSN would have to change as well when the app is ported..
There really is no advantage to using a DSN. In fact, MS recommends against
it:
[url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated.asp[/url]
(see the section that talks about MSDASQL )
ADO communicates with ODBC (DSN) via the MSDASQL provider.
Bob Barrows
Bob Barrows Guest
-
Grahammer #13
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:Oukr8E9ZDHA.2072@TK2MSFTNGP10.phx.gbl...If I> Grahammer wrote:> > Thanks Ken!
> >
> > I'll look into it.
> >
> > At the moment, portability is more important that performance.
> >
> > This system MAY move to a MSSQL server, MySQL or possibly Oracle.It does to me... I don't know what I'm doing, yet!> That reasoning makes no sense.> > read correctly the ODBC connection provided by the DSN provides a
> > common interface to these databases.
> >
> > I will do some more digging though.
> >
> > Thanks!
> >
> >
the> If the database server name does not change when the app is ported,name can> connection string does not have to change. If the database serverported..> be different, the DSN would have to change as well when the app is
I was just looking at "www.connectionstrings.com and see that when
using OLEDB:
For a MSSQL server - "Provider=sqloledb;Data Source=Aron1;Initial
Catalog=pubs;User Id=sa;Password=asdasd;"
For an Access database - "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;User Id=admin;Password=;"
but when using a DSN I can use the following for either kind of
database: "DSN=myDsn;Uid=username;Pwd=;"
So what this means is I just have to alter the DSN to point to a new
kind of database once I move my tables from Access to MSSQL. Seems
simpler to me. (Also, doesn't the DSN connection do some SQL
conversion when there are differences in how a specific database type
works?)
against> There really is no advantage to using a DSN. In fact, MS recommends[url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated.asp[/url]> it:
>This is a good reason to switch though. I want to use the current> (see the section that talks about MSDASQL )
>
> ADO communicates with ODBC (DSN) via the MSDASQL provider.
technology. I'll be looking at it!
Grahammer Guest
-
Grahammer #14
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:Oukr8E9ZDHA.2072@TK2MSFTNGP10.phx.gbl...If I> Grahammer wrote:> > Thanks Ken!
> >
> > I'll look into it.
> >
> > At the moment, portability is more important that performance.
> >
> > This system MAY move to a MSSQL server, MySQL or possibly Oracle.It does to me... I don't know what I'm doing, yet!> That reasoning makes no sense.> > read correctly the ODBC connection provided by the DSN provides a
> > common interface to these databases.
> >
> > I will do some more digging though.
> >
> > Thanks!
> >
> >
the> If the database server name does not change when the app is ported,name can> connection string does not have to change. If the database serverported..> be different, the DSN would have to change as well when the app is
I was just looking at "www.connectionstrings.com and see that when
using OLEDB:
For a MSSQL server - "Provider=sqloledb;Data Source=Aron1;Initial
Catalog=pubs;User Id=sa;Password=asdasd;"
For an Access database - "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;User Id=admin;Password=;"
but when using a DSN I can use the following for either kind of
database: "DSN=myDsn;Uid=username;Pwd=;"
So what this means is I just have to alter the DSN to point to a new
kind of database once I move my tables from Access to MSSQL. Seems
simpler to me. (Also, doesn't the DSN connection do some SQL
conversion when there are differences in how a specific database type
works?)
against> There really is no advantage to using a DSN. In fact, MS recommends[url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated.asp[/url]> it:
>This is a good reason to switch though. I want to use the current> (see the section that talks about MSDASQL )
>
> ADO communicates with ODBC (DSN) via the MSDASQL provider.
technology. I'll be looking at it!
Grahammer Guest
-
Aaron Bertrand - MVP #15
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
> [url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated.asp[/url]
Thanks, added this link to [url]www.aspfaq.com/2126[/url]> (see the section that talks about MSDASQL )
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #16
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
> [url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated.asp[/url]
Thanks, added this link to [url]www.aspfaq.com/2126[/url]> (see the section that talks about MSDASQL )
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #17
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
> So what this means is I just have to alter the DSN to point to a new
Big deal.> kind of database once I move my tables from Access to MSSQL.
How often are you planning to migrate? Once?
By using a DSN, you ease administrative hassles when you move to a new
machine (never mind migrating database platforms) -- someone with admin
privileges on the web server will have to add the DSN if you switch servers,
and many hosts charge a fee for that.
By using the native OLE-DB provider, you ensure slightly better performance
through the life of the app, and are not using deprecated,
soon-to-be-unsupported technology.
And if you think changing the DSN is going to be the biggest hassle when you
move from Access to SQL Server, you might want to go over this article:
[url]http://www.aspfaq.com/2214[/url]
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #18
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
> So what this means is I just have to alter the DSN to point to a new
Big deal.> kind of database once I move my tables from Access to MSSQL.
How often are you planning to migrate? Once?
By using a DSN, you ease administrative hassles when you move to a new
machine (never mind migrating database platforms) -- someone with admin
privileges on the web server will have to add the DSN if you switch servers,
and many hosts charge a fee for that.
By using the native OLE-DB provider, you ensure slightly better performance
through the life of the app, and are not using deprecated,
soon-to-be-unsupported technology.
And if you think changing the DSN is going to be the biggest hassle when you
move from Access to SQL Server, you might want to go over this article:
[url]http://www.aspfaq.com/2214[/url]
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #19
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
> By using a DSN, you ease administrative hassles
Sorry, this should say add, not ease.
Also, a recommendation: store your connection string in an #include file
that gets referenced in all data access pages, or in an application variable
from global.asa. This way, when you migrate to a real database, "all that
hard work" of changing the connection string is only done once, instead of
multiple times (or with a search and replace tool, if all the files have an
identical connection string).
Or, maybe, you could just use MSDE now, instead of mucking with Crap-cess at
all. The transition from MSDE to SQL Server will be essentially seamless.
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #20
Re: Error 80004005 when creating recordset object in ASP file, but works fine in Global.ASA
> By using a DSN, you ease administrative hassles
Sorry, this should say add, not ease.
Also, a recommendation: store your connection string in an #include file
that gets referenced in all data access pages, or in an application variable
from global.asa. This way, when you migrate to a real database, "all that
hard work" of changing the connection string is only done once, instead of
multiple times (or with a search and replace tool, if all the files have an
identical connection string).
Or, maybe, you could just use MSDE now, instead of mucking with Crap-cess at
all. The transition from MSDE to SQL Server will be essentially seamless.
Aaron Bertrand - MVP Guest



Reply With Quote

