Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 6th, 2004, 01:06 AM
Registered User
Join Date: Aug 2004
Location: Lahore, , Pakistan.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default database connecting

im a totally new user of asp 3.0 and i have the problem in connecting the data base with asp. could anybody help me for solving the problem. i studied the book but could not fully understand the concept. could u plz show me some example code.
thanking in anticipation

Reply With Quote
  #2 (permalink)  
Old August 6th, 2004, 02:21 AM
Friend of Wrox
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post


  follow this link


there you find all the information with ASP, Database and errors...

Reply With Quote
  #3 (permalink)  
Old August 6th, 2004, 02:40 AM
Authorized User
Join Date: Aug 2004
Location: , , Singapore.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts

dim conn
set conn=server.createObject("Adodb.connection")
conn.connectionString="(Your DB driver for me:)Driver={Mysql odbc 3.51 Driver}; Server=LocalHost; (other ip address also can)DataBase=(the DB u want to connect to for me:)myTestDB; UID="User name"; (leave it blank as anomynous)PWD="your password"; "
conn.Mode=adModeRead (or sth.else)
conn.OPEN (it is open after this)

many other properties and attributes to think of,but above code sufficient for u to establish a connection.

better to try on ur own Database (mySQL recommanded) and read books!

Reply With Quote
  #4 (permalink)  
Old August 7th, 2004, 02:46 AM
Friend of Wrox
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Hi Shoaib,

Any connection to database should have the following structure.

Connection object.
Open Connection (with help of connection string) Connection strings
Recordset Object (if results are to be processed)
Open recordset with help of SQL statement and Connection Object.
Check if recordset in not empty.
Then Loop through the Recordset
   Display/Process records.
   Move to Next Record.
End of LOOP
Close Recordset
Close connection
set Recordset and connection objects to nothing.

Connecting to a Database

Or google with this link - Connecting to database

Hope that helps.

- Vijay G
Strive for Perfection
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to Database bryantms ASP.NET 3.5 Basics 3 July 9th, 2008 12:34 AM
connecting to database stealthdevil Visual Basic 2005 Basics 2 November 5th, 2007 01:31 PM
Connecting to a database mfos Classic ASP Basics 0 December 20th, 2006 07:59 AM
connecting to a database nehalw VB.NET 0 January 5th, 2005 05:59 AM
Connecting To DataBase in WAN simsimlhr C# 3 March 29th, 2004 04:41 PM

All times are GMT -4. The time now is 02:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.