User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 391,711 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,416 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 2662 | Replies: 1
Reply
Join Date: May 2006
Posts: 1
Reputation: amathias is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
amathias amathias is offline Offline
Newbie Poster

QUICK! Access SQL using ASP and javascript

  #1  
May 23rd, 2006
I am trying to access a SQL database and run a query. I am brand new with ASP and simply need the syntax to login and the for SQL queries in ASP. Any help would be appreciated, Thanks!

Andrew
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Location: Dallas, TX
Posts: 481
Reputation: campkev is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: QUICK! Access SQL using ASP and javascript

  #2  
May 23rd, 2006
are you looking for something like this?
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.ConnectionTimeout = 60 
dbConn.CommandTimeout = 300
dbConn.Open "DSN=DSNNAME;DATABASE=DATABASENAME","USERNAME","PASSWORD"

Set rsCustomers = Server.CreateObject("ADODB.RecordSet")
rsCustomers.ActiveConnection = dbConn


strSQL = "Select * From Customer where customerid = 1"
rsCustomers.Open strSQL,,1,3
If NOT(rsCustomers.EOF) Then
  customerName = rsCustomers("CustomerName")
  password = rsCustomers("CustomerPassword")
End If


rsCustomers.Close 
Set rsCustomers = NOTHING
dbConn.Close  
Set dbConn  = NOTHING
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 3:06 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC