If I am using ASP and access an Access database, but I am not using ADO,
what is the name of the database methodology I am using ? 10 1351
What about showing us some code ?
--
Patrice
"PW" <pw***@SPAMbigpond.net.au> a écrit dans le message de news: uL**************@TK2MSFTNGP04.phx.gbl... If I am using ASP and access an Access database, but I am not using ADO, what is the name of the database methodology I am using ?
PW wrote: If I am using ASP and access an Access database, but I am not using ADO, what is the name of the database methodology I am using ?
Are we supposed to read your mind? Give us an example.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl... PW wrote: If I am using ASP and access an Access database, but I am not using ADO, what is the name of the database methodology I am using ?
Are we supposed to read your mind? Give us an example. -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Apoogies for not posting an example before ...
<td>
myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Session("SystemDatabaseName")
set rs1=server.createobject("adodb.recordset")
rs1.CursorLocation = 3
rs1.CursorType = 3
mySQL = ""
mySQL = mySQL & "SELECT DISTINCT"
mySQL = mySQL & " ESCI, ESCN "
mySQL = mySQL & "FROM "
mySQL = mySQL & " QTags "
mySQL = mySQL & "ORDER BY "
mySQL = mySQL & " ESCI "
rs1.open mySQL,myDSN
myQueryString = Request.QueryString("lbESCI")
mySearchString = Request.QueryString("txtSearch")
<form method="GET" action="index.asp">
<input type="submit" value="Ok" style="width:
<%=Session("SystemButtonWidth")%>; height:
<%=Session("SystemButtonheight")%>;">
Q-TAGS SELECTION LIST
<br>
<SELECT name="lbESCI" size="9"
style="font-size:10;color:BLACK;font-family:ARIAL">
<%
Do While Not rs1.EOF
if mySearchString <> "" then
if rs1("ESCI") = mySearchString then
response.write "<option selected>"
else
response.write "<option>"
end if
elseif rs1("ESCI") = left(myQueryString,6) then
response.write "<option selected>"
else
response.write "<option>"
end if
myOption = rs1("ESCI") & " | " & rs1("ESCN")
response.write myOption
response.write "</option>"
rs1.MoveNext
Loop
response.write "</select>"
%>
</form>
</td>
PW wrote: "Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl... PW wrote: If I am using ASP and access an Access database, but I am not using ADO, what is the name of the database methodology I am using ?
Are we supposed to read your mind? Give us an example. -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Apoogies for not posting an example before ...
<td> myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Session("SystemDatabaseName") set rs1=server.createobject("adodb.recordset")
Server.CreateObject("ADOdb.RecordSet")
^^^^^^
What makes you think that isn't ADO?
--
Mike Brind
PW wrote: "Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl... PW wrote: If I am using ASP and access an Access database, but I am not using ADO, what is the name of the database methodology I am using ? Are we supposed to read your mind? Give us an example.
Apoogies for not posting an example before ...
<td> myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Session("SystemDatabaseName") set rs1=server.createobject("adodb.recordset") rs1.CursorLocation = 3 rs1.CursorType = 3
Well, you ARE using ADO (see that "adodb.recordset" line?). What you are
doing is using the deprecated MSDASQL provider (which is loaded by default
when you don't specify a provider in your connection string) to connect to
the obsolete Access ODBC driver.
By reading this sentence, you should get an idea about why this practice is
not recommended, even if I had left out the words "deprecated" and
"obsolete": by making ADO use a provider to communicate with a separate data
access library, you are adding an extra, and unnecessary, layer of software
between your code and the database.
Simply use the native Jet OLE DB provider. The only time the MSDASQL
provider should be used is when a native provider for your database does not
exist, or does not provide the functionality you need. Neither of these is
the case with Jet.
The other thing you are doing, also highly discouraged BTW, is failing to
use an explicit connection object. By supplying a string instead of a
connection object in the rs.open statement, you are causing ADO to open an
implicit connection. This is bad because:
1. You have no direct control over the connection and thus cannot explicitly
close it without accessing the recordset's ActiveConnection property.
2. Using implicit connections can disable ADO Session Pooling, resulting in
too many connections being opened to the database.
Always create and open an explicit connection object and use it for
subsequent database activity. You are not really saving yourself any time
when you use implicit connections, and you could definitely be causing
problems for your web server.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
> Well, you ARE using ADO (see that "adodb.recordset" line?). What you are doing is using the deprecated MSDASQL provider (which is loaded by default when you don't specify a provider in your connection string) to connect to the obsolete Access ODBC driver.
By reading this sentence, you should get an idea about why this practice is not recommended, even if I had left out the words "deprecated" and "obsolete": by making ADO use a provider to communicate with a separate data access library, you are adding an extra, and unnecessary, layer of software between your code and the database.
Simply use the native Jet OLE DB provider. The only time the MSDASQL provider should be used is when a native provider for your database does not exist, or does not provide the functionality you need. Neither of these is the case with Jet.
The other thing you are doing, also highly discouraged BTW, is failing to use an explicit connection object. By supplying a string instead of a connection object in the rs.open statement, you are causing ADO to open an implicit connection. This is bad because: 1. You have no direct control over the connection and thus cannot explicitly close it without accessing the recordset's ActiveConnection property. 2. Using implicit connections can disable ADO Session Pooling, resulting in too many connections being opened to the database.
Always create and open an explicit connection object and use it for subsequent database activity. You are not really saving yourself any time when you use implicit connections, and you could definitely be causing problems for your web server.
Ok, I have replaced my connection string with ...
myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Session("SystemDatabaseName")
I'm not quite sure what change to make to change to an explicit connection
object. Can you give me an example?
TIA,
PW
PW wrote: Well, you ARE using ADO (see that "adodb.recordset" line?). What you are doing is using the deprecated MSDASQL provider (which is loaded by default when you don't specify a provider in your connection string) to connect to the obsolete Access ODBC driver.
By reading this sentence, you should get an idea about why this practice is not recommended, even if I had left out the words "deprecated" and "obsolete": by making ADO use a provider to communicate with a separate data access library, you are adding an extra, and unnecessary, layer of software between your code and the database.
Simply use the native Jet OLE DB provider. The only time the MSDASQL provider should be used is when a native provider for your database does not exist, or does not provide the functionality you need. Neither of these is the case with Jet.
The other thing you are doing, also highly discouraged BTW, is failing to use an explicit connection object. By supplying a string instead of a connection object in the rs.open statement, you are causing ADO to open an implicit connection. This is bad because: 1. You have no direct control over the connection and thus cannot explicitly close it without accessing the recordset's ActiveConnection property. 2. Using implicit connections can disable ADO Session Pooling, resulting in too many connections being opened to the database.
Always create and open an explicit connection object and use it for subsequent database activity. You are not really saving yourself any time when you use implicit connections, and you could definitely be causing problems for your web server.
Ok, I have replaced my connection string with ... myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("SystemDatabaseName")
I'm not quite sure what change to make to change to an explicit connection object. Can you give me an example?
TIA, PW
Set conn = Server.CreateObject("ADODB.Connection")
myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Session("SystemDatabaseName")
conn.Open myDSN
--
Mike Brind
PW wrote: Always create and open an explicit connection object and use it for subsequent database activity. You are not really saving yourself any time when you use implicit connections, and you could definitely be causing problems for your web server.
Ok, I have replaced my connection string with ... myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("SystemDatabaseName")
I'm not quite sure what change to make to change to an explicit connection object. Can you give me an example?
dim cn
set cn=createobject("adodb.connection")
cn.open myDSN
....
rs1.open mySQL,cn,,,1
or
set rs1=cn.Execute(mySQL,,1)
And, while we're at it: http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl http://groups.google.com/groups?hl=e...tngp13.phx.gbl http://groups-beta.google.com/group/...e36562fee7804e
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
> dim cn set cn=createobject("adodb.connection") cn.open myDSN ... rs1.open mySQL,cn,,,1
or
set rs1=cn.Execute(mySQL,,1)
And, while we're at it: http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl
http://groups.google.com/groups?hl=e...tngp13.phx.gbl
http://groups-beta.google.com/group/...e36562fee7804e
I think I'm already doing that in a round-about fashion ... this is what I
have in my "settings.asp"....
myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Session("SystemDatabaseName")
set rs1=server.createobject("adodb.recordset")
rs1.CursorLocation = 3
rs1.CursorType = 3
To do it the way you suggest would be ...
dim cn
myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Session("SystemDatabaseName")
set rs1=createobject("adodb.connection")
rs1.open myDSN
set rs1=cn.Execute(mySQL,,1)
Is that correct?
TIA,
PW
PS,
Bob, you're a fantastic help, thanks!
PW wrote: dim cn set cn=createobject("adodb.connection") cn.open myDSN ... rs1.open mySQL,cn,,,1
or
set rs1=cn.Execute(mySQL,,1)
And, while we're at it: http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl
http://groups.google.com/groups?hl=e...tngp13.phx.gbl
http://groups-beta.google.com/group/...e36562fee7804e
I think I'm already doing that in a round-about fashion ... this is what I have in my "settings.asp"....
myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("SystemDatabaseName") set rs1=server.createobject("adodb.recordset") rs1.CursorLocation = 3 rs1.CursorType = 3
To do it the way you suggest would be ...
dim cn myDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("SystemDatabaseName") set rs1=createobject("adodb.connection") rs1.open myDSN
Ummm. You should use "cn" instead of "rs1" in the above 2 statements. "rs1"
is already a recordset object.
set rs1=cn.Execute(mySQL,,1)
Is that correct?
Almost.
If you are going to use cn.Execute to open your recordset, then there is no
need for the "set rs1=server.createobject("adodb.recordset")" line in your
include file. Also, using Execute causes your previous settings of
CursorLocation and CursorType to be ignored. If you really want to control
the cursor type and location, do not use Execute to return a recordset.
Instead, create the recordset and set its properties as you show above, then
create and open a connection, then use the recordset's Open method to open
the recordset as I showed above.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: klaus triendl |
last post by:
hi,
recently i discovered a memory leak in our code; after some investigation i
could reduce it to the following problem:
return objects of functions are handled as temporary objects, hence...
|
by: Mario |
last post by:
Hello,
I couldn't find a solution to the following problem (tried
google and dejanews), maybe I'm using the wrong keywords?
Is there a way to open a file (a linux fifo pipe actually) in...
|
by: Yves Glodt |
last post by:
Hello,
if I do this:
for row in sqlsth:
________pkcolumns.append(row.strip())
________etc
without a prior:
|
by: Adrian Herscu |
last post by:
Hi all,
In which circumstances it is appropriate to declare methods as non-virtual?
Thanx,
Adrian.
|
by: Bern McCarty |
last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains
other than the default AppDomain? Is there any means at all of doing this?
Mixed-mode is incredibly convenient, but if I...
|
by: Patrick Kowalzick |
last post by:
Dear all,
I have an existing piece of code with a struct with some PODs.
struct A
{
int x;
int y;
};
|
by: ypjofficial |
last post by:
Hello All,
So far I have been reading that in case of a polymorphic class ( having
at least one virtual function in it), the virtual function call get
resolved at run time and during that the...
|
by: Ian825 |
last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
|
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= |
last post by:
PEP 1 specifies that PEP authors need to collect feedback from the
community. As the author of PEP 3131, I'd like to encourage comments
to the PEP included below, either here (comp.lang.python), or...
|
by: puzzlecracker |
last post by:
is it even possible or/and there is a better alternative to accept
input in a nonblocking manner?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |