Ask a Question related to ASP Database, Design and Development.
-
Micromanaged #1
2 SQL queries in 1 asp page -- Newbie
I am trying to run 2 queries against a Access2k database on a single ASP
page. I have one query working beautifully, but am not sure how to
execute the second one.
At the top of the ASP page, I have:
DIM objConn
SET objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" &_
"DBQ=" & DBPath
objConn.Open
Dim strSQL
strSQL = "First SQL statement"
DIM objRS
SET objRS=Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn
-- Data manipulation / Recordset write out --
At the end of the ASP, I have
objRS.Close
SET objRS=Nothing
objConn.Close
Set objConn=Nothing
Where and with what code should I insert to execute the 2nd SQL
statement?
Thanks in advance.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Micromanaged Guest
-
Queries Of Queries Single Quote Problem
When using queries of queries I'm having the following issue. Select Company_ID From qry_MyQuery Where Company_NM = 'MyString''s' <----... -
Newbie Question - Two on One Page
How do I use acrobat and change my pdf so that I have two of the same document on one page. Do I need a plugin and if so which one? All help is... -
A bundle of newbie queries
I've finally overcome my newbie embarrassment enough to post about actual code -------------------- After a couple of years(!) of about-to, I... -
newbie: asp page templatess
hi i am quite new to .net and am trying to implement page templates but i just cant seem to get it to work, and i dont quite follow the examples on... -
HELP! Dreamweaver MX running delete queries at top of page!
OK. Seeing that noone is replying to the post on Macromedia web site I thought I might try here. Has anyone seen this problem before. It's really... -
Bob Barrows [MVP] #2
Re: 2 SQL queries in 1 asp page -- Newbie
Micromanaged wrote:
Depends on what you want to do with it, but this looks like a good place for> I am trying to run 2 queries against a Access2k database on a single
> ASP page. I have one query working beautifully, but am not sure how
> to execute the second one.
>
> At the top of the ASP page, I have:
> DIM objConn
> SET objConn=Server.CreateObject("ADODB.Connection")
> objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};"
> &_ "DBQ=" & DBPath
> objConn.Open
> Dim strSQL
> strSQL = "First SQL statement"
> DIM objRS
> SET objRS=Server.CreateObject("ADODB.Recordset")
> objRS.Open strSQL, objConn
>
> -- Data manipulation / Recordset write out --
>
> At the end of the ASP, I have
> objRS.Close
it ...
--> SET objRS=Nothing
> objConn.Close
> Set objConn=Nothing
>
> Where and with what code should I insert to execute the 2nd SQL
> statement?
>
> Thanks in advance.
>
>
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
-
monki #3
Re: 2 SQL queries in 1 asp page -- Newbie
Im newish to asp myself so i dont know if this is the best way but it works
on the pages I have done
Create a second recordset & sql string i.e.
(you may be able to set objRS to nothing and open it again calling the other
sql string)
Dim strSQL1
strSQL1 = "Second SQL statement"
DIM objRS1
SET objRS1=Server.CreateObject("ADODB.Recordset")
and then call it
objRS1.Open strSQL1, objConn
render the data
objRS1.Close
SET objRS1=Nothing
hope the above is of use
J
"Micromanaged" <novirus@nospam.org> wrote in message
news:uWOXphQREHA.4020@TK2MSFTNGP11.phx.gbl...> I am trying to run 2 queries against a Access2k database on a single ASP
> page. I have one query working beautifully, but am not sure how to
> execute the second one.
>
> At the top of the ASP page, I have:
> DIM objConn
> SET objConn=Server.CreateObject("ADODB.Connection")
> objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" &_
> "DBQ=" & DBPath
> objConn.Open
> Dim strSQL
> strSQL = "First SQL statement"
> DIM objRS
> SET objRS=Server.CreateObject("ADODB.Recordset")
> objRS.Open strSQL, objConn
>
> -- Data manipulation / Recordset write out --
>
> At the end of the ASP, I have
> objRS.Close
> SET objRS=Nothing
> objConn.Close
> Set objConn=Nothing
>
> Where and with what code should I insert to execute the 2nd SQL
> statement?
>
> Thanks in advance.
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
monki Guest
-
Bullschmidt #4
Re: 2 SQL queries in 1 asp page -- Newbie
I usually close and destroy objRS after each SQL statement instead of
just once at the end of the page.
Best regards,
J. Paul Schmidt, Freelance ASP Web Consultant
[url]http://www.Bullschmidt.com[/url]
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex [url]http://www.devdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Bullschmidt Guest



Reply With Quote

