ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 7th, 2003, 07:42 PM
PWH PWH is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 30 PWH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
What's wrong on this code (connecting to MSSQL)

Hi!

Can somebody guide me on connecting to MSSQL using asp. Pardon me, this is my first time.

Here is the code:

dim rs_mssql1.pinoywebhosting.com

dim conn

Set conn = Server.CreateObject("ADODB.Connection")

set rs_mssql1.pinoywebhosting.com = server.createobject("adodb.recordset")

'you don't need provider name for odbc datasource name

'do not put parethesis around datasource name

conn.open "HostISC"

'conn.Open "Provider=SQLOLEDB; Data Source = (ISC); Initial Catalog =

pubs;

'User Id = sa; Password="


Set dbCommand = Server.CreateObject("ADODB.Command")

Set dbCommand.ActiveConnection = dbConnection


dbCommand.CommandText = "Log_In"

dbCommand.CommandType = adCmdStoredProc


Set prm = dbCommand.CreateParameter("@UserID", adVarChar, adParamInput, 8, trim(Request.Form ("txtName")))

dbCommand.Parameters.Append prm

Set prm = dbCommand.CreateParameter("@Password", adVarChar, adParamInput, 8, trim(Request.Form ("txtPassword")))

dbCommand.Parameters.Append prm



Set rsComplainant =Server.CreateObject("ODBC.Recordset")

set rsComplainant=dbCommand.execute


If conn.errors.count = 0 Then

Response.write "Connected OK"

End If

Reply With Quote
  #2  
Old March 8th, 2003, 03:40 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > What's wrong on this code (connecting to MSSQL)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway