CLEAN, QUICK, IN AND OUT OF DATABASE !!!
Seriously ... checkout my DBConn.asp scripts at ...
http://www.coolpier.com/
click on Coolpier Scripts link, then on DBConn.asp, then on Code
I would put the full path, but I am making final adjustments to the
layout of my entire website, and the path will be changing for the
last time within the next 2 weeks. ((I am then creating a nav.asp page
to keep track of my scripts ... so if I change structure ever again in
the life of the page, the nav.asp page will be changed .. and any
posts I have on the group will still have good link))
All recordsets are turned into 2-dimensional arrays using getrows ...
clean, quick, in and out of database. since performance wise/thread
wise I believe it is better to get your rs into an array, and
seperately execute updates to it ... this I think is one of the best
ways generally.
<!-- #include virtual="/coolpier_scripts/_database_tools/DBConn.asp"
-->
<%
Dim yourSQL, yourArray, yourPagingArray
cp_TheConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=" & Server.MapPath("photoalbum.mdb") & ";"
Call cp_DBConn("open")
'//INSERT, UPDATE, DELETE, or SP not returning rs
Call cp_SqlExecute("insert into table1 ('someValue') value
('something') where userID = 'someID';")
'// SELECT or SP returning rs
yourArray = cp_SqlArray("Select this from that;")
'// SELECT or SP returning rs ... PAGING (page2/20per page example
below)
yourPagingArray = cp_SqlArray_Paging("Select this from that where
theother = 'somthing';", 2, 20)
Call DBConn("close")
'// AFTER DB CLOSED ... THEN mess with displaying the data in your
array!!!
%>
Brynn
www.coolpier.com
On Tue, 20 Jan 2004 00:58:06 -0000, "Brian" <qu******@iol.ie> wrote:
hi,
when i want to do an action to the database i am using the command
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("photoalbum.mdb") & ""
Set RS1 = myConn.Execute(SQL1)
is there something else i can use if it is only an INSERT statement in the
sql because i dont actually need to create a recordset ?
Brian
Brynn
www.coolpier.com
I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!