Web Design and Development Forums

Go Back   Webforumz.com > Blogs > Monie

Welcome to Webforumz.com.
Register Now Register now!

Usefull Programming Code

Posted Oct 17th, 2007 at 04:17 by Monie
Updated Nov 1st, 2007 at 07:52 by monie

[MySQL Database Connection and Recordset
(DNS-LESS Connection)]

<%
Dim connectionString, conn, rs
connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydatabase; OPTION=4; UID=root;PASSWORD=mypassword;"
Set conn
= Server.CreateObject("ADODB.Connection")
conn.Open(connectionString)

Set rs
= conn.Execute("SELECT * FROM userlist")
%>

Another way to do it..

Dim connectionString, rs, conn
connectionString, = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydatabase; OPTION=4; UID=root; PASSWORD=mypassword;"
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.Open(
connectionString)
rs.Open "SELECT * FROM userlist", conn,3,3

or try this one..

<%
dim
connectionString,rs
connectionString= "DRIVER={MySQL ODBC 3.51 Driver}; SERVER = localhost; DATABASE = mydatabase; OPTION=4; UID=root; PASSWORD=mypassword;"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM userlogin",
connectionString, 1, 3
%>

[MSSQL Database Connection and Recordset (DNS-LESS Connection)]

<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/db/northwind.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn
%>

[Season Variable User Validation]

<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires
= -1
If
Session("name") = "" Then
Response.Redirect("YouShouldLoginToViewThisPage")

End If

%>

[Zebra Row Color]

<%
RowCount = 0
While ((Repeat1__numRows <> 0) AND (NOT YourRecordSet.EOF))
If (RowCount Mod 2)=0 Then RowColour = "#B3BBC1" Else RowColour = "#8D98A3"
RowCount = RowCount + 1
%>
<tr style="background-color:<%=RowColour%>">


Total Comments 0

Comments

Post a Comment Post a Comment
Total Trackbacks 0

Trackbacks

Recent Blog Entries by Monie


Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 06:57.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59