|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > What's wrong on this code (connecting to MSSQL) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|