Ask a Question related to ASP Database, Design and Development.
-
Vlad #1
How to execute 2 sql commands in one sql query?
Hello,
I need to delete some records and insert new ones right
away. Is there any way to do it within the same query
string?
Set objRecordset = Server.CreateObject("ADODB.Recordset")
QueryString = "delete from Tbl_Therapy where proceduredate
= 06/02/04; insert into tbl_therapy(caseid, procedureid,
proceduredate) values(1, 99203, 06/03/04);"
Something of this nature.
It is giving me following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Characters found
after end of SQL statement.
Please help.
Thank you in advance.
Vlad Guest
-
Execute Query on trigger
Hi, I want to 2 link to drop down menus together so that the options from the second will be filtered according to the option chose in the first... -
Unable to execute shell commands
Windows 2003 ISS 6.0 That's your problem ;) try using: Linux Debain Apache 1.3 Then it will execute the shell commands. windows does not... -
How to execute an ADO query asynchronously?
Is this a valid code (running in a COM+ component)? VB class (MTSTransactionMode = 1 - NoTransactions): Private Declare Sub Sleep Lib... -
WScript.Shell to execute Ms-DOS commands?
Good morning everybody, How can I use WScript.Shell to execute Ms-DOS commands and can I see the outputs commands in the asp page? In the... -
DDE Execute Wordpad Commands
I am opening a text document in Wordpad and attempting to use "Send DDE Execute" to "Select All" text and "Copy" within Wordpad. This would enble... -
Bob Barrows [MVP] #2
Re: How to execute 2 sql commands in one sql query?
Vlad wrote:
No. Jet does not support batch execution of sql statements..> Hello,
> I need to delete some records and insert new ones right
> away. Is there any way to do it within the same query
> string?
What is the reason for this recordset object? It does not appear that you>
> Set objRecordset = Server.CreateObject("ADODB.Recordset")
are planning to return records from this query. Why create an expensive
recordset object?
> QueryString = "delete from Tbl_Therapy where proceduredate
> = 06/02/04; insert into tbl_therapy(caseid, procedureid,
> proceduredate) values(1, 99203, 06/03/04);"Nothing to do with your problem, but you should switch to using the native>
> Something of this nature.
> It is giving me following error:
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC Microsoft Access Driver] Characters found
> after end of SQL statement.
>
Jet OLEDB provider rather than the ODBC provider. See
[url]www.able-consulting.com/ado_conn.htm[/url] for examples connection strings using
the Provider for Microsoft Jet.
Bob Barrows
--
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] Guest
-
nick #3
Re: How to execute 2 sql commands in one sql query?
Bob Barrows [MVP] wrote:
what's the benifit of using native Jet OleDB provider rather than the> Vlad wrote:
>>>>Hello,
>>I need to delete some records and insert new ones right
>>away. Is there any way to do it within the same query
>>string?
>
> No. Jet does not support batch execution of sql statements..
>
>>>>Set objRecordset = Server.CreateObject("ADODB.Recordset")
>
> What is the reason for this recordset object? It does not appear that you
> are planning to return records from this query. Why create an expensive
> recordset object?
>
>>>>QueryString = "delete from Tbl_Therapy where proceduredate
>>= 06/02/04; insert into tbl_therapy(caseid, procedureid,
>>proceduredate) values(1, 99203, 06/03/04);"
>
>>>>Something of this nature.
>>It is giving me following error:
>>Error Type:
>>Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
>>[Microsoft][ODBC Microsoft Access Driver] Characters found
>>after end of SQL statement.
>>
>
> Nothing to do with your problem, but you should switch to using the native
> Jet OLEDB provider rather than the ODBC provider. See
> [url]www.able-consulting.com/ado_conn.htm[/url] for examples connection strings using
> the Provider for Microsoft Jet.
>
> Bob Barrows
ODBC provider if it's just a simple asp page?
nick Guest
-
Bob Barrows [MVP] #4
Re: How to execute 2 sql commands in one sql query?
nick wrote:
Excuse me? Are you saying that you think it's all right to use inefficient,>
> what's the benifit of using native Jet OleDB provider rather than the
> ODBC provider if it's just a simple asp page?
obsolete techniques on simple pages, but not all right on more complex
pages? This does not compute.
IMO, there's no such thing as a "simple asp page". Don't forget: your
"simple asp page" is probably running on a web server that delivers other
asp pages, both simple and complex, as well as html pages.
Threading,performance, and robustness must be considered in this
environment. An inefficient simple asp page that gets called millions of
times will probably perform adequately when viewed in isolation, but may
have a severe impact on the other pages and applications being served by
your web server.
MS has deprecated the OLEDB Provider for ODBC drivers (MSDASQL). This means
that new functionality, perfiormance and stability enhancements, etc. that
will be incorporated in new versions of native OLEDB providers will possibly
be left out of the MSDASQL provider.
[url]http://msdn.microsoft.com/library/en-us/ado270/htm/ado_deprecated_components.asp[/url]
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Re: How to execute 2 sql commands in one sql query?
So, what is the way to do if I need to delete some
recordes and then insert the new ones right away?
Using objRset.delete, objRsetAddNew and objRset.update?
Or perhaps stored procedure? But this is an Access and I
am not sure how to do it in Access. Any samples or links?
Thank you.
rather than the>-----Original Message-----
>nick wrote:>>
>> what's the benifit of using native Jet OleDB providerto use inefficient,>>> ODBC provider if it's just a simple asp page?
>Excuse me? Are you saying that you think it's all rightmore complex>obsolete techniques on simple pages, but not all right onforget: your>pages? This does not compute.
>
>IMO, there's no such thing as a "simple asp page". Don'tthat delivers other>"simple asp page" is probably running on a web serverin this>asp pages, both simple and complex, as well as html pages.
>Threading,performance, and robustness must be consideredcalled millions of>environment. An inefficient simple asp page that getsisolation, but may>times will probably perform adequately when viewed inbeing served by>have a severe impact on the other pages and applications(MSDASQL). This means>your web server.
>
>MS has deprecated the OLEDB Provider for ODBC driversenhancements, etc. that>that new functionality, perfiormance and stabilityproviders will possibly>will be incorporated in new versions of native OLEDBus/ado270/htm/ado_deprecated_components.asp>be left out of the MSDASQL provider.
>[url]http://msdn.microsoft.com/library/en-[/url]in my From>
>HTH,
>Bob Barrows
>--
>Microsoft MVP -- ASP/ASP.NET
>Please reply to the newsgroup. The email account listedYou will get a>header is my spam trap, so I don't check it very often.>quicker response by posting to the newsgroup.
>
>
>.
>Guest
-
Bob Barrows [MVP] #6
Re: How to execute 2 sql commands in one sql query?
Are you nick?
[email]anonymous@discussions.microsoft.com[/email] wrote:Just perform two executions.> So, what is the way to do if I need to delete some
> recordes and then insert the new ones right away?
QueryString = "delete from Tbl_Therapy " & _
"where proceduredate= #06/02/04#; "
conn.Execute QueryString,,129
QueryString = "insert into tbl_therapy(caseid, " & _
"procedureid,proceduredate) " & _
"values(1, 99203, #06/03/04#);"
conn.Execute QueryString,,129
No.> Using objRset.delete, objRsetAddNew and objRset.update?
Search Google for posts by me containing the words "saved parameter> Or perhaps stored procedure? But this is an Access and I
> am not sure how to do it in Access. Any samples or links?
queries". I have posted information about this many times.
Unfortunately, even this technique (saved parameter queries) will not save
you from having to perform two executions. If you upgrade to SQL Server, you
will get the benefit of batch execution and stored procedures.
You're welcome.> Thank you.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Roland Hall #7
Re: How to execute 2 sql commands in one sql query?
"Bob Barrows [MVP]" wrote in message
news:eKhoV5GVEHA.3332@tk2msftngp13.phx.gbl...
: nick wrote:
: >
: > what's the benifit of using native Jet OleDB provider rather than the
: > ODBC provider if it's just a simple asp page?
:
: Excuse me? Are you saying that you think it's all right to use
inefficient,
: obsolete techniques on simple pages, but not all right on more complex
: pages? This does not compute.
Adding this to my list of "Questions Not To Ask" a.k.a. "How to Tick Off Bob
in One Easy Question". (O:=
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - [url]http://www.microsoft.com/technet/scriptcenter/[/url]
WSH 5.6 Documentation - [url]http://msdn.microsoft.com/downloads/list/webdev.asp[/url]
MSDN Library - [url]http://msdn.microsoft.com/library/default.asp[/url]
Roland Hall Guest
-
Bob Barrows [MVP] #8
Re: How to execute 2 sql commands in one sql query?
Roland Hall wrote:
:-)> "Bob Barrows [MVP]" wrote in message
> news:eKhoV5GVEHA.3332@tk2msftngp13.phx.gbl...>>> nick wrote:>>>>>
>>> what's the benifit of using native Jet OleDB provider rather than
>>> the ODBC provider if it's just a simple asp page?
>> Excuse me? Are you saying that you think it's all right to use
>> inefficient, obsolete techniques on simple pages, but not all right
>> on more complex pages? This does not compute.
> Adding this to my list of "Questions Not To Ask" a.k.a. "How to Tick
> Off Bob in One Easy Question". (O:=
I wasn't ticked off, but you're right: it does look like I was ticked off.
Believe it or not, I was chuckling as I wrote it. As I reread it, it's easy
to imagine myself snarling ...
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Roland Hall #9
Re: How to execute 2 sql commands in one sql query?
"Bob Barrows [MVP]" wrote in message
news:uI543QKVEHA.1036@TK2MSFTNGP12.phx.gbl...
: Roland Hall wrote:
: > "Bob Barrows [MVP]" wrote in message
: > news:eKhoV5GVEHA.3332@tk2msftngp13.phx.gbl...
: >> nick wrote:
: >>>
: >>> what's the benifit of using native Jet OleDB provider rather than
: >>> the ODBC provider if it's just a simple asp page?
: >>
: >> Excuse me? Are you saying that you think it's all right to use
: >> inefficient, obsolete techniques on simple pages, but not all right
: >> on more complex pages? This does not compute.
: >
: > Adding this to my list of "Questions Not To Ask" a.k.a. "How to Tick
: > Off Bob in One Easy Question". (O:=
:
: :-)
:
: I wasn't ticked off, but you're right: it does look like I was ticked off.
: Believe it or not, I was chuckling as I wrote it. As I reread it, it's
easy
: to imagine myself snarling ...
I thought you handled it well. The analogous question made me laugh out
loud.
Roland Hall Guest



Reply With Quote

