26286 total geeks with 3498 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: May 31
May Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
BMW offers in-car
streaming music for
cross-Europe road
trips
NetApp: We laid off
100s, profits dived
- and it"s all YOUR
fault
Ed Miliband brands
Google"s UK tax
avoidance "WRONG"
Yahoo "won"t screw
Tumblr"? Then
Tumblr will screw
its balance sheet
Slim Shady wannabe
Zuck"s Facebook
"STOLE" MY SONG -
Eminem
Stand back,
everyone! Dragons"
Den ace HAS FOUND
THE CLOUD
Blue Coat gobbles
CCTV-for-network-tr
affic maker Solera
Word 2 to Office
365 and beyond: The
good, the bad and
the Ribbon
If you"ve bought
DRM"d film files
from Acetrax,
here"s the bad news
New Big Blue UK,
Ireland exec to
give kiss o" life
to server sales
Slashdot
Debian GNU/Hurd
2013 Released
Xbox One: No
Always-Online
Requirement, But
Needs To Phone Home
Ask Slashdot:
Moving From
Contract Developers
To Hiring One
In-House?
Quadcopter Drone
Network Will
Transport Supplies
For Disaster Relief
Congressional
Report: US Power
Grid Highly
Vulnerable To
Cyberattack
Google Chrome 27 Is
Out: 5% Faster Page
Loads
Special Ops Takes
Its Manhunts Into
Space
Aurora Attackers
Were Looking For
Google"s
Surveillance
Database
Dart Is Not the
Language You Think
It Is
EPA Makes a Rad
Decision
Article viewer

Yet another database connection in ASP



Written by:dimport
Published by:Nightscript
Published on:2003-06-21 07:19:46
Topic:ASP
Search OSI about ASP.More articles by dimport.
 viewed 6716 times send this article printer friendly

Digg this!
    Rate this article :
hmm, does anyone ever get tired of these.. anyway, heres another way to do a database connection in asp.

Dim objConn
[i]// TO COUNT RETURNED RECORDS[/i]
Dim counter
counter = 0
 [i]// USING THE NATIVE ASP SERVER OBJECT,
// CALL IT'S CreateObject METHOD TO MAKE
// objConn AN INSTANCE OF THE ADO
// CONNECTION OBJECT:[/i]
 Set objConn = Server.CreateObject("ADODB.Connection")
 // OPENS A DATA SOURCE NAME (DSN) CALLED myDSN.
objConn.Open "DSN=myDSN"
 [i]// OPEN A RECORDSET BY EXECUTING SOME
// SQL ON A TABLE IN THE OPEN CONNECTION[/i]
 Set RS = objConn.Execute("SELECT * FROM currentDogs")
 [i]// NOW RETURN THESE RECORDS IN A SIMPLE
//FORMAT TO THE WEB PAGE:[/i]
 Do While Not RS.EOF[quote]For each fld in RS.Fields
response.write fld.Name & " = " & fld.Value
Next
RS.MoveNext[/quote]Loop
 [i]// CLOSE THE CONNECTION AND THE [/i]
RECORDSET
RS.Close
objConn.Close


This article was originally written by davester20

Did you like this article? There are hundreds more.

Comments:
<none>
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:



     
Your Ad Here
 
Copyright Open Source Institute, 2006